Difference between #67 and #68 of
Yii v2 snippet guide

Revision #68 has been created by rackycz on Sep 20, 2019, 2:30:08 PM with the memo:

edit
« previous (#67) next (#69) »

Changes

Title unchanged

Yii v2 for beginners

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,beginner,yii2

Content changed

[...]
Now you can open the page for adding a new user and you will see than so far nothing changed :-)

- [http://localhost/basic-/web/index.php?r=user%2Fcreate](http://localhost/basic-/web/index.php?r=user%2Fcreate)

We must change the language ... For now let's do it in a primitive
way. Open the userController, find actionCreate() and paste this code:
 
 
```php
 
Yii::$app->language = "cs-CZ"; // use your language
and permanent way again in file config/web.php
 
 
```php
 
$config = [
 
    // use your language
 
    // also accessible via Yii::$app->language
 
    'language' => 'cs-CZ',
 
    
 
    'sourceLanguage' => 'en-US', // en-US is default value, try not to change it.

```
Note: This language-setting will be forgotten as soon as you click somewhere. In next chapter we will enhance this ..

Switching languages + session + dropdown in the top menu
---
[...]
7 0
4 followers
Viewed: 274 964 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Sep 19, 2019
Last updated: a year ago
Update Article

Revisions

View all history