diff --git a/docs/xml/lcl/lcltranslator.xml b/docs/xml/lcl/lcltranslator.xml index d16c8be26d..cb7201fefe 100644 --- a/docs/xml/lcl/lcltranslator.xml +++ b/docs/xml/lcl/lcltranslator.xml @@ -82,38 +82,58 @@ TPOTranslator classes. + + + + - - -Performs action required to update string translations for persistent objects -using RTTI. - - - - - - - -Persistent object updated in the method. - - + -Updates string translations for persistent objects. + +Updates translations for string properties in a persistent object. +

-UpdateTranslation is procedure used to translate string properties -in the specified persistent object instance. UpdateTranslation uses RTTI (Run -Time Type Information) to update the value for translatable properties in -Lazarus resources. This requires properties to be a TPersistent descendant -with RTTI enabled, and have a setter (write access) procedure. Strings, -Classes, Components and the sub-Components are handled in the method. +UpdateTranslation is method used to translate string properties +in the specified persistent object instance. UpdateTranslation uses RTTI +(Run-Time Type Information) to access and update the values for translatable +properties found in the object instance. +

+

+AnInstance is a TPersistent descendant with the RTTI used to access +the values for readable properties and other members in the class instance. +

+

+UpdateTranslation ensures that translation is performed for writable string +properties defined using the TTranslateString type. Translation is not +performed for a property if it does not have a setter routine (write access +specifier). +

+

+UpdateTranslation recursively checks for translatable properties in members +defined using TCollection, TPersistent, TComponent, or TCustomFrame types. +

+

+UpdateTranslation is called from the SetDefaultLang routine and occurs when +translations are updated after setting a new default language value.

- + +Modified in LCL version 3.0 to ensure that read-only members are checked for +translatable properties. Write access is checked before a property is +translated and updated with the new value. + + + + + +
-Persistent object updated in the method. + +Persistent object with properties translated in the method. + @@ -140,8 +160,10 @@ Object) file format. + + Constructor for the class instance. @@ -153,7 +175,7 @@ to convert any UTF-8-encoded values in MOFileName to the default encoding used for the platform or OS.

- +
.mo file used in the class instance. @@ -168,7 +190,7 @@ Destroy ensures that resources allocated to an internal TMOFile member are freed prior to calling the inherited destructor.

- +
@@ -201,7 +223,7 @@ No actions are performed in the method if a .mo file was not found with the required file name.

- +
Class instance calling the method. @@ -240,8 +262,10 @@ Use TDefaultTranslator to translate string properties using the .mo + + Constructor for the class instance. @@ -263,7 +287,7 @@ aPOFile is the TPPOFile class instance which contains the translated values for strings.

- +
.po file name to use for translated string values. @@ -281,7 +305,7 @@ Destroy ensures that resources allocated to the internal TPOFile member in the class instance are freed. Destroy calls the inherited destructor.

- +
@@ -399,7 +423,7 @@ specified language and path. 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. +files, and the language requested.

Lang contains the optional language identifier requested for the @@ -426,7 +450,7 @@ LocaleFileName is an empty string (''). 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 @@ -476,7 +500,7 @@ Optional path to the localization files used in the translation. Optional base name of the unit with strings translated in the routine. - + @@ -521,7 +545,7 @@ 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