eb78 / custom-i18n-router-bundle
为Symfony定制的路由多语言支持
0.2.0
2018-06-20 10:21 UTC
Requires
- php: >=7.0.0
- doctrine/doctrine-bundle: ~1.4
- doctrine/orm: ~2.5
- symfony/symfony: 2.8.*|3.*
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: 6.3
- sensio/generator-bundle: ~3.0
README
CustomI18nRouterBundle
为Symfony设计的i18n包。
安装
使用Composer下载库
composer require eb78/custom-i18n-router-bundle
注册包
... new EB78\CustomI18nRouterBundle\EB78CustomI18nRouterBundle() ...
添加参数
... parameters: available_locales: ['fr-fr'] default_locale: 'fr-fr' ...
创建i18n配置文件。
例如,对于法语文件,创建一个名为"i18n_fr-fr"的文件,内容如下
( fr-fr 应包含在 available_locales 参数中 )
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