Sign in Join
FPDoc Onlineexperiment

TUpdateTranslator.UpdateTranslation procedure

Member of TUpdateTranslatorpublicIn unit LCLTranslator

Updates translations for string properties in a persistent object.

Declaration

pascal
procedure UpdateTranslation(AnInstance: TPersistent)

Arguments

AnInstance

Persistent object with properties translated in the method.

Description

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.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.