diff --git a/docs/xml/lcl/lcltranslator.xml b/docs/xml/lcl/lcltranslator.xml
index 2d4cecd0c9..17c6cde26b 100644
--- a/docs/xml/lcl/lcltranslator.xml
+++ b/docs/xml/lcl/lcltranslator.xml
@@ -263,39 +263,95 @@
- TranslateLCLResourceStrings is a String function used to translate resource strings in the
- Dir is an optional path where .PO or .MO files can be found with the translated values for string constants.
+ Dir is the optional path where .po or .mo files with the translated values for string constants are located. An empty string ('') causes the predefined directories, like 'languages' or 'locale', to be used. This is the location where the
- TranslateLCLResourceStrings calls FindLocaleFileName to locate the .PO or .MO file. Preference is given to the .PO variant. If it is located in the specified path, the TranslateUnitResourceStrings routine is called to translate constants from the LCLStrConts unit.
+ TranslateLCLResourceStrings calls the TranslateUnitResourceStringsEx routine using the specified parameter values as arguments, and 'lclstrconsts' as the base unit name for the translation. TranslateUnitResourceStringsEx resolves the path, language, and file extension needed for the platform or operating system and applies the translated values.
- If a .PO file is not found, FindLocaleFileName is called to locate a .MO file used for translation. When found, the TranslateResourceStrings routine is called to translate strings using the .MO file in the specified path.
-
- The return value contains the name of the .PO or .MO file used to translate string constants, or an empty string when a file is not found in the path specified in Dir.
+ The return value contains the language identifier or locale code used in the translation. It may contain an empty string ('') if a localization file is not found for the language or an error occurs.
+ TranslateUnitResourceStringsEx is a convenience routine used to translate string constants in a specified source file to a given language. It provides arguments which identify the source file, the path to localization files, and the language requested.
+
+ Lang contains the optional language identifier requested for the translated string constants. It contains a value like 'en', 'ru' or 'de'. An empty string ('') causes the default language identifier for the platform or operating system to be used.
+
+ Dir contains the path where the localization files (.po, .mo) are located. It can contain a path relative to the directory for the application executable, or a fully qualified path to the directory with the localization files. For example: 'languages' or '/usr/share/locale'. An empty string ('') indicates that the predefined directories like 'languages' or 'locale' are used to locate the localization files.
+
+ LocaleFileName contains the base name for the localization file used to translate the values in the specified unit. It contains a value like 'lazaruside' or 'lclstrconts'. No actions are performed in the routine when LocaleFileName is an empty string ('').
+
+ LocaleUnitName contains the base name for the source code file with the string constants translated in the routine. An empty string ('') causes the value in LocaleFileName to be used as the base source code file name.
+
+ TranslateUnitResourceStringsEx calls the FindLocaleFileName implementation routine to resolve the requested language identifier, and the path and file extension for the localization files. .po files are given preference, and .mo files are used when a .po equivalent is not available.
+
+ TranslateUnitResourceStringsEx calls the TranslateUnitResourceStrings routine in the
+ TranslateUnitResourceStringsEx calls the TranslateResourceStrings routine in the FCL
+ The return value contains the language code or locale ID used in the translation. An empty string ('') in the return value indicates that a localization file for the specified arguments was not found, or that an error occurred during the translation.
+
- Lang contains the Language ID to use for translated strings. Lang contains a language identifier defined in ISO 639, at:
- The default value for the parameter is an empty string (''), and indicates that strings are not translated. + The default value for the parameter is an empty string (''), and indicates that the default language identifier for the system should be used. This value can be passed as a command line argument (like '--lang ru' or '--lang=es'). The value also can be overridden using the LANG environment variable. The fallback value is the language identifier for the platform. For Windows, this is the language code and country code from GetLocaleInfo in a format like 'en_US' or 'zh_CN'. For other platforms, the value from either the LC_ALL or LC_MESSAGE environment variables is used as the fallback.
- Dir contains the directory name where .po/.mo files are stored. The default value is an empty string (''), and indicates that the default directories are used for translation files. + Dir contains the name of the directory where .po or .mo localization files are stored, like 'mylng'. The default value is an empty string (''), and indicates that the predefined directories like 'languages' or 'locale' are used to find the localization files for the translation.
- LocaleFileName contain the localization file used for for strings. This file handles variations in grammar and spelling that occur in local dialects for a language. It contains a value like 'zh_cn' or 'pt_br'. The default value is an empty string (''), and indicates that localization is not preformed for resource strings. + LocaleFileName contains the base name for the localization file used to translate string values, like 'lazaruside' or 'debuggerstrconst'. The default value for the argument is an empty string ('') and causes the base name for the application executable to be used, like 'project1' for 'project1.exe'. +
++ When combined with the language identifier and the '.po' or '.mo' file extension, it forms the complete file name with the localized string values. For example: 'lazaruside.ru.po', 'debuggerstrconst.zh_CN.po', or 'project1.es.po'. The value in the Dir argument is prepended to form the complete path to the localization file.
- ForceUpdate indicates if an immediate update to to the User Interface is performed when translations are loaded. Set ForceUpdate to False when SetDefaultLang is called from the initialization section for a unit. The default value is True. + ForceUpdate indicates if an immediate update to the user interface is performed when translations are loaded. Set ForceUpdate to False when SetDefaultLang is called from the initialization section in a unit. The default value is True.
- SetDefaultLang ensures that Language ID and Locale Codes are valid, and .po/.mo exist for the specified names before they are applied. SetDefaultLang calls the FindLocaleFileName function to get the file name used for translation resources. .po files are applied when they exist. Otherwise, .mo file are used to get the translated string values. LCL resource string constants are also translated when the default language code is assigned. + SetDefaultLang ensures that the language ID / locale codes are valid, and .po or .mo files exist with the specified values before they are applied. SetDefaultLang calls the FindLocaleFileName function to get the file name used for translation resources. .po files are applied when they exist. Otherwise, .mo file are used to get the translated string values. LCL resource string constants are also translated using TranslateLCLResourceStrings when a localization file is found with the specified values.
- When ForceUpdate contains True, string properties used in Forms, Data Modules, Controls, Components and Persistent objects are translated. This action is performed for items with RTTI (Run Time Type Information) and includes a setter (write access) procedure. TUpdateTranslator is used to perform the update to user interface elements. + When ForceUpdate contains True, string properties used in Forms, Data Modules, Controls, Components and Persistent objects are translated. This action is performed for members with RTTI (Run Time Type Information) which include a setter (write access) procedure. TUpdateTranslator is used to perform the update to user interface elements.