3 namespace BookStack\Translation;
5 use Illuminate\Translation\FileLoader as BaseLoader;
7 class FileLoader extends BaseLoader
10 * Load the messages for the given locale.
11 * Extends Laravel's translation FileLoader to look in multiple directories
12 * so that we can load in translation overrides from the theme file if wanted.
14 * @param string $locale
15 * @param string $group
16 * @param string|null $namespace
20 public function load($locale, $group, $namespace = null)
22 if ($group === '*' && $namespace === '*') {
23 return $this->loadJsonPaths($locale);
26 if (is_null($namespace) || $namespace === '*') {
27 $themePath = theme_path('lang');
28 $themeTranslations = $themePath ? $this->loadPath($themePath, $locale, $group) : [];
29 $originalTranslations = $this->loadPath($this->path, $locale, $group);
31 return array_merge($originalTranslations, $themeTranslations);
34 return $this->loadNamespaced($locale, $group, $namespace);