[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Translations' (#lazutils)

TPOFile.UpdateItem

Adds or updates a translation entry which has the specified Identifier.

Declaration

Source position: translations.pas line 150

public procedure TPOFile.UpdateItem(

  const Identifier: string;

  const Original: string;

  const Flags: string = '';

  const ProcessingTranslation: Boolean = False

);

Arguments

Identifier

  

Identifier (msgid) for the translation entry.

Original

  

Untranslated value for the specified identifier.

Flags

  

Optional comma-delimited list of flags for the translation entry.

Description

UpdateItem is a method used to update a translation entry in Items with the msgid specified in the Identifier argument. It stores the values from the Identifier, Original, and Flags arguments to the TPOFileItem instance. If a translation entry with the specified identifier is not found in Items (POItems), it is added.

The ProcessingTranslation argument indicates whether values in the Flags argument are synchronized to the values in the TPOFileItem instance. When set to True, the "fuzzy" flag value in the POItems entry is retained and merged with the new Flag values.

UpdateItem calls the FillItem method to validate and apply the updated translation entry to the TPOFileItem instance in Items.

UpdateItem is used in methods like UpdateStrings and UpdateTranslation in TPOFile.

See also

TPOFile.Items

  

Provides access to the TFPList instance where translation entries are stored.

TPOFile.POItems

  

Provides indexed access to the translation entries in the class instance.

TPOFile.FillItem

  

Stores argument values to the specified translation entry.

TPOFile.UpdateStrings

  

Adds or updates translation entries in POItems using the values specified in InputLines.

TPOFile.UpdateTranslation

  

Updates or removes translation entries in the .po file class based on the content in the specified .po file.

TPOFileItem.IdentifierLow

  

Lowercase variant of the message identifier or untranslated value.

TPOFileItem.Original

  

Original untranslated value prior to localization using the value in Translation.

TPOFileItem.Translation

  

Translated or localized value for the message identifier.

TPOFileItem.Flags

  

Comma-delimited list of Flag names found in the comments for the translation entry.


Version 4.0 Generated 2025-05-03 Home