aist / aist-locale
ZF2 应用程序的区域模块。
dev-master
2015-08-25 19:07 UTC
Requires
- php: >=5.4.0
- ext-intl: *
- zendframework/zend-console: >=2.3.3
- zendframework/zend-filter: >=2.3.3
- zendframework/zend-i18n: >=2.3.3
- zendframework/zend-mvc: >=2.3.3
- zendframework/zend-validator: >=2.3.3
Requires (Dev)
- phpunit/phpunit: 4.8.*
This package is not auto-updated.
Last update: 2024-09-14 18:09:39 UTC
README
一个 Zend Framework 2 模块。
安装
此模块的安装使用 composer。有关 composer 文档,请参阅 getcomposer.org。
- 通过运行以下命令安装模块
php composer.phar require aist/aist-locale
或者直接从 github 下载并将其放置在您的应用程序的module/
目录中。 - 将
AistLocale
模块添加到您的config/application.config.php
文件的模块部分 - 将
aist-locale.global.php.dist
复制到./config/autoload/aist-locale.global.php
配置
此模块通过扩展 I18n 提供了额外的配置。以下是配置键的列表。
-
locale
- 默认语言。 -
plural_rule
- 复数规则。 -
check_agent
- 与优先级较高的用户代理语言匹配。 -
supported
- 支持的语言。 -
translation_file_patterns
-'locale' => 'pl_PL', 'plural_rule' => 'nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)', 'check_agent' => false, 'supported' => ['pl', 'pl-PL', 'en'], 'translation_file_patterns' => [ 'gettext' => [ 'type' => 'gettext', 'base_dir' => './data/language', 'pattern' => '%s.mo', ], ],
清单
- 根据所选的
locale
添加自动设置plural_rule
选项 - 添加配置安装脚本
- 添加设置新参数
- 添加测试
- 重构
Module.php