Home | Index classes | Index static functions | Index enumerations | Index structure types |
CLASS {Localize_str|ing_constants} , UNTESTED, BYTES, ABSTRACT :
To localize string constants in a class, it is necessary: 1. for each string constant (or string constant concatenation expression) apply a "function" _name, where name is a localization identifier for the string. E.g. _L1("This string is localizable") or "Localizable"._L1 (all these names must be unique in a class). 2. call in the application (in a function called on its initialization, e.g. in the main form CONSTRUCT) the method Localize. 3. A text file containing base (not translated) text is created either automatically in a default location, or by a call the method Save_untranslated (it is recommended to call it directly). Such file is named Default_.lng. Just copy it and rename copied file to Long_name_sn.lng (where Long_name - is a long name of your language and sn - is its short name). And replace desired original strings to translated. 4. To allow for a user to select a language for translating to it, get a list of available languages using the function Available_languages (returning the list as ';'-separated string), then use the string returned e.g. in a combo-box, then set new default current language calling the Set_language method. All translations are stored in text files looking like ini-files. Sections are rely to classes and are named in figure brackets. Each translation has a form name=value. ---------------------------------------- (C) 2017, by Vladimir Kladov
IMPORT : {String_functions} , {NATIVE_Localize_str} , {File_path} , {System_functions} , {File_stream} , {Memory_stream} , {Stream} .