vaszloy/yii2-i18n-yarcode

用于管理项目翻译的Yii2 i18n模块

安装次数: 1,995

依赖关系: 0

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 4

类型:yii2-extension

1.11.1 2014-11-06 00:00 UTC

This package is not auto-updated.

Last update: 2024-09-22 00:43:20 UTC


README

这是一个用于管理项目翻译的Yii2 i18n(internationalization)模块。

这是基于 zelenin/yii2-i18n-module 的分支,具有更实用的界面。

##安装

Composer

安装此扩展的首选方式是通过 Composer

运行以下命令之一:

php composer.phar require vaszloy/yii2-i18n-yarcode "dev-master"

或者

"vaszloy/yii2-i18n-yarcode": "dev-master"

将以下内容添加到您的 composer.json 文件的 require 部分

##使用方法

在您的配置文件中配置 i18n 组件(对于高级应用,使用 common 配置)

'components' => [
    ...,
    'i18n' => [
        'class' => vaszloy\i18n\components\I18N::className(),
        'languages' => [
            'en-EN' => 'English',
            'es-ES' => 'Español',
            'ru-RU' => 'Русский',
        ],
        'defaultLanguage' => 'en-EN',
        'on missingTranslation' => ['vaszloy\i18n\Module', 'missingTranslation']
    ],
    ...
]

并在后端应用中连接模块

'modules' => [
    ...,
    'i18n' => vaszloy\i18n\Module::className(),
    ...
]

运行迁移

php yii migrate --migrationPath=@vendor/yii-dream-team/yii2-i18n-yarcode/src/migrations

访问 http://backend.yourdomain.com/translations 进行翻译您的消息

##作者

Valentin Konusov,电子邮件:rlng-krsk@yandex.ru