aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Languages.php
diff options
context:
space:
mode:
authorAurélien Tamisier <virtualtam+github@flibidi.net>2018-12-02 22:47:41 +0100
committerGitHub <noreply@github.com>2018-12-02 22:47:41 +0100
commit1004742f09b55ff781c13745781b9a7e90986faa (patch)
treeaa0e5743390296441edf09f44f95b3d21f2b5a16 /application/Languages.php
parent5e0a898bb13fad528514b0d33763bcaae38b45b0 (diff)
parent9d9f6d75b94aab51067bdfbe50b58b66d1194f6d (diff)
downloadShaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.gz
Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.zst
Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.zip
Merge pull request #1234 from virtualtam/lint
Setup PHPCS and cleanup linter configuration
Diffstat (limited to 'application/Languages.php')
-rw-r--r--application/Languages.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/application/Languages.php b/application/Languages.php
index 4fa32426..b9c5d0e8 100644
--- a/application/Languages.php
+++ b/application/Languages.php
@@ -92,7 +92,7 @@ class Languages
92 /** 92 /**
93 * Initialize the translator using php gettext extension (gettext dependency act as a wrapper). 93 * Initialize the translator using php gettext extension (gettext dependency act as a wrapper).
94 */ 94 */
95 protected function initGettextTranslator () 95 protected function initGettextTranslator()
96 { 96 {
97 $this->translator = new GettextTranslator(); 97 $this->translator = new GettextTranslator();
98 $this->translator->setLanguage($this->language); 98 $this->translator->setLanguage($this->language);
@@ -125,7 +125,8 @@ class Languages
125 $translations = $translations->addFromPoFile('inc/languages/'. $this->language .'/LC_MESSAGES/shaarli.po'); 125 $translations = $translations->addFromPoFile('inc/languages/'. $this->language .'/LC_MESSAGES/shaarli.po');
126 $translations->setDomain('shaarli'); 126 $translations->setDomain('shaarli');
127 $this->translator->loadTranslations($translations); 127 $this->translator->loadTranslations($translations);
128 } catch (\InvalidArgumentException $e) {} 128 } catch (\InvalidArgumentException $e) {
129 }
129 130
130 // Default extension translation from the current theme 131 // Default extension translation from the current theme
131 $theme = $this->conf->get('theme'); 132 $theme = $this->conf->get('theme');
@@ -137,7 +138,8 @@ class Languages
137 ); 138 );
138 $translations->setDomain($theme); 139 $translations->setDomain($theme);
139 $this->translator->loadTranslations($translations); 140 $this->translator->loadTranslations($translations);
140 } catch (\InvalidArgumentException $e) {} 141 } catch (\InvalidArgumentException $e) {
142 }
141 } 143 }
142 144
143 // Extension translations (plugins, themes, etc.). 145 // Extension translations (plugins, themes, etc.).
@@ -147,10 +149,13 @@ class Languages
147 } 149 }
148 150
149 try { 151 try {
150 $extension = Translations::fromPoFile($translationPath . $this->language .'/LC_MESSAGES/'. $domain .'.po'); 152 $extension = Translations::fromPoFile(
153 $translationPath . $this->language .'/LC_MESSAGES/'. $domain .'.po'
154 );
151 $extension->setDomain($domain); 155 $extension->setDomain($domain);
152 $this->translator->loadTranslations($extension); 156 $this->translator->loadTranslations($extension);
153 } catch (\InvalidArgumentException $e) {} 157 } catch (\InvalidArgumentException $e) {
158 }
154 } 159 }
155 } 160 }
156 161