[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/I18N/core/ -> MessageSource_gettext.php (sommaire)

MessageSource_gettext class 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.7 $ $Date: 2005/12/17 06:11:28 $
Poids: 455 lignes (12 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

MessageSource_gettext:: (15 méthodes):
  __construct()
  loadData()
  isValidSource()
  getSource()
  getLastModified()
  getCatalogueList()
  getCatalogueByDir()
  getVariants()
  getPOFile()
  save()
  delete()
  update()
  catalogues()
  getCatalogues()
  createMessageTemplate()


Classe: MessageSource_gettext  - X-Ref

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.

__construct($source)   X-Ref
Separator between culture name and source.


loadData($filename)   X-Ref
Load the messages from a MO file.

param: string MO file.
return: array of messages.

isValidSource($filename)   X-Ref
Determin if the MO file source is valid.

param: string MO file
return: boolean true if valid, false otherwise.

getSource($variant)   X-Ref
Get the MO file for a specific message catalogue and cultural
vairant.

param: string message catalogue
return: string full path to the MO file.

getLastModified($source)   X-Ref
Get the last modified unix-time for this particular catalogue+variant.
Just use the file modified time.

param: string catalogue+variant
return: int last modified in unix-time format.

getCatalogueList($catalogue)   X-Ref
Get all the variants of a particular catalogue.

param: string catalogue name
return: array list of all variants for this catalogue.

getCatalogueByDir($catalogue)   X-Ref
Traverse through the directory structure to find the catalogues.
This should only be called by getCatalogueList()

param: string a particular catalogue.
return: array a list of catalogues.

getVariants($catalogue='messages')   X-Ref
Get the variant for a catalogue depending on the current culture.

param: string catalogue
return: string the variant.

getPOFile($MOFile)   X-Ref
Pas de description

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.

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

getCatalogues($dir=null,$variant=null)   X-Ref
Returns a list of catalogue and its culture ID. This takes care
of directory structures.
E.g. array('messages','en_AU')

return: array list of catalogues

createMessageTemplate($catalogue)   X-Ref
Pas de description



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7