| @@ 191-200 (lines=10) @@ | ||
| 188 | ||
| 189 | $available = ['en']; //english is always available |
|
| 190 | $dir = $this->findL10nDir($app); |
|
| 191 | if (is_dir($dir)) { |
|
| 192 | $files = scandir($dir); |
|
| 193 | if ($files !== false) { |
|
| 194 | foreach ($files as $file) { |
|
| 195 | if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') { |
|
| 196 | $available[] = substr($file, 0, -5); |
|
| 197 | } |
|
| 198 | } |
|
| 199 | } |
|
| 200 | } |
|
| 201 | ||
| 202 | // merge with translations from theme |
|
| 203 | $theme = $this->config->getSystemValue('theme'); |
|
| @@ 207-216 (lines=10) @@ | ||
| 204 | if (!empty($theme)) { |
|
| 205 | $themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot)); |
|
| 206 | ||
| 207 | if (is_dir($themeDir)) { |
|
| 208 | $files = scandir($themeDir); |
|
| 209 | if ($files !== false) { |
|
| 210 | foreach ($files as $file) { |
|
| 211 | if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') { |
|
| 212 | $available[] = substr($file, 0, -5); |
|
| 213 | } |
|
| 214 | } |
|
| 215 | } |
|
| 216 | } |
|
| 217 | } |
|
| 218 | ||
| 219 | $this->availableLanguages[$key] = $available; |
|