private static void UpdateContentLanguageClassesOnElement(XmlElement e, Dictionary <string, string> contentLanguages, BookData bookData, string contentLanguageIso2, string contentLanguageIso3, string[] dataDefaultLanguages)
{
HtmlDom.RemoveClassesBeginingWith(e, "bloom-content");
var lang = e.GetAttribute("lang");
//These bloom-content* classes are used by some stylesheet rules, primarily to boost the font-size of some languages.
//Enhance: this is too complex; the semantics of these overlap with each other and with bloom-visibility-code-on, and with data-language-order.
//It would be better to have non-overlapping things; 1 for order, 1 for visibility, one for the lang's role in this collection.
string orderClass;
if (contentLanguages.TryGetValue(lang, out orderClass))
{
HtmlDom.AddClass(e, orderClass); //bloom-content1, bloom-content2, bloom-content3
}
//Enhance: it's even more likely that we can get rid of these by replacing them with bloom-content2, bloom-content3
if (lang == bookData.MetadataLanguage1IsoCode)
{
HtmlDom.AddClass(e, "bloom-contentNational1");
}
if (lang == bookData.Language3IsoCode)
{
HtmlDom.AddClass(e, "bloom-contentNational2");
}
HtmlDom.RemoveClassesBeginingWith(e, "bloom-visibility-code");
if (ShouldNormallyShowEditable(lang, dataDefaultLanguages, contentLanguageIso2, contentLanguageIso3, bookData))
{
HtmlDom.AddClass(e, "bloom-visibility-code-on");
}
UpdateRightToLeftSetting(bookData, e, lang);
}