[ Index ] |
|
Code source de PRADO 3.0.6 |
[Code source] [Imprimer] [Statistiques]
IMessageSource interface file. This program is free software; you can redistribute it and/or modify it under the terms of the BSD License.
Author: | Wei Zhuo |
Version: | $Revision: 1.3 $ $Date: 2005/01/09 22:15:32 $ |
Poids: | 123 lignes (4 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
IMessageSource:: (9 méthodes):
load()
read()
save()
append()
delete()
update()
catalogues()
setCulture()
getCulture()
Interface: IMessageSource - X-Ref
IMessageSource interface.load($catalogue = 'messages') X-Ref |
Load the translation table for this particular catalogue. 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]. param: string a catalogue to load return: boolean true if loaded, false otherwise. |
read() X-Ref |
Get the translation table. This includes all the loaded sections. It must return a 2 level array of translation strings. # "catalogue+variant" the catalogue and its variants. # "source string" translation keys, and its translations. <code> array('catalogue+variant' => array('source string' => 'target string', ...) ...), ...); </code> return: array 2 level array translation table. |
save($catalogue='messages') X-Ref |
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 <b>append()</b> method. param: string the catalogue to add to return: boolean true if saved successfuly, false otherwise. |
append($message) X-Ref |
Add a untranslated message to the source. Need to call save() to save the messages to source. param: string message to add return: void |
delete($message, $catalogue='messages') X-Ref |
Delete a particular message from the specified catalogue. param: string the source message to delete. param: string the catalogue to delete from. return: boolean true if deleted, false otherwise. |
update($text, $target, $comments, $catalogue='messages') X-Ref |
Update the translation. param: string the source string. param: string the new translation string. param: string comments param: string the catalogue of the translation. return: boolean true if translation was updated, false otherwise. |
catalogues() X-Ref |
Returns a list of catalogue as key and all it variants as value. return: array list of catalogues |
setCulture($culture) X-Ref |
Set the culture for this particular message source. param: string the Culture name. |
getCulture() X-Ref |
Get the culture identifier for the source. return: string culture identifier. |
Généré le : Sun Feb 25 21:07:04 2007 | par Balluche grâce à PHPXref 0.7 |