yii2 framework message language

b24

As you know in Yii2 the core messages are available in 26 languages. I want to change yii core message language to display validation message in my language.

I added this line to my config file:

'language' => 'fa_IR',

and also added this lines:

'i18n'=>[
            ...
                'yii'=>[
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => "@vendor/yiisoft/yii2/messages",
                    'sourceLanguage' => 'en_US',
                    'fileMap' => [
                        'yii'=>'yii.php',
                    ]
                ]
            ]
        ],

but core message shown in English. I only want to use framework message available with Yii2. For example in this path vendor/yiisoft/yii2/messages/fa_IR/yii.php

What is the best solution for this work.

b24

Ohhhh it's my mistake. Language code is fa-IR but I set it fa_IR. I think all language code seperate by _ like 'sourceLanguage' => 'en_US', but it's different. Sorry all.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Yii2 - Multi language

From Dev

Yii framework possible language

From Dev

Yii framework possible language

From Dev

yii2 : how to change language of ckeditor

From Dev

yii2 basic multiple language

From Dev

How to display message in yii framework?

From Dev

How to display message in yii framework?

From Dev

No error message show in yii2

From Dev

How to set a flash message in Yii2?

From Dev

Custom validation message not working in Yii2

From Dev

Yii2 ActiveForm validation rules message

From Dev

Custom validation message not working in Yii2

From Dev

Align validation error message in yii2

From Dev

Webservice response in yii2 framework

From Dev

What is the default controller in Yii2 framework?

From Dev

How to integrate PHPExcel in Yii2 Framework?

From Dev

Yii2 framework tables join

From Dev

Yii2 change controller and action name acording to language selected

From Dev

Set global language value in Yii2 application

From Dev

Yii2 change controller and action name acording to language selected

From Dev

Yii2 prepend the language to the URL using UrlManager::createUrl()

From Dev

Yii2: How to make validation rule message not to be encoded?

From Dev

Integrity constraint exception handling with user friendly message Yii2

From Dev

how I use flash message in yii2?

From Dev

Yii2: Set incorrect username or password message on login

From Dev

Yii2 Active Form custom message with Html tags

From Dev

Yii2, Custom validation message with attribute names

From Dev

Yii2 ActiveForm unique validation not show error message

From Dev

Yii2 no result message without using gridview