PHP 인터페이스 Prado\I18N\core\IMessageSource

All messages source used by MessageFormat must be of IMessageSource. It defines a set of operations to add and retrive messages from the message source. In addition, message source can load a particular catalogue.
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
append ( $message ) : void Add a untranslated message to the source. Need to call save() to save the messages to 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.
getCulture ( ) : string Get the culture identifier for the source.
load ( $catalogue = 'messages' ) : boolean Load the translation table for this particular catalogue.
read ( ) : array Get the translation table. This includes all the loaded sections.
save ( $catalogue = 'messages' ) : boolean Save the list of untranslated blocks to the translation source.
setCulture ( $culture ) Set the culture for this particular message source.
update ( $text, $target, $comments, $catalogue = 'messages' ) : boolean Update the translation.

메소드 상세

append() 공개 메소드

Add a untranslated message to the source. Need to call save() to save the messages to source.
public append ( $message ) : void
리턴 void

catalogues() 공개 메소드

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

delete() 공개 메소드

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

getCulture() 공개 메소드

Get the culture identifier for the source.
public getCulture ( ) : string
리턴 string culture identifier.

load() 공개 메소드

The translation should be loaded in the following order. # [1] call getCatalogeList($catalogue) to get a list of variants for for the specified $catalogue. # [2] for each of the variants, call getSource($variant) to get the resource, could be a file or catalogue ID. # [3] verify that this resource is valid by calling isValidSource($source) # [4] try to get the messages from the cache # [5] if a cache miss, call load($source) to load the message array # [6] store the messages to cache. # [7] continue with the foreach loop, e.g. goto [2].
public load ( $catalogue = 'messages' ) : boolean
리턴 boolean true if loaded, false otherwise.

read() 공개 메소드

It must return a 2 level array of translation strings. # "catalogue+variant" the catalogue and its variants. # "source string" translation keys, and its translations. array('catalogue+variant' => array('source string' => 'target string', ...) ...), ...);
public read ( ) : array
리턴 array 2 level array translation table.

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.

setCulture() 공개 메소드

Set the culture for this particular message source.
public setCulture ( $culture )

update() 공개 메소드

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