コード例 #1
0
ファイル: controllerConsole.php プロジェクト: M03G/PrestaShop
 public final function __construct($step)
 {
     $this->step = $step;
     $this->datas = Datas::getInstance();
     // Set current language
     $this->language = LanguageList::getInstance();
     Context::getContext()->language = $this->language->getLanguage($this->datas->language);
     $this->translator = Context::getContext()->getTranslator();
     if (!$this->datas->language) {
         die('No language defined');
     }
     $this->language->setLanguage($this->datas->language);
     $this->init();
 }
コード例 #2
0
ファイル: controllerHttp.php プロジェクト: M03G/PrestaShop
 public function __construct()
 {
     $this->session = InstallSession::getInstance();
     // Set current language
     $this->language = LanguageList::getInstance();
     $detect_language = $this->language->detectLanguage();
     if (empty($this->session->lang)) {
         $this->session->lang = $detect_language['primarytag'];
     }
     Context::getContext()->language = $this->language->getLanguage($this->session->lang ?: false);
     $this->translator = Context::getContext()->getTranslator();
     if (isset($this->session->lang)) {
         $lang = $this->session->lang;
     } else {
         $lang = isset($detect_language['primarytag']) ? $detect_language['primarytag'] : false;
     }
     if (!in_array($lang, $this->language->getIsoList())) {
         $lang = 'en';
     }
     $this->language->setLanguage($lang);
     if (empty(self::$steps)) {
         $this->initSteps();
     }
     $this->init();
 }
コード例 #3
0
ファイル: model.php プロジェクト: M03G/PrestaShop
 public function __construct()
 {
     $this->language = LanguageList::getInstance();
 }
コード例 #4
0
ファイル: xmlLoader.php プロジェクト: M03G/PrestaShop
 public function __construct()
 {
     $this->language = LanguageList::getInstance();
     $this->setDefaultPath();
 }