Yii v2 snippet guide

Comparing #66 with #67

Revision #67 was created by rackycz rackycz on Sep 20, 2019, 2:22:19 PM.

edit

Content

[...]
The idea behind is that in the code ther are used only English texts and if you want to change from English to some other language this file will be used.

Now go to file config/web.php, find section "components" and paste this code:

```php
    'components' => [        'i18n' => [        'translations' => [        '*' => [       'class' => 'yii\i18n\PhpMessageSource',       'basePath' => '@app/messages',       'sourceLanguage' => 'en-US',       'fileMap' => [        'app' => 'app.php',       ],   ],
 
    ],
 
      
],        ], // end of 'i18n'        // ... other configurations     ], // end of 'components'

```

Explanation of the asterisk * can be found in article [https://www.yiiframework.com/doc/guide/2.0/en/tutorial-i18n](https://www.yiiframework.com/doc/guide/2.0/en/tutorial-i18n)
[...]