Skip to content

Localization

Section for programmers

//Request all available Localizations. The result is the dictionaries, with keys: en, fr, ru, zh-CN, ...
var allLocs = Balancy.Localization.Manager.GetAllAvailableLanguages();

//To change localization use the following method. As the parameter you need to pass one of the keys from the allLocs dictionary.
var allLocs = Balancy.Localization.Manager.ChangeLocalization(localizationCode);

//In case you store localizations outside of Balancy you can override Balancy method of getting localized values:
Balancy.Localization.Manager.OverloadLocalizationRequests((key)=>{
    return YOUR_DICTIONARY[key];
});

//To read the active localization code:
var activeLocale = Balancy.Localization.Manager.ActiveLocaleCode;

//To get localized value for the key use the following method. If the key doesn't exists, we'll return the key as value.
var localizedValue = Balancy.Localization.Manager.Get(key);