本文整理匯總了PHP中CAppUI::addLocale方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAppUI::addLocale方法的具體用法?PHP CAppUI::addLocale怎麽用?PHP CAppUI::addLocale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CAppUI
的用法示例。
在下文中一共展示了CAppUI::addLocale方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateTranslation
/**
* Update locales array
*
* @return void
*/
function updateTranslation()
{
$items = $this->getRealListOwner()->getItemNames();
$ex_class = $this->loadRefExClass();
$key = ".{$this->name}";
$_class_name = $ex_class->getExClassName();
CAppUI::addLocale($_class_name, "{$key}.", CAppUI::tr("Undefined"));
foreach ($items as $_id => $_item) {
CAppUI::addLocale($_class_name, "{$key}.{$_id}", $_item);
}
$trans = null;
$local_key = "{$key}-{$this->name}";
if (isset(CAppUI::$locales[$_class_name][$local_key])) {
$this->_locale = CAppUI::$locales[$_class_name][$local_key];
} else {
$trans = $trans ? $trans : $this->loadRefTranslation();
$this->_locale = $trans->std;
}
$local_key = "{$key}-{$this->name}-desc";
if (isset(CAppUI::$locales[$_class_name][$local_key])) {
$this->_locale_desc = CAppUI::$locales[$_class_name][$local_key];
} else {
$trans = $trans ? $trans : $this->loadRefTranslation();
$this->_locale_desc = $trans->desc;
}
$local_key = "{$key}-{$this->name}-court";
if (isset(CAppUI::$locales[$_class_name][$local_key])) {
$this->_locale_court = CAppUI::$locales[$_class_name][$local_key];
} else {
$trans = $trans ? $trans : $this->loadRefTranslation();
$this->_locale_court = $trans->court;
}
$this->_view = $this->_locale;
}
示例2: updateLocales
function updateLocales(CExClassField $base = null)
{
list($prefix, $key) = $this->getKey($base);
CAppUI::addLocale($prefix, $key, $this->value);
$this->_view = $this->value;
}