本文整理汇总了PHP中Locale::getMainLocaleFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP Locale::getMainLocaleFilename方法的具体用法?PHP Locale::getMainLocaleFilename怎么用?PHP Locale::getMainLocaleFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locale
的用法示例。
在下文中一共展示了Locale::getMainLocaleFilename方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLocaleFiles
function getLocaleFiles($locale)
{
if (!Locale::isLocaleValid($locale)) {
return null;
}
$localeFiles = array(Locale::getMainLocaleFilename($locale));
$plugins =& PluginRegistry::loadAllPlugins();
foreach (array_keys($plugins) as $key) {
$plugin =& $plugins[$key];
$localeFile = $plugin->getLocaleFilename($locale);
if (!empty($localeFile)) {
$localeFiles[] = $localeFile;
}
unset($plugin);
}
return $localeFiles;
}
示例2: testLocale
/**
* Test all locale files for the supplied locale against the supplied
* reference locale, returning an array of errors.
* @param $locale string Name of locale to test
* @param $referenceLocale string Name of locale to test against
* @return array
*/
function testLocale($locale, $referenceLocale)
{
$localeFile =& new LocaleFile($locale, Locale::getMainLocaleFilename($locale));
$referenceLocaleFile =& new LocaleFile($referenceLocale, Locale::getMainLocaleFilename($referenceLocale));
$errors = $localeFile->testLocale($referenceLocaleFile);
unset($localeFile);
unset($referenceLocaleFile);
$plugins =& PluginRegistry::loadAllPlugins();
foreach (array_keys($plugins) as $key) {
$plugin =& $plugins[$key];
$referenceLocaleFilename = $plugin->getLocaleFilename($referenceLocale);
if ($referenceLocaleFilename) {
$localeFile =& new LocaleFile($locale, $plugin->getLocaleFilename($locale));
$referenceLocaleFile =& new LocaleFile($referenceLocale, $referenceLocaleFilename);
$errors = array_merge_recursive($errors, $localeFile->testLocale($referenceLocaleFile));
unset($localeFile);
unset($referenceLocaleFile);
}
unset($plugin);
}
return $errors;
}