Пример #1
0
 public function setUp()
 {
     parent::setUp();
     Translator::registerDomain('icingatest', BaseTestCase::$testDir . '/res/locale');
 }
Пример #2
0
 /**
  * Set up internationalization using gettext
  *
  * @return $this
  */
 protected final function setupInternationalization()
 {
     if ($this->hasLocales()) {
         Translator::registerDomain(Translator::DEFAULT_DOMAIN, $this->getLocaleDir());
     }
     $locale = $this->detectLocale();
     if ($locale === null) {
         $locale = Translator::DEFAULT_LOCALE;
     }
     try {
         Translator::setupLocale($locale);
     } catch (Exception $error) {
         Logger::error($error);
     }
     return $this;
 }
Пример #3
0
 /**
  * Bind text domain for i18n
  *
  * @return $this
  */
 protected function registerLocales()
 {
     if ($this->hasLocales()) {
         Translator::registerDomain($this->name, $this->localedir);
     }
     return $this;
 }
Пример #4
0
 /**
  * Bind text domain for i18n
  *
  * @return self
  */
 protected function registerLocales()
 {
     if (file_exists($this->localedir) && is_dir($this->localedir)) {
         Translator::registerDomain($this->name, $this->localedir);
     }
     return $this;
 }
 /**
  * Setup internationalization using gettext
  *
  * Uses the language defined in the global config or the default one
  *
  * @return  self
  */
 protected function setupInternationalization()
 {
     try {
         Translator::setupLocale($this->config->global !== null ? $this->config->global->get('language', Translator::DEFAULT_LOCALE) : Translator::DEFAULT_LOCALE);
     } catch (Exception $error) {
         Logger::error($error);
     }
     $localeDir = $this->getApplicationDir('locale');
     if (file_exists($localeDir) && is_dir($localeDir)) {
         Translator::registerDomain('icinga', $localeDir);
     }
     return $this;
 }