BloomBooks/BloomDesktop — pull request #74 by hatton (2014-10-29 01:40:56+00:00)
Title: Bl176 update xmatter fields when user changes national language of the collection

Fixes BL-176. Books would not auto-update when user changed national language after creating the book, so some meta-data fields, notably the back cover, would be stuck in the old national language. The work-around was to do an "update book". There was no easy fix for this, because when a book is created, the old method would go through and replace, for example, "lang='N1'" with "lang='en'". We would then no longer have access to the intent of that field, and had no way of knowing, if the national language were changed to French, that we should change this field to "lang='fr'".

So, with this PR, we introduce a new attribute, "data-metalanguage" which serves to preserve that information. Every time a page is edited, code now uses it to set the language on these fields.

This change has nothing to do with normal fields, which are in bloom-translationGroup's and multilingual.

This improvement will only work for new books. Old books will need an "update book" command to get the new xmatter than uses these attributes.

The jade mixins have been changed to make use of this; existing xmatter pages will need to be re-compiled from jade to get the changes.

Sorry about the extra design/artwork commit that snuck in.