PHP Class Jyxo\Gettext\Parser\Item

Author: Matěj Humpál
Datei anzeigen Open project: jyxo/php

Protected Properties

Property Type Description
$fuzzy boolean Is msgid fuzzy?
$location string Msgid position in the source code.
$msgid string Msgid.
$msgstr string | array For each plural form one array field. If there is only one translation (no plural forms), it is stored as a string.
$obsolete boolean Is msgid obsolete?
$plural string Plural forms.

Public Methods

Method Description
__construct ( string $chunk ) Constructor.
getLocation ( ) : string | array Returns msgid's position in source codes.
getMsgid ( ) : string | array Returns msgid.
getMsgstr ( ) : string | array Returns msgstr.
getPlural ( ) : string Returns plural translations.
hasPlural ( ) : boolean Returns whether the msgid has plural forms.
isFuzzy ( ) : boolean Returns whether the msgid is fuzzy.
isObsolete ( ) : boolean Returns whether the msgid is obsolete.

Protected Methods

Method Description
parse ( array $chunks ) The actual parser.

Method Details

__construct() public method

Retrieves a fragment of the PO file and parses it.
public __construct ( string $chunk )
$chunk string Translation fragment

getLocation() public method

Returns msgid's position in source codes.
public getLocation ( ) : string | array
return string | array

getMsgid() public method

Returns msgid.
public getMsgid ( ) : string | array
return string | array

getMsgstr() public method

Returns msgstr.
public getMsgstr ( ) : string | array
return string | array

getPlural() public method

Returns plural translations.
public getPlural ( ) : string
return string

hasPlural() public method

Returns whether the msgid has plural forms.
public hasPlural ( ) : boolean
return boolean

isFuzzy() public method

Returns whether the msgid is fuzzy.
public isFuzzy ( ) : boolean
return boolean

isObsolete() public method

Returns whether the msgid is obsolete.
public isObsolete ( ) : boolean
return boolean

parse() protected method

The actual parser.
protected parse ( array $chunks )
$chunks array Lines of the PO file fragment

Property Details

$fuzzy protected_oe property

Is msgid fuzzy?
protected bool $fuzzy
return boolean

$location protected_oe property

Msgid position in the source code.
protected string $location
return string

$msgid protected_oe property

Msgid.
protected string $msgid
return string

$msgstr protected_oe property

For each plural form one array field. If there is only one translation (no plural forms), it is stored as a string.
protected string|array $msgstr
return string | array

$obsolete protected_oe property

Is msgid obsolete?
protected bool $obsolete
return boolean

$plural protected_oe property

Plural forms.
protected string $plural
return string