LocaleFile Class Reference

Abstraction of a locale file. More...

Inheritance diagram for LocaleFile:

EditableLocaleFile

List of all members.

Public Member Functions

 _cacheMiss (&$cache, $id)
_getCache ($locale)
 getFilename ()
 isValid ()
load ($filename)
 LocaleFile ($locale, $filename)
 testLocale (&$referenceLocaleFile)
 translate ($key, $params=array(), $locale=null)


Detailed Description

Abstraction of a locale file.

Definition at line 18 of file LocaleFile.inc.php.


Member Function Documentation

LocaleFile._cacheMiss ( &$  cache,
id 
)

Register a cache miss.

Definition at line 66 of file LocaleFile.inc.php.

References Config.getVar(), and load().

Referenced by translate().

& LocaleFile._getCache ( locale  ) 

Get the cache object for this locale file.

Definition at line 41 of file LocaleFile.inc.php.

References load().

Referenced by translate().

LocaleFile.getFilename (  ) 

Get the filename for this locale file.

Definition at line 80 of file LocaleFile.inc.php.

LocaleFile.isValid (  ) 

Check if a locale is valid.

Parameters:
$locale string
Returns:
boolean

Definition at line 149 of file LocaleFile.inc.php.

Referenced by testLocale().

& LocaleFile.load ( filename  ) 

Static method: Load a locale array from a file. Not cached!

Parameters:
$filename string Filename to locale XML to load
array 

Definition at line 127 of file LocaleFile.inc.php.

Referenced by _cacheMiss(), _getCache(), genTestLocale.execute(), and testLocale().

LocaleFile.LocaleFile ( locale,
filename 
)

Constructor.

Parameters:
$locale string Key for this locale file
$filename string Filename to this locale file

Definition at line 33 of file LocaleFile.inc.php.

LocaleFile.testLocale ( &$  referenceLocaleFile  ) 

Test a locale file against the given reference locale file and return an array of errorType => array(errors).

Parameters:
$referenceLocaleFile object
Returns:
array

Definition at line 159 of file LocaleFile.inc.php.

References Locale.checkLengths(), Locale.getParameterNames(), isValid(), and load().

LocaleFile.translate ( key,
params = array(),
locale = null 
)

Translate a string using the selected locale. Substitution works by replacing tokens like "{$foo}" with the value of the parameter named "foo" (if supplied).

Parameters:
$key string $params array named substitution parameters $locale string the locale to use
Returns:
string

Definition at line 93 of file LocaleFile.inc.php.

References _cacheMiss(), and _getCache().


The documentation for this class was generated from the following file:

Generated on Mon Jul 14 10:55:44 2008 for Open Journal Systems by  doxygen 1.5.6