dev-master
9999999-devInternationalization extension for Yii2 framework
MIT
The Requires
- php >=5.5.0
- yiisoft/yii2 *
- gettext/gettext ~4.2
The Development Requires
by panlatent
extension yii2 i18n internationalization
Internationalization extension for Yii2 framework
Internationalization extension for Yii2 framework., (*2)
This extension use Gettext as message source and provide Web GUI(gii) editing message source., (*3)
The preferred way to install this extension is through composer., (*4)
Either run, (*5)
php composer.phar require --prefer-dist yiithings/yii2-i18n "*"
or add, (*6)
"yiithings/yii2-i18n": "*"
to the require section of your composer.json
file., (*7)
Once the extension is installed, simply use it in your code by :, (*8)
Add the component to your application., (*9)
'components' => [ 'i18n' => [ 'class' => 'yiithings\i18n\I18N' ] ]
Use functions:, (*10)
echo __('Username'); __('Username'); // with echo echo _x('Username', 'yii'); _xe('Username', 'yii'); // with echo
Edit messages:, (*11)
Use PoEdit create or edit your messages.
.po
and .mo
files default save path is @app/messages/
, e.g.
@app/messages/en-US.mo
. If you want to change path rule, please
see GettextMessageSource Class., (*12)
Internationalization extension for Yii2 framework
MIT
extension yii2 i18n internationalization