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

TPOFileItem.Comments

Contains the comments with the notes for translators, flag values, et. al. for the translation entry.

Declaration

Source position: translations.pas line 94

public TPOFileItem.Comments : string;

Description

Comments is a public String member which contains the comment lines which occur at the start of the translation entry. It is an empty string ('') if no comments were found prior to the key/value pair in Original and Translation. If multiple comment lines (starting with the '#' character) are found, and line ending sequence is added at the end of each comment.

The value in Comments is detected when the ReadPOText method in TPOFile is called to process the contents of a .po file, and stored when the FillItem method in TPOFile is called.

A comment line starts with the # character and relates to the first entry after the comment. Comment types and uses are defined as follows:

'# '
Contains a note for translators. Normally, this is the only comment that is manually written.
'#.''
Comment was extracted from the source code with the Gettext tool.
'#:''
Contains a reference to the source code with the message ids translated using the file. A Colon (':') is used as a delimiter between distinct values in the reference. For instance: '#: lazarusidestrconsts:lisdonotshowsplashscreen:224'.
#, fuzzy, object-pascal-format, no-object-pascal-format, badformat

Flag values from the translator or the Gettext tool. Unlike other comments, these lines may be handled or applied in the application. The comma-delimited list of flags may be used to apply the translation based on the comment type.

"fuzzy" is inserted by a translator when the translated value might not be a correct translation. When verified, the "fuzzy" attribute can be removed in the .po file. A translation with the "fuzzy" flag is not applied in the application.

"badformat" indicates the message ID or translated value has an invalid format. A translation with the "badformat" flag is not applied in the application.

"object-pascal-format" and "no-object-pascal-format"indicate that the message ID or translated value does or does not use the format for the Object Pascal language. These are generated by automated PO processing tools.

#|
Represents the previous (older) msgid, msgstr, or msgctxt value for the message ID which follows the comment.

Version 4.0 Generated 2025-05-03 Home