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

TPOFile.SaveToFile

Stores values from Header and the sorted POItems to the specified file name.

Declaration

Source position: translations.pas line 149

public procedure TPOFile.SaveToFile(

  const AFilename: string

);

Arguments

AFilename

  

Name of the file where the values in the .po file are stored.

Description

SaveToFile is a method used to store the contents in the .po file class instance to the file name specified in the AFilename argument. AFilename contains an optional path and the file name and extension where the values are stored.

SaveToFile creates a temporary TStringList instance and calls the SaveToStrings method to populate the list with the Header and Items in the class instance. Its contents are stored to the location specified in AFilename. If AFilename already exists, it is overwritten.

Value are written to the file in the PO (Portable Object) format used by the GNU gettext localization library. See SaveToStrings for more information about the properties included in the output and their storage formats.

Use the overloaded Create variant with a file name argument to load a .po file class instance from a specified file using the .po format.

See also

TPOFile.SaveToStrings

  

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

TPOFile.Header

  

Contains values for the header section in a .po file.

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.Create

  

Constructor for the class instance.

TPOFileItem

  

Represents a single key/value pair in a .po file which maps a string to its translated value.


Version 4.0 Generated 2025-05-03 Home