PHP 클래스 Prado\I18N\core\MessageSource_gettext

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.
상속: extends MessageSource
파일 보기 프로젝트 열기: pradosoft/prado

보호된 프로퍼티들

프로퍼티 타입 설명
$dataExt string Message data filename extension.
$dataSeparator string Separator between culture name and source.
$poExt string PO data filename extension

공개 메소드들

메소드 설명
__construct ( $source )
catalogues ( ) : array Returns a list of catalogue as key and all it variants as value.
delete ( $message, $catalogue = 'messages' ) : boolean Delete a particular message from the specified catalogue.
save ( $catalogue = 'messages' ) : boolean Save the list of untranslated blocks to the translation source.
update ( $text, $target, $comments, $catalogue = 'messages' ) : boolean Update the translation.

보호된 메소드들

메소드 설명
createMessageTemplate ( $catalogue )
getCatalogueList ( $catalogue ) : array Get all the variants of a particular catalogue.
getCatalogues ( $dir = null, $variant = null ) : array Returns a list of catalogue and its culture ID. This takes care of directory structures.
getLastModified ( $source ) : integer Get the last modified unix-time for this particular catalogue+variant.
getSource ( $variant ) : string Get the MO file for a specific message catalogue and cultural vairant.
isValidSource ( $filename ) : boolean Determin if the MO file source is valid.
loadData ( $filename ) : array Load the messages from a MO file.

비공개 메소드들

메소드 설명
getCatalogueByDir ( $catalogue ) : array Traverse through the directory structure to find the catalogues.
getPOFile ( $MOFile )
getVariants ( $catalogue = 'messages' ) : string Get the variant for a catalogue depending on the current culture.

메소드 상세

__construct() 공개 메소드

public __construct ( $source )

catalogues() 공개 메소드

Returns a list of catalogue as key and all it variants as value.
public catalogues ( ) : array
리턴 array list of catalogues

createMessageTemplate() 보호된 메소드

protected createMessageTemplate ( $catalogue )

delete() 공개 메소드

Delete a particular message from the specified catalogue.
public delete ( $message, $catalogue = 'messages' ) : boolean
리턴 boolean true if deleted, false otherwise.

getCatalogueList() 보호된 메소드

Get all the variants of a particular catalogue.
protected getCatalogueList ( $catalogue ) : array
리턴 array list of all variants for this catalogue.

getCatalogues() 보호된 메소드

E.g. array('messages','en_AU')
protected getCatalogues ( $dir = null, $variant = null ) : array
리턴 array list of catalogues

getLastModified() 보호된 메소드

Just use the file modified time.
protected getLastModified ( $source ) : integer
리턴 integer last modified in unix-time format.

getSource() 보호된 메소드

Get the MO file for a specific message catalogue and cultural vairant.
protected getSource ( $variant ) : string
리턴 string full path to the MO file.

isValidSource() 보호된 메소드

Determin if the MO file source is valid.
protected isValidSource ( $filename ) : boolean
리턴 boolean true if valid, false otherwise.

loadData() 보호된 메소드

Load the messages from a MO file.
protected loadData ( $filename ) : array
리턴 array of messages.

save() 공개 메소드

If the translation was not found, you should add those strings to the translation source via the append() method.
public save ( $catalogue = 'messages' ) : boolean
리턴 boolean true if saved successfuly, false otherwise.

update() 공개 메소드

Update the translation.
public update ( $text, $target, $comments, $catalogue = 'messages' ) : boolean
리턴 boolean true if translation was updated, false otherwise.

프로퍼티 상세

$dataExt 보호되어 있는 프로퍼티

Message data filename extension.
protected string $dataExt
리턴 string

$dataSeparator 보호되어 있는 프로퍼티

Separator between culture name and source.
protected string $dataSeparator
리턴 string

$poExt 보호되어 있는 프로퍼티

PO data filename extension
protected string $poExt
리턴 string