Public Member Functions | |
prepare () | |
setLocale ($locale) | |
getLocale () | |
setLanguage ($language) | |
getLanguage () | |
loadGlobalMessageCatalog () | |
loadModuleMessageCatalog ($moduleName) | |
loadThemeMessageCatalog ($themeName) | |
existFile ($section, $filename) | |
getFilepath ($section, $filename) | |
loadTextFile ($section, $filename) | |
translate ($word) | |
getFallbackLanguage () | |
getFallbackLocale () |
Rules about language are different at each bases. So it's important that a base defines the sub class of this class if it can't use this class directly.
And, XCube or bases have to make each languages possible to have its sub class. By that, languages become able to implement their logic to solve problems.
This class calls sub directories of each languages 'section'. 'section' is used to load image files and etc.
XCube_LanguageManager::prepare | ( | ) |
Normally, this member function is called soon, after constructor. To follow the base, initialize.
XCube_LanguageManager::setLocale | ( | $ | locale | ) |
Set locale name.
string | $local locale name |
XCube_LanguageManager::getLocale | ( | ) |
Get locale name.
XCube_LanguageManager::setLanguage | ( | $ | language | ) |
Set language name.
string | $language language name |
XCube_LanguageManager::getLanguage | ( | ) |
Get language name.
XCube_LanguageManager::loadGlobalMessageCatalog | ( | ) |
Load the global message catalog which is defined in the base module.
XCube_LanguageManager::loadModuleMessageCatalog | ( | $ | moduleName | ) |
Load the module message catalog which is defined in the specified module.
string | $moduleName A name of module. |
XCube_LanguageManager::loadThemeMessageCatalog | ( | $ | themeName | ) |
Load the theme message catalog which is defined in the specified module.
string | $themeName A name of theme. |
XCube_LanguageManager::existFile | ( | $ | section, | |
$ | filename | |||
) |
check the exstence of the specified file in the specified section.
public
string | $section A name of section. | |
string | $filename A name of file |
XCube_LanguageManager::getFilepath | ( | $ | section, | |
$ | filename | |||
) |
Return the file path by the specified section and the specified file.
public
string | $section A name of section. | |
string | $filename A name of file |
XCube_LanguageManager::loadTextFile | ( | $ | section, | |
$ | filename | |||
) |
Get file contents and return it.
public
string | $section A name of section. | |
string | $filename A name of file |
XCube_LanguageManager::translate | ( | $ | word | ) |
Return translated message.
string | $word |
XCube_LanguageManager::getFallbackLanguage | ( | ) |
Return default language name.
protected
XCube_LanguageManager::getFallbackLocale | ( | ) |
Return default locale name.
protected