yarcode/yii2-i18n-yarcode

Yii2 i18n module to manage project translation

0.11.0 2014-11-06 00:00 UTC

This package is not auto-updated.

Last update: 2024-12-22 03:36:09 UTC


README

Yii2 i18n(internationalization) module to manage project translation.

This is fork of zelenin/yii2-i18n-module with more useful interface.

##Installation

Composer

The preferred way to install this extension is through Composer.

Either run

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

or add

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

to the require section of your composer.json

##Usage

Configure i18n component in your config file(for advanced application, use common config)

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

And connect module at backend application:

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

Run migration:

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

Go to http://backend.yourdomain.com/translations for translating your messages

##Authors

Valentin Konusov, e-mail: rlng-krsk@yandex.ru