| @@ 266-275 (lines=10) @@ | ||
| 263 | ||
| 264 | $available = ['en']; //english is always available |
|
| 265 | $dir = $this->findL10nDir($app); |
|
| 266 | if (is_dir($dir)) { |
|
| 267 | $files = scandir($dir); |
|
| 268 | if ($files !== false) { |
|
| 269 | foreach ($files as $file) { |
|
| 270 | if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') { |
|
| 271 | $available[] = substr($file, 0, -5); |
|
| 272 | } |
|
| 273 | } |
|
| 274 | } |
|
| 275 | } |
|
| 276 | ||
| 277 | // merge with translations from theme |
|
| 278 | $theme = $this->config->getSystemValue('theme'); |
|
| @@ 282-291 (lines=10) @@ | ||
| 279 | if (!empty($theme)) { |
|
| 280 | $themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot)); |
|
| 281 | ||
| 282 | if (is_dir($themeDir)) { |
|
| 283 | $files = scandir($themeDir); |
|
| 284 | if ($files !== false) { |
|
| 285 | foreach ($files as $file) { |
|
| 286 | if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') { |
|
| 287 | $available[] = substr($file, 0, -5); |
|
| 288 | } |
|
| 289 | } |
|
| 290 | } |
|
| 291 | } |
|
| 292 | } |
|
| 293 | ||
| 294 | $this->availableLanguages[$key] = $available; |
|