当前位置: 首页>>代码示例>>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;未经允许,请勿转载。