From 4b96fd369f0e065bbb663c0469f911d2d572e5a1 Mon Sep 17 00:00:00 2001 From: dsiders Date: Sun, 19 Jun 2022 15:21:45 +0100 Subject: [PATCH] Docs: LCL/lcltranslator. Removes extra spaces in topics. Updates tagging for True and False values. --- docs/xml/lcl/lcltranslator.xml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/xml/lcl/lcltranslator.xml b/docs/xml/lcl/lcltranslator.xml index 616f6aa23b..2d4cecd0c9 100644 --- a/docs/xml/lcl/lcltranslator.xml +++ b/docs/xml/lcl/lcltranslator.xml @@ -9,13 +9,13 @@ Performs string translation in the Lazarus IDE and LCL. - +

lcltranslator.pas contains classes and routines used to perform translation for strings used in Lazarus IDE and LCL (Lazarus Component Library). It searches for .po (Portable Object) and/or .mo (Machine Object) files used to perform I18n internationalization and L10n localization. The .po/.mo files are stored in the languages or locale directories. To access translation files from an alternate location, use the LResources unit and the LRSMoFile variable directly.

- To enable string translation, use this unit in your application and check the Enable i18n option in the Project > Project Options > i18n screen. You will need to call the SetDefaultLang routine in your code to activate the translation facility. If you want translation to be performed automatically, use the DefaultTranslator unit instead. + To enable string translation, use this unit in your application and check the Enable i18n option in the Project > Project Options > i18n screen. You will need to call the SetDefaultLang routine in your code to activate the translation facility. If you want translation to be performed automatically, use the DefaultTranslator unit instead.

This unit also translates LCL string constants in the lclstrconsts file using files in the directory where program translation files are stored. @@ -46,7 +46,7 @@

- TUpdateTranslator is a TAbstractTranslator descendant used to perform string translations for persistent objects. TUpdateTranslator provides the UpdateTranslation method which updates any translatable properties in Lazarus resources. + TUpdateTranslator is a TAbstractTranslator descendant used to perform string translations for persistent objects. TUpdateTranslator provides the UpdateTranslation method which updates any translatable properties in Lazarus resources.

TUpdateTranslator is used as the ancestor for the TDefaultTranslator and TPOTranslator classes. @@ -175,7 +175,7 @@

- TPOTranslator is a TUpdateTranslator descendant used to translate string properties using the values defined in a .po (Portable Object) file. A .po file is the text format used for translation resources created for the GNU gettext program. TPOTranslator implements the abstract TranslateStringProperty method defined in the ancestor class. + TPOTranslator is a TUpdateTranslator descendant used to translate string properties using the values defined in a .po (Portable Object) file. A .po file is the text format used for translation resources created for the GNU gettext program. TPOTranslator implements the abstract TranslateStringProperty method defined in the ancestor class.

Use TDefaultTranslator to translate string properties using the .mo (Machine Object) file format. @@ -262,7 +262,9 @@ - Translates resource strings in LCLStrConsts to the specified language. + + Translates resource strings in LCLStrConsts to the specified language. +

TranslateLCLResourceStrings is a String function used to translate resource strings in the LCLStrConsts unit to the language identifier specified in the Lang argument. @@ -303,10 +305,7 @@ SetDefaultLang is a procedure used to the set the default language used for string translations.

- Lang contains the Language ID to use for translated strings. Lang contains a language identifier defined in ISO 639, at: - - ISO 639 - Codes for the Representation of Names of Languages - + Lang contains the Language ID to use for translated strings. Lang contains a language identifier defined in ISO 639, at: ISO 639 - Codes for the Representation of Names of Languages

The default value for the parameter is an empty string (''), and indicates that strings are not translated. @@ -318,13 +317,13 @@ 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.

- 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 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.

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.

- 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 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.

@@ -354,7 +353,11 @@ Deprecated. - Deprecated. Use the result from the SetDefaultLang function instead. + +

+ Deprecated. Use the result from the SetDefaultLang function instead. +

+
Deprecated in LCL version 2.1.0.