when you define your source language as ‘ru’ and set the language to be also ‘ru’ then your Yii::t(‘category’, ‘message’) is not translated because it is the language you are writing your source with. When you set sourceLanguage to be different then ‘ru’ and your language to ‘ru’, then your message is going to be translated as you expected.
SO if for example I want to create ‘ru’ translation, I need to define the source language as ‘en’ or something?
So what is the point to change the source language? cause if for example I change it to ‘ru’ the core messages of we don’t change they stay in english…
The point is to develop your application with your native language. Not every php developer/webdeveloper is multilingual
and usually translation is done at the end of developing.
According to api:
when you change the sourceLanguage to ‘ru’ all system messages (if there is valid translation file) are displayed in ‘ru’. Otherwise they are displayed as used with Yii::t().
And to answer your question: yes, target language should be different than source language for translation to take place