[Overview][Classes][Procedures and functions][Index] | Reference for unit 'LCLTranslator' (#lcl)

# TUpdateTranslator.UpdateTranslation

Updates translations for string properties in a persistent object.

## Declaration

Source position: lcltranslator.pas line 55

`public procedure TUpdateTranslator.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.

## Version info

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

TDefaultTranslator.TranslateStringProperty |  | Gets the translated value for the specified property.
TPOTranslator.TranslateStringProperty |  | Gets the translated value for the specified property.
SetDefaultLang |  | Sets the default language used for string translations.