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

TPOFile.SaveToStrings

Stores values from Header and the sorted POItems to the specified string list.

Declaration

Source position: translations.pas line 148

public procedure TPOFile.SaveToStrings(

  OutLst: TStrings

);

Arguments

OutLst

  

TStrings instance where the header and translation entries in the class are stored.

Description

SaveToStrings is a method used to store values from the .po file class instance to the TStrings instance in OutLst. Values in the Header and POItems properties are stored in OutLst.

SaveToStrings calls CreateHeader to ensure that the Header property has been allocated for the class instance. Values in POItems are sorted (without case sensitivity) in Identifier order prior to storing the values in OutLst.

Values written to OutLst are stored in the PO (Portable Object) format used by the GNU gettext localization library. The following properties from the TPOFileItem entries in Items are stored:

Comments
Stored with the '# ' prefix but not quoted in any form.
IdentifierLow
Stored with the '#: ' prefix.
Flags
Stored with the '#, ' prefix.
PreviousID
Stored with the '#| msgid' prefix using escaped values for Quote ("), Backslash (\), and Tab (#9) characters.
Context
Stored with the 'msgctxt' prefix.
Original
Stored with the 'msgid' prefix using escaped values for Quote ("), Backslash (\), and Tab (#9) characters.
Translation
Stored with the 'msgstr' prefix using escaped values for Quote ("), Backslash (\), and Tab (#9) characters.

Properties which have a blank value ('') are not stored in OutLst.

Use SaveToFile to store the contents of the .po file to a specified file name.


Version 4.0 Generated 2025-05-03 Home