Skip to content

Instantly share code, notes, and snippets.

@davedevelopment
Created March 5, 2013 11:07
Show Gist options
  • Save davedevelopment/5089569 to your computer and use it in GitHub Desktop.
Save davedevelopment/5089569 to your computer and use it in GitHub Desktop.
diff --git a/silex/app.php b/silex/app.php
index c72525c..172d4a1 100644
--- a/silex/app.php
+++ b/silex/app.php
@@ -16,8 +16,6 @@ $app = new Application();
*/
$app['locale'] = 'en';
$app['session.default_locale'] = $app['locale'];
-$app['translator.messages'] = require __DIR__ . '/resources/locales/translations.php';
-$app['languages'] = array_keys($app['translator.messages']);
/**
* Cache
@@ -33,13 +31,18 @@ $app->register(new Silex\Provider\SessionServiceProvider());
$app->register(new Igorw\Silex\ConfigServiceProvider( __DIR__ . "/resources/config/settings.yml"));
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
$app->register(new Silex\Provider\TranslationServiceProvider(), array(
- 'locale_fallback' => $app['locale']
+ 'locale_fallback' => $app['locale'],
+ 'translator.domains' => array(
+ 'messages' => require __DIR__ . '/resources/locales/translations.php',
+ ),
));
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__ . '/views',
'twig.class_path' => __DIR__ . '/vendor/twig/lib',
));
+$app['languages'] = array_keys($app['translator.domains']['messages']);
+
/**
* Layout template
*/
@@ -81,4 +84,4 @@ $app->error(function (\Exception $e, $code) use ($app) {
}
});
-return $app;
\ No newline at end of file
+return $app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment