The NLocalizationManager provides simple solution for localizing Nevron's internal strings. This make it easy to localize the whole Nevron Vision suit to a language of your choice. All you have to do is to translate the XML file that contains the localizable strings in your own language and then load it in the localization manager. The translation can be done using the built-in localization manager editor.
The localization manager contains several dictionaries. Each of them holds the data for a specific component of the Nevron .NET Vision Suite. When the localization manager receives a translation request it first searches in the dictionary specified in the request and if no translation is found then it searches in the global dictionary. If the global dictionary does not contain a translation of the specified term either, then the term itself is returned as a result.
The following code demonstrates how to load the localization data:
C# |
Copy Code
|
---|---|
NLocalizationManager.Instance.Load(fileName); |
Visual Basic |
Copy Code
|
---|---|
NLocalizationManager.Instance.Load(fileName) |
To get the localized value for e specified term, you can use:
C# |
Copy Code
|
---|---|
NLocalizationManager.Instance.Translate(term, localizationContextName); |
Visual Basic |
Copy Code
|
---|---|
NLocalizationManager.Instance.Translate(term, localizationContextName) |
If you omit the localization context name (i.e. the name of the dictionary to look in first) the localization manager will search for the term only in the global dictionary.