void initLocalization(in string[][] stringsWithLocalizations, string language = "")
Initializes localization by a two-dimensional array of strings. Titles of columns (first line - index 0) must be locales in Linux style without encoding (en_US, en_GB, eo, fr_CA, ru_RU, etc.), first locale is en_US always.
Parameters
| stringsWithLocalizations | Two-dimensional array containing columns of strings in different languages. |
| language | New current language (system language by default). |
void initLocalizationWithCSV(string csvPath, string language = "")
Initializes localization by a CSV file with translations. Titles of columns (first line - index 0) must be locales in Linux style without encoding (en_US, en_GB, eo, fr_CA, ru_RU, etc.), first locale is en_US always.
Parameters
| csvPath | A path to a CSV file with translations. |
| language | A new current language (system language by default). |
void initLocalizationWithJSON(string jsonPath, string language = "")
Initializes localization by a JSON file with translations. The JSON file must contain array of objects with languages as keys and with text phrases as values.
Example
[{"en_US": "One", "eo": "Unu"},{"en_US": "Two", "eo": "Du"}] Translations must contain "en_US" always.
Parameters
| jsonPath | A path to a JSON file with translations. |
| language | A new current language (system language by default). |
void initLocalizationWithJSON(std.json.JSONValue json, string language = "")
Initializes localization by a std.json.JSON object with translations. The JSON object must contain array of objects with languages as keys and with text phrases as values.
Example
[{"en_US": "One", "eo": "Unu"},{"en_US": "Two", "eo": "Du"}] Translations must contain "en_US" always.
Parameters
| json | Filled JSON object with translations. |
| language | A new current language (system language by default). |
The module implements the simplest system for creating language localizations.