My app()->sourceLanguage = ‘RU’ and app()->language = ‘RU’

I need translate string from 'EN' to 'RU'.

What way I can do this?


"sourceLanguage" is the language on the site - the base language.

"language" is the language you want displayed.

If you have site that can be displayed in several languages and it is written in russian, then "sourceLanguage" shoudl be set to "russian", and "language" - to desired one…

In your case - the site is written in english (I am guessing here), you need russian translation, so you will need a ru.php in the "messages" directory. In ru.php, every key will be phrase in english, and the value - its equivalent in russian. "sourceLanguage" must be set to "english", and "language" to "russain".


my site written in russian and user also russian.

I want translate 3rd-Party Libraries (written in English) from EN to RU with Yii::t() function.

Is this possible?