Revision #139 was created by rackycz on Oct 4, 2019, 4:34:54 PM.
edit
Content
[...]
If you have a view with long texts and you want to translate it into a 2nd language, it is not good idea to use the previous approach, because it uses the English text as the ID.
It is better to translate the whole view. How? ... Just create a sub-folder next to the view and give it name which will be identical to the target-lang-ID. In my case the 2nd language is Czech so I created following folder and copied my view in it. So now I have 2 identical views with identical names:
- "C:\xampp\htdocs\chatarbasic\views\site\about.php" ... English
- "C:\xampp\htdocs\chatarbasic\views\site\cs-CZ\about.php" ... Czech
Yii will automatically use the Czech version if needed.
**Switching languages + session + lang-dropdown in the top menu**
---