2017 © Pedro Peláez
 

symfony-bundle simplei18nbundle

This Bundle provides a simple solution for translations in Symfony2.

image

juanber84/simplei18nbundle

This Bundle provides a simple solution for translations in Symfony2.

  • Tuesday, March 18, 2014
  • by juanber84
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simplei18nBundle

Install with composer

{
    "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:   /

Use it

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'}) }}

The Versions

18/03 2014

dev-master

9999999-dev

This Bundle provides a simple solution for translations in Symfony2.

  Sources   Download

MIT

The Requires

 

symfony i18n simple