How can you dynamically set which language application should use ? I would like to have two links in my main menu where users can click: Fr | En . If user click "Fr" I want application to load French translation and if user click "En" I want English one. What do we need to do to achieve this ? What is the best way ?
If the sourceLanguage and language are the same value, the translation mechanism will not happen - it is the same as saying my messages in code and my messages in e.g. database are in the same language - why translate?
The sourceLanguage needs to be the language of the messages in Yii::t() in code and the language needs to be what language you want them displayed in.
@black-room-boy - don’t hijack someone else’s thread - ask another question on the forum!