Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Po2js Class Reference
+ Collaboration diagram for Po2js:

Public Member Functions

 __construct ($pofile)
 
 po2json ()
 
 __construct ($pofile)
 
 po2json ()
 

Protected Member Functions

 po2array ()
 
 memoEntry ($key, $text, $ctxt='')
 
 po2array ()
 
 memoEntry ($key, $text, $ctxt= '')
 
 mergeMsgLines ($lines)
 
 unescapeGettextControlSeq ($str)
 

Static Protected Member Functions

static trimquote ($s)
 

Protected Attributes

 $pofile = ""
 
 $entries = array()
 
 $encoding = 'utf-8'
 

Detailed Description

Convert a PO file to json string

Definition at line 13 of file buildTools/po2js.php.

Constructor & Destructor Documentation

__construct (   $pofile)

Construct the object

Parameters
string$pofilepath to the po file
Exceptions
Exception

Definition at line 26 of file buildTools/po2js.php.

__construct (   $pofile)

Construct the object

Parameters
string$pofilepath to the po file
Exceptions
Exception

Definition at line 29 of file programs/po2js.php.

Member Function Documentation

memoEntry (   $key,
  $text,
  $ctxt = '' 
)
protected

Clean a key and a translation and add them to $this->entries

Parameters
$key
$text

Definition at line 87 of file buildTools/po2js.php.

memoEntry (   $key,
  $text,
  $ctxt = '' 
)
protected

Clean a key and a translation and add them to $this->entries

Parameters
string$keytext to translate
string$texttranslation
string$ctxtcontext

Definition at line 93 of file programs/po2js.php.

+ Here is the call graph for this function:

mergeMsgLines (   $lines)
protected

Convert multiples quoted msg lines into a single unquoted line:

["foo..."\n"bar..."\n"baz..."] => [foo...bar...baz...]
Parameters
$lines
Returns
string

Definition at line 119 of file programs/po2js.php.

+ Here is the call graph for this function:

po2array ( )
protected

Extract PO entries an store them

Exceptions
Exception

Definition at line 60 of file programs/po2js.php.

+ Here is the call graph for this function:

po2array ( )
protected

Extract PO entries an store them

Exceptions
Exception

Definition at line 63 of file buildTools/po2js.php.

+ Here is the call graph for this function:

po2json ( )

Convert the current PO file to a json string

JSON contains an object where key are po key and content po translation if there is no translation return an empty string

Returns
string

Definition at line 44 of file buildTools/po2js.php.

+ Here is the call graph for this function:

po2json ( )

Convert the current PO file to a json string

JSON contains an object where key are po key and content po translation if there is no translation return an empty string

Returns
string

Definition at line 45 of file programs/po2js.php.

+ Here is the call graph for this function:

static trimquote (   $s)
staticprotected

Definition at line 108 of file buildTools/po2js.php.

unescapeGettextControlSeq (   $str)
protected

Unescape gettext's control sequence according to http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-tools/src/po-lex.c#n750

Parameters
$str
Returns
string

Definition at line 151 of file programs/po2js.php.

Field Documentation

$encoding = 'utf-8'
protected

Definition at line 18 of file buildTools/po2js.php.

$entries = array()
protected

Definition at line 17 of file buildTools/po2js.php.

$pofile = ""
protected

Definition at line 16 of file buildTools/po2js.php.


The documentation for this class was generated from the following file:
← centre documentaire © anakeen