X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FLanguages.php;h=5cda802e0c1faaf57058e0dca653cc713c90c0c3;hb=dea72c711ff740b3b829d238fcf85648465143a0;hp=db4b84aea23a0e8862e9b41afb1c3c5aec233328;hpb=9b2bd66fb60ffd5a833480bf329062c7d57bc8c4;p=github%2Fshaarli%2FShaarli.git diff --git a/application/Languages.php b/application/Languages.php index db4b84ae..5cda802e 100644 --- a/application/Languages.php +++ b/application/Languages.php @@ -3,7 +3,6 @@ namespace Shaarli; use Gettext\GettextTranslator; -use Gettext\Merge; use Gettext\Translations; use Gettext\Translator; use Gettext\TranslatorInterface; @@ -92,7 +91,7 @@ class Languages /** * Initialize the translator using php gettext extension (gettext dependency act as a wrapper). */ - protected function initGettextTranslator () + protected function initGettextTranslator() { $this->translator = new GettextTranslator(); $this->translator->setLanguage($this->language); @@ -125,7 +124,8 @@ class Languages $translations = $translations->addFromPoFile('inc/languages/'. $this->language .'/LC_MESSAGES/shaarli.po'); $translations->setDomain('shaarli'); $this->translator->loadTranslations($translations); - } catch (\InvalidArgumentException $e) {} + } catch (\InvalidArgumentException $e) { + } // Default extension translation from the current theme $theme = $this->conf->get('theme'); @@ -137,7 +137,8 @@ class Languages ); $translations->setDomain($theme); $this->translator->loadTranslations($translations); - } catch (\InvalidArgumentException $e) {} + } catch (\InvalidArgumentException $e) { + } } // Extension translations (plugins, themes, etc.). @@ -147,10 +148,13 @@ class Languages } try { - $extension = Translations::fromPoFile($translationPath . $this->language .'/LC_MESSAGES/'. $domain .'.po'); + $extension = Translations::fromPoFile( + $translationPath . $this->language .'/LC_MESSAGES/'. $domain .'.po' + ); $extension->setDomain($domain); $this->translator->loadTranslations($extension); - } catch (\InvalidArgumentException $e) {} + } catch (\InvalidArgumentException $e) { + } } } @@ -177,6 +181,7 @@ class Languages 'auto' => t('Automatic'), 'en' => t('English'), 'fr' => t('French'), + 'de' => t('German'), ]; } }