C# Class Bloom.Book.RuntimeInformationInjector

stick in a json with various string values/translations we want to make available to the javascript
Mostrar archivo Open project: BloomBooks/BloomDesktop

Public Properties

Property Type Description
TopicReversal string>.Dictionary

Public Methods

Method Description
AddUIDictionaryToDom ( HtmlDom pageDom, CollectionSettings collectionSettings ) : void
AddUISettingsToDom ( HtmlDom pageDom, CollectionSettings collectionSettings, IFileLocator fileLocator ) : void

stick in a json with various settings we want to make available to the javascript

Private Methods

Method Description
AddHtmlUiStrings ( string>.Dictionary d ) : void

For Bloom 2.0 this list is hard-coded

AddLanguagesUsedInPage ( XmlDocument xmlDocument, string>.Dictionary mapOriginalToLocalized ) : void

Add to the dictionary which maps original to Localized strings an entry for any language code that doesn't already have one. We have localizations for a few major languages that map e.g. de->German/Deutsch/etc, so they are functioning not just to localize but to expand from a language code to an actual name. For any other languages where we don't have localization information, we'd like to at least expand the cryptic code into a name. This method does that.

AddSomeCommonNationalLanguages ( string>.Dictionary d ) : void
AddTranslationToDictionaryUsingEnglishAsKey ( string>.Dictionary dictionary, string key, string defaultText ) : void
AddTranslationToDictionaryUsingKey ( string>.Dictionary dictionary, string key, string defaultText ) : void
CheckDynamicStrings ( ) : void
MakePageLabelLocalizable ( HtmlDom singlePageHtmlDom, string>.Dictionary d ) : void

Adds a script to the page that triggers i18n after the page is fully loaded.

SafelyAddLanguage ( string>.Dictionary d, string key, string name ) : void

Method Details

AddUIDictionaryToDom() public static method

public static AddUIDictionaryToDom ( HtmlDom pageDom, CollectionSettings collectionSettings ) : void
pageDom HtmlDom
collectionSettings Bloom.Collection.CollectionSettings
return void

AddUISettingsToDom() public static method

stick in a json with various settings we want to make available to the javascript
public static AddUISettingsToDom ( HtmlDom pageDom, CollectionSettings collectionSettings, IFileLocator fileLocator ) : void
pageDom HtmlDom
collectionSettings Bloom.Collection.CollectionSettings
fileLocator IFileLocator
return void

Property Details

TopicReversal public_oe static_oe property

keeps track of the most recent set of topics we injected, mapping the localization back to the original.
public static Dictionary TopicReversal
return string>.Dictionary