i18n Bundle for Symfony.
Download the library using Composer:
composer require eb78/custom-i18n-router-bundle
Register Bundle
...
new EB78\CustomI18nRouterBundle\EB78CustomI18nRouterBundle()
...
Add Parameters
...
parameters:
available_locales: ['fr-fr']
default_locale: 'fr-fr'
...
Create i18n config files.
For exemple, for a French file, create a file with name "i18n_fr-fr" with content like that :
( fr-fr should be into available_locales parameters )
parameters:
i18n_fr-fr:
prefix: ""
name: "france"
localeUId: 1
locale: "fr_FR"
host: "yourdomain.fr"
routes:
home: /accueil/
contact: /contactez-nous/
- PHP >= 7.x
- Symfony 2.8