本文整理汇总了PHP中Localization::getAvailableInterfaceLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP Localization::getAvailableInterfaceLanguages方法的具体用法?PHP Localization::getAvailableInterfaceLanguages怎么用?PHP Localization::getAvailableInterfaceLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Localization
的用法示例。
在下文中一共展示了Localization::getAvailableInterfaceLanguages方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_start
public function on_start()
{
$this->error = Loader::helper('validation/error');
if (USER_REGISTRATION_WITH_EMAIL_ADDRESS == true) {
$this->set('uNameLabel', t('Email Address'));
} else {
$this->set('uNameLabel', t('Username'));
}
$txt = Loader::helper('text');
if (strlen($_GET['uName'])) {
// pre-populate the username if supplied, if its an email address with special characters the email needs to be urlencoded first,
$this->set("uName", trim($txt->email($_GET['uName'])));
}
$languages = array();
$locales = array();
if (Config::get('LANGUAGE_CHOOSE_ON_LOGIN')) {
Loader::library('3rdparty/Zend/Locale');
Loader::library('3rdparty/Zend/Locale/Data');
$languages = Localization::getAvailableInterfaceLanguages();
if (count($languages) > 0) {
array_unshift($languages, 'en_US');
}
$locales = array('' => t('** Default'));
Zend_Locale_Data::setCache(Cache::getLibrary());
foreach ($languages as $lang) {
$loc = new Zend_Locale($lang);
$locales[$lang] = Zend_Locale::getTranslation($loc->getLanguage(), 'language', ACTIVE_LOCALE);
}
}
$this->locales = $locales;
$this->set('locales', $locales);
$this->openIDReturnTo = BASE_URL . View::url("/login", "complete_openid");
}
示例2: getLocales
protected function getLocales() {
Loader::library('3rdparty/Zend/Locale');
$languages = Localization::getAvailableInterfaceLanguages();
if (count($languages) > 0) {
array_unshift($languages, 'en_US');
}
$locales = array();
foreach($languages as $lang) {
$loc = new Zend_Locale($lang);
$locales[$lang] = Zend_Locale::getTranslation($loc->getLanguage(), 'language', $lang);
}
return $locales;
}
示例3: view
public function view()
{
Loader::library('3rdparty/Zend/Locale');
$languages = Localization::getAvailableInterfaceLanguages();
if (count($languages) > 0) {
array_unshift($languages, 'en_US');
}
$locales = array();
foreach ($languages as $lang) {
$loc = new Zend_Locale($lang);
$locales[$lang] = Zend_Locale::getTranslation($loc->getLanguage(), 'language', ACTIVE_LOCALE);
}
$this->set('LANGUAGE_CHOOSE_ON_LOGIN', Config::get('LANGUAGE_CHOOSE_ON_LOGIN'));
$this->set('LANGUAGE_MULTILINGUAL_CONTENT_ENABLED', Config::get('LANGUAGE_MULTILINGUAL_CONTENT_ENABLED'));
$this->set('interfacelocales', $locales);
$this->set('languages', $languages);
}
示例4: h
echo $view->action('get_timezones');
?>
" data-url="<?php
echo $view->action('update_timezone', $user->getUserID());
?>
" data-type="select2" data-name="uTimezone" data-value="<?php
echo h($uTimezone);
?>
"<? } ?>><?php
echo $dh->getTimezoneDisplayName($uTimezone);
?>
</span></p></div>
</div>
<? } ?>
<?
$languages = Localization::getAvailableInterfaceLanguages();
if (count($languages) > 0) { ?>
<div class="row">
<div class="col-md-4"><p><?php
echo t('Language');
?>
</p></div>
<div class="col-md-8"><p><span <? if ($canEditLanguage) { ?>data-editable-field-type="xeditable" data-source="<?php
echo $view->action('get_languages');
?>
" data-url="<?php
echo $view->action('update_language', $user->getUserID());
?>
" data-type="select" data-name="uDefaultLanguage"<? } ?>><?php
echo $user->getUserDefaultLanguage();
?>