PHP Класс Prado\I18N\core\Gettext\TGettext

GNU gettext file reader and writer. ################################################################# # All protected members of this class are public in its childs. # #################################################################
Автор: Michael Wallner ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$file string file path
$meta array associative array containing meta information like project name or content type
$strings array associative array with all [msgid => msgstr] entries

Открытые методы

Метод Описание
factory ( string $format, string $file = '' ) : object Factory
fromArray ( array $array ) : boolean fromArray
meta2array ( string $meta ) : array meta2array
poFile2moFile ( string $pofile, string $mofile ) : mixed poFile2moFile
prepare ( string $string, boolean $reverse = false ) : string prepare
toArray ( ) : array toArray
toMO ( ) : object toMO
toPO ( ) : object toPO

Описание методов

factory() статический публичный Метод

Factory
static public factory ( string $format, string $file = '' ) : object
$format string MO or PO
$file string path to GNU gettext file
Результат object Returns File_Gettext_PO or File_Gettext_MO on success or PEAR_Error on failure.

fromArray() публичный Метод

Assigns meta info and strings from an array of a structure like that: array( 'meta' => array( 'Content-Type' => 'text/plain; charset=iso-8859-1', 'Last-Translator' => 'Michael Wallner ', 'PO-Revision-Date' => date('Y-m-d H:iO'), 'Language-Team' => 'German ', ), 'strings' => array( 'All rights reserved' => 'Alle Rechte vorbehalten', 'Welcome' => 'Willkommen', ... ) )
См. также: toArray()
public fromArray ( array $array ) : boolean
$array array
Результат boolean

meta2array() статический публичный Метод

meta2array
static public meta2array ( string $meta ) : array
$meta string
Результат array

poFile2moFile() статический публичный Метод

That's a simple fake of the 'msgfmt' console command. It reads the contents of a GNU PO file and saves them to a GNU MO file.
static public poFile2moFile ( string $pofile, string $mofile ) : mixed
$pofile string path to GNU PO file
$mofile string path to GNU MO file
Результат mixed Returns true on success or PEAR_Error on failure.

prepare() статический публичный Метод

prepare
static public prepare ( string $string, boolean $reverse = false ) : string
$string string
$reverse boolean
Результат string

toArray() публичный Метод

Returns meta info and strings as an array of a structure like that: array( 'meta' => array( 'Content-Type' => 'text/plain; charset=iso-8859-1', 'Last-Translator' => 'Michael Wallner ', 'PO-Revision-Date' => '2004-07-21 17:03+0200', 'Language-Team' => 'German ', ), 'strings' => array( 'All rights reserved' => 'Alle Rechte vorbehalten', 'Welcome' => 'Willkommen', ... ) )
См. также: fromArray()
public toArray ( ) : array
Результат array

toMO() публичный Метод

toMO
public toMO ( ) : object
Результат object File_Gettext_MO

toPO() публичный Метод

toPO
public toPO ( ) : object
Результат object File_Gettext_PO

Описание свойств

$file защищенное свойство

file path
protected string $file
Результат string

$meta защищенное свойство

associative array containing meta information like project name or content type
protected array $meta
Результат array

$strings защищенное свойство

associative array with all [msgid => msgstr] entries
protected array $strings
Результат array