From a893480badf75f72c35d8650f20b46384c01c6df Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 31 Jan 2014 12:53:46 +0400 Subject: [PATCH] fixed docs --- docs/guide/i18n.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/docs/guide/i18n.md b/docs/guide/i18n.md index 25587dab7c..75fd099e29 100644 --- a/docs/guide/i18n.md +++ b/docs/guide/i18n.md @@ -304,25 +304,14 @@ This translation should be marked with `*`. In order to do it add the following ], ``` -After that you can start using your categories without specifying them in i18n translations. This is more familiar as for Yii1. Now you can create -files under default translation `basePath` and simply use them as usual, for example: - -* Create your category file under messages `basePath`, according default translation. Since we are not overriding `basePath` property of -[`PhpMessageSource`](https://github.com/yiisoft/yii2/blob/master/framework/i18n/PhpMessageSource.php#L40) it would be `@app/messages`. +Now you can use categories without configuring each one that is similar to Yii 1.1 behavior. +Messages for the category will be loaded from a file under default translation `basePath` that is `@app/messages`: ```php -# not_specified_category.php file under @app/messages directory. - -return [ - 'message from not specified category' => 'сообщение из неуказанной категории', -]; +echo Yii::t('not_specified_category', 'message from unspecified category'); ``` -* Use your category as before. - -```php -echo Yii::t('not_specified_category','message from not specified category'); -``` +Message will be loaded from `@app/messages//not_specified_category.php`. ###Translating module messages