Class \Prado\I18N\core\MessageSource_gettext
MessageSource_gettext class.
Using Gettext MO format as the message source for translation. The gettext classes are based on PEAR's gettext MO and PO classes.
See the MessageSource::factory() method to instantiate this class.
Class hierarchy
Author: Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
public
|
__construct(mixed $source) : mixed
Private constructor. MessageSource must be initialized using
the factory method.
|
public
|
catalogues() : array<string|int, mixed>
Returns a list of catalogue as key and all it variants as value.
|
public
|
delete(string $message[, string $catalogue = 'messages' ]) : bool
Delete a particular message from the specified catalogue.
|
public
|
save([string $catalogue = 'messages' ]) : bool
Save the list of untranslated blocks to the translation source.
If the translation was not found, you should add those strings to the translation source via the append() method. |
public
|
update(string $text, string $target, string $comments[, string $catalogue = 'messages' ]) : bool
Update the translation.
|
protected
|
|
protected
|
getCatalogueList(string $catalogue) : array<string|int, mixed>
Get all the variants of a particular catalogue.
|
protected
|
getCatalogues([null|mixed $dir = null ][, null|mixed $variant = null ]) : array<string|int, mixed>
Returns a list of catalogue and its culture ID. This takes care
of directory structures.
E.g. array('messages','en_AU') |
protected
|
getLastModified(string $source) : int
Get the last modified unix-time for this particular catalogue+variant.
Just use the file modified time. |
protected
|
getSource(string $variant) : string
Get the MO file for a specific message catalogue and cultural
vairant.
|
protected
|
|
protected
|
|
private
|
getCatalogueByDir(string $catalogue) : array<string|int, mixed>
Traverse through the directory structure to find the catalogues.
This should only be called by getCatalogueList() |
private
|
|
private
|
getVariants([string $catalogue = 'messages' ]) : string
Get the variant for a catalogue depending on the current culture.
|
append, factory, getCache, getCulture, load, read, setCache, setCulture, getCatalogueList, getLastModified, getSource, isValidSource, loadData, __construct |