skcms / locale-bundle
SOLID-kiss 开发的 Symfony SKCMS Locale Bundle
v0.1
2016-01-29 15:16 UTC
Requires
- php: >=5.3.2
- doctrine/doctrine-bundle: *
- stof/doctrine-extensions-bundle: *
- symfony/framework-bundle: >=2.3
This package is auto-updated.
Last update: 2024-09-20 04:18:49 UTC
README
该软件包目前处于开发中,将很快提供更多文档和功能。
SKCMS for Symfony2 的地区软件包
安装
通过 Composer 下载依赖项
在 Windows 上使用 php composer.phar 而不是 composer
composer require SKCMS/locale-bundle:dev-master
安装语言、货币和国家。
您必须最后安装国家
php app/console skcms:import:languages
php app/console skcms:import:currencies
php app/console skcms:import:countries
使用方法
此软件包将帮助您处理翻译和其他地区相关事宜,例如国家、地址、货币等。
翻译实体
您只需在 config.yml 中启用可翻译即可
stof_doctrine_extensions:
orm:
default:
translatable: true
在 parametrs.yml 或 config.yml 中有一个参数 locale
并在 config.yml 中
framework:
default_locale: "%locale%"
现在您只需稍微修改一下可翻译实体和存储库(参考 SKCMS\LocaleBundle\Country 中的实现方式)。
致谢:数据来源于:国家:https://github.com/mledoze/countries 货币:https://github.com/datasets/currency-codes 语言:http://pastebin.com/raw.php?i=ppdMS687