dev-master
9999999-devThis Bundle provides a simple solution for translations in Symfony2.
MIT
The Requires
- php >=5.3.2
- symfony/framework-bundle >=2.0.0
by Juan Berzal
symfony i18n simple
This Bundle provides a simple solution for translations in Symfony2.
{ "require": { "juanber84/simplei18nbundle": "dev-master" } }
Compatible with http://symfony.com/doc/current/cookbook/session/locale_sticky_session.html, (*1)
Add in your app/AppKernel.php, (*2)
<?php // app/AppKernel.php public function registerBundles() { return array( // ... new Juanber84\Bundle\Simplei18nBundle\Juanber84Simplei18nBundle(), // ... ); }
Add in your app/routing.yml, (*3)
juanber84_simplei18n: resource: "@Juanber84Simplei18nBundle/Resources/config/routing.yml" prefix: /
Put the next twig code in the header of your layout:, (*4)
{{ language('es') }} // If you used this it will convert to the language which you've inserted {{ language() }} // If you used this it will convert to the language which _locale var session
Use the widget where you would show it:, (*5)
{{ simplei18n(['es', 'en', 'pt', 'it'] )|raw }}
Make your custom widget using the path:, (*6)
{{ path('juanber84_simplei18n_changelocale', {'locale': 'es'}) }}
This Bundle provides a simple solution for translations in Symfony2.
MIT
symfony i18n simple