Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct ($locale, $filename) | |
_cacheMiss ($cache, $id) | |
_getCache ($locale) | |
getFilename () | |
isValid () | |
testLocale (&$referenceLocaleFile) | |
translate ($key, $params=array(), $locale=null) | |
Static Public Member Functions | |
static & | load ($filename) |
Data Fields | |
$cache | |
$filename | |
$locale | |
Abstraction of a locale file.
Definition at line 17 of file LocaleFile.inc.php.
LocaleFile::__construct | ( | $locale, | |
$filename | |||
) |
Constructor.
$locale | string Key for this locale file |
$filename | string Filename to this locale file |
Definition at line 41 of file LocaleFile.inc.php.
LocaleFile::_cacheMiss | ( | $cache, | |
$id | |||
) |
LocaleFile::_getCache | ( | $locale | ) |
Get the cache object for this locale file.
Definition at line 49 of file LocaleFile.inc.php.
References $cache, CacheManager\getManager(), and load().
Referenced by translate().
LocaleFile::getFilename | ( | ) |
Get the filename for this locale file.
Definition at line 80 of file LocaleFile.inc.php.
References $filename.
LocaleFile::isValid | ( | ) |
Check if a locale is valid.
$locale | string |
Definition at line 162 of file LocaleFile.inc.php.
Referenced by testLocale(), and translate().
|
static |
Static method: Load a locale array from a file. Not cached!
$filename | string Filename to locale XML to load |
array |
Definition at line 129 of file LocaleFile.inc.php.
References $filename.
Referenced by _getCache(), and testLocale().
LocaleFile::testLocale | ( | & | $referenceLocaleFile | ) |
Test a locale file against the given reference locale file and return an array of errorType => array(errors).
$referenceLocaleFile | object |
Definition at line 172 of file LocaleFile.inc.php.
References PKPLocale\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).
$key | string |
$params | array named substitution parameters |
$locale | string the locale to use |
Definition at line 93 of file LocaleFile.inc.php.
References $cache, _cacheMiss(), _getCache(), and isValid().
object LocaleFile::$cache |
Cache of this locale file
Definition at line 22 of file LocaleFile.inc.php.
Referenced by _getCache(), and translate().
string LocaleFile::$filename |
The filename for this locale file
Definition at line 34 of file LocaleFile.inc.php.
Referenced by __construct(), getFilename(), and load().
string LocaleFile::$locale |
The identifier for this locale file
Definition at line 28 of file LocaleFile.inc.php.
Referenced by __construct().