\NimrodPOUtil

NimrodPOUtil class.

Minimal working code example:

require 'class.nimrod.poutil.php';
$poutil = new NimrodPOUtil;
// Assuming some $pofile and a $items catalog:
echo $poutil->read($pofile)->update($items)->sort();

Summary

Methods
Properties
Constants
__construct()
quotize()
unquotize()
read()
write()
update()
sort()
$db
TOK_NID
TOK_FREQ
TOK_REF
TOK_COM_TR
TOK_COM_XT
KEY_MSGID
KEY_MSGSTR
KEY_MSGCTXT
KEY_NID
KEY_FREQ
KEY_REF
KEY_COM_TR
KEY_COM_XT
KEY_EL_NUM
KEY_EL_VIS
KEY_EL_SIZE
KEY_EL_INTERACT
KEY_EL_CONTRAST
KEY_EL_SEMANTIC
No protected methods found
$header
N/A
_arrtok()
No private properties found
N/A

Constants

TOK_NID

TOK_NID

TOK_FREQ

TOK_FREQ

TOK_REF

TOK_REF

TOK_COM_TR

TOK_COM_TR

TOK_COM_XT

TOK_COM_XT

KEY_MSGID

KEY_MSGID

KEY_MSGSTR

KEY_MSGSTR

KEY_MSGCTXT

KEY_MSGCTXT

KEY_NID

KEY_NID

KEY_FREQ

KEY_FREQ

KEY_REF

KEY_REF

KEY_COM_TR

KEY_COM_TR

KEY_COM_XT

KEY_COM_XT

KEY_EL_NUM

KEY_EL_NUM

KEY_EL_VIS

KEY_EL_VIS

KEY_EL_SIZE

KEY_EL_SIZE

KEY_EL_INTERACT

KEY_EL_INTERACT

KEY_EL_CONTRAST

KEY_EL_CONTRAST

KEY_EL_SEMANTIC

KEY_EL_SEMANTIC

Properties

$db

$db : 

Message catalog database.

Type

$header

$header : 

PO header.

Type

Methods

__construct()

__construct() 

Constructor.

quotize()

quotize(string  $str) : string

Add quotes to string.

Parameters

string $str

Input string.

Returns

string

unquotize()

unquotize(string  $str) : string

Remove quotes from string.

Parameters

string $str

Input string.

Returns

string

read()

read(string  $pofile) : \NimrodPOUtil

Read PO file.

Parameters

string $pofile

The (path to) PO file.

Returns

\NimrodPOUtil

write()

write(string  $pofile) 

Write PO file.

Parameters

string $pofile

The (path to) PO file.

update()

update(array  $items) : \NimrodPOUtil

Update message catalog.

Parameters

array $items

The message catalog.

Returns

\NimrodPOUtil

sort()

sort(array  $weights = array()) : \NimrodPOUtil

Sort messages in the message catalog.

Parameters

array $weights

Sorting weights (optional).

Returns

\NimrodPOUtil

_arrtok()

_arrtok(array  $lines, string  $tok) : string

Add token to the beginning of each given text lines.

Parameters

array $lines

The text lines.

string $tok

The token.

Returns

string