Internationalization Guide

Hi, I want to implement internationalization function but couldn’t get the idea of how to do and how it works,

I want to translate between English US and Malaysian Malay

right now my source of reference is from the yii framework doc tutorial of internationalization and youtube video from DoItEasyChannel on topic internationalization

I have install Yii2 Framework advance template, and my folder directory is attached below,

First, from my understanding by link i post above, I get that

  1. in backend > config > main.php ( attached image 02 below )

I need to insert

‘language’ => ‘ms-My’,

‘sourceLanguage’ => ‘en-Us’,

  1. also in backend > config > main.php ( attached image 03 below)

I need to insert

‘i18n’ => [

        'translations' => [


            'app*' => [


                'class' => 'yii\i18n\PhpMessageSource',


                // 'basePath' => '@app/messages',


                'sourceLanguage' => 'en-US',


                'fileMap' => [


                    'app' => 'app.php',


                    'app/error' => 'error.php',


                     ],


              ],


          ],


    ],

below component

  1. I understand that the basePath will refer to the source of language directory stored, for example :

‘basePath’ => ‘common/messages’

refer to the common > messages directory

and the fileMap shows file that it will check, but right now, my Yii framework does not provide the message folder and at this moment i am stuck.

Well, create it.