当前位置: 首页>>代码示例>>PHP>>正文


PHP Localization::getAvailableInterfaceLanguages方法代码示例

本文整理汇总了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");
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:33,代码来源:login.php

示例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;
	}
开发者ID:nveid,项目名称:concrete5,代码行数:13,代码来源:install.php

示例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);
 }
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:17,代码来源:controller.php

示例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();
?>
开发者ID:JeRoNZ,项目名称:concrete5-1,代码行数:31,代码来源:search.php


注:本文中的Localization::getAvailableInterfaceLanguages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。