當前位置: 首頁>>代碼示例>>PHP>>正文


PHP jLocale::getPreferedLocaleFromRequest方法代碼示例

本文整理匯總了PHP中jLocale::getPreferedLocaleFromRequest方法的典型用法代碼示例。如果您正苦於以下問題:PHP jLocale::getPreferedLocaleFromRequest方法的具體用法?PHP jLocale::getPreferedLocaleFromRequest怎麽用?PHP jLocale::getPreferedLocaleFromRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jLocale的用法示例。


在下文中一共展示了jLocale::getPreferedLocaleFromRequest方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: beforeAction

 /**
  * @param    array  $params   plugin parameters for the current action
  * @return null or jSelectorAct  if action should change
  */
 public function beforeAction($params)
 {
     $langDetected = false;
     $lang = '';
     if ($this->config['enableUrlDetection']) {
         $l = jApp::coord()->request->getParam($this->config['urlParamNameLanguage']);
         if ($l !== null) {
             $lang = jLocale::getCorrespondingLocale($l);
             if ($lang != '') {
                 $langDetected = true;
             }
         }
     }
     if (!$langDetected) {
         if (isset($_SESSION['JX_LANG'])) {
             $lang = $_SESSION['JX_LANG'];
         } else {
             if ($this->config['useDefaultLanguageBrowser']) {
                 $lang = jLocale::getPreferedLocaleFromRequest();
             }
         }
     }
     if ($lang != '') {
         $_SESSION['JX_LANG'] = $lang;
         jApp::config()->locale = $lang;
     }
     return null;
 }
開發者ID:CREASIG,項目名稱:lizmap-web-client,代碼行數:32,代碼來源:autolocale.coord.php

示例2: _prepareTpl

 protected function _prepareTpl()
 {
     $lang = jApp::config()->locale;
     if (!$this->getParam('no_lang_check')) {
         $locale = jLocale::getPreferedLocaleFromRequest();
         if (!$locale) {
             $locale = 'en_US';
         }
         jApp::config()->locale = $locale;
     }
     $reporter = new checkZoneInstallReporter();
     $check = new jInstallCheck($reporter, $lang);
     $reporter->messageProvider = $check->messages;
     $check->run();
     $this->_tpl->assign('wwwpath', jApp::wwwPath());
     $this->_tpl->assign('configpath', jApp::configPath());
     $this->_tpl->assign('check', $reporter->trace);
 }
開發者ID:havefnubb,項目名稱:havefnubb,代碼行數:18,代碼來源:check_install.zone.php

示例3: _prepareTpl

 protected function _prepareTpl()
 {
     $lang = jApp::config()->locale;
     if (!$this->param('no_lang_check')) {
         $locale = jLocale::getPreferedLocaleFromRequest();
         if (!$locale) {
             $locale = 'en_US';
         }
         jApp::config()->locale = $locale;
     }
     $messages = new \Jelix\Installer\Checker\Messages($lang);
     $reporter = new \Jelix\Installer\Reporter\HtmlBuffer($messages);
     $check = new \Jelix\Installer\Checker\Checker($reporter, $messages);
     $check->run();
     $this->_tpl->assign('wwwpath', jApp::wwwPath());
     $this->_tpl->assign('configpath', jApp::configPath());
     $this->_tpl->assign('check', $reporter->trace);
 }
開發者ID:mdouchin,項目名稱:jelix,代碼行數:18,代碼來源:check_install.zone.php


注:本文中的jLocale::getPreferedLocaleFromRequest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。