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

TPOFile.Create

Constructor for the class instance.

Declaration

Source position: translations.pas line 136

public constructor TPOFile.Create(

  Full: Boolean = True

);

constructor TPOFile.Create(

  const AFilename: string;

  Full: Boolean = False

);

constructor TPOFile.Create(

  AStream: TStream;

  Full: Boolean = False

);

Arguments

Full

  

Use False when loading from an internal resource. Default is True.

Arguments

AFilename

  

Name for the .po file loaded into the class instance.

Full

  

Use False when loading from an internal resource. Default is True.

Arguments

AStream

  

TStream instance with the translation entries loaded in the method.

Full

  

Use False when loading from an internal resource. Default is True.

Description

Create is the overloaded constructor for the class instance. The overloaded variants allow the class to be created and populated from a TStream, a .po file, or uninitialized for use with an internal resource.

Create allocates resources needed in the class instance, and sets the default values for its members.

For the variant with the AFilename argument, a TFileStream instance is created for use in the overloaded Create method. The CreateHeader method is called if a value has not been assigned to the Header property.

The stream-based variant is used to load values from the TStream argument. The ReadPOText method is called to load, process, and apply the translation entries found in the .po file.

See also

TPOFile.POName

  

Name for the .po file loaded into the class instance.

TPOFile.Header

  

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

TPOFile.POItems

  

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

TPOFile.ReadPOText

  

Reads the content for the .po file from the specified source.

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