The translation files is used with Yii::t(’<your translation file>’, ‘<string to be translated>’). This will take place only if the selected language differs from sourceLanguage.
Another way to translate complete views is to store them in subdirectories named as <selected language>.
Yes, the translation files have the strings plugged in and were actually generated using the yiic message command, via the Yii::t lines which are already inserted into the code.
However, for some reason, accessing this layout only shows up the <string to be translated>.
For my other layout, e.g. /layout/main.php ( with a corresponding /messages/en/main.php ) , Yii::t(’<your translation file>’, ‘<string to be translated>’) statements do pull up the corresponding strings from the EN translations array. ( as i’m using identification strings for the <string to be translated>, such as COMMON_NAV_HOME , so that the actual strings are only stored within the message arrays for each language.
Any idea why this might be happening perhaps? Could it be due to the beginContent block , if there’s any params I should be passing to it?
Oh my bad! Thanks for the hint. I overlooked the fact that the code that set the $lang had been omitted in the particular view I was working on. Fixed that and its working fine now.