Skip to content

Commit

Permalink
Enable loading of site-localised translation files
Browse files Browse the repository at this point in the history
  • Loading branch information
GwendolenLynch committed Jul 9, 2017
1 parent 554bc04 commit 795a402
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Provider/TranslationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function register(Application $app)
$app->register(
new Silex\Provider\TranslationServiceProvider(),
[
'locale_fallbacks' => ['en_GB', 'en'],
'locale_fallbacks' => ['en_GB', 'en'],
]
);
}
Expand Down Expand Up @@ -118,6 +118,8 @@ public static function addResources(Application $app, $locale)
// Directories to look for translation file(s)
$transDirs = array_unique(
[
$app['path_resolver']->resolve("%site%/app/translation/"),
$app['path_resolver']->resolve("%site%/app/translation/{$locale}"),
$app['path_resolver']->resolve("%bolt%/app/resources/translations/{$locale}"),
$app['path_resolver']->resolve("%root%/app/resources/translations/{$locale}"), // Will be done better in v3.4
]
Expand Down

0 comments on commit 795a402

Please sign in to comment.