handle {_locale} prefixes on Silex with the TranslationServiceProvider
问题 I am trying to make the website I am working on, translatable. As I am using Silex, I chose the TranslationServiceProvider which is working nicely. Here is my code from app.php : $app->register(new Silex\Provider\TranslationServiceProvider(), array( 'locale' => 'en', 'locale_fallback' => array('en'), )); $app['translator'] = $app->share($app->extend('translator', function($translator, $app) { $translator->addLoader('yaml', new YamlFileLoader()); $translator->addResource('yaml', __DIR__.'