Sachy
(Sachin Mandalia)
February 3, 2015, 5:45pm
1
Which method shall I use to translate the entire view file after rendering?
I have actually used this link http://www.yiiframework.com/wiki/26/setting-and-maintaining-the-language-in-application-i18n/
and have configured default langauge etc.,
but can’t find my answers anywhere.
Actually I don’t want to translate any specific message but I want to translate entire view file
I have read here : http://www.yiiframework.com/doc/guide/1.1/en/topics.i18n
Translation
The most needed I18N feature is perhaps translation, including message translation and view translation . The former translates a text message to the desired language, while the latter translates a whole file to the desired language.
I am looking for view translation example.
phtamas
(Phtamas)
February 3, 2015, 7:13pm
2
Just scroll down a bit more on the page you linked
When calling one of the render methods in a controller or widget, the view files will be translated automatically. For example, if the target language is zh_cn while the source language is en_us, rendering a view named edit would resulting in searching for the view file protected/views/ControllerID/zh_cn/edit.php. If the file is found, this translated version will be used for rendering; otherwise, the file protected/views/ControllerID/edit.php will be rendered instead.
Sachy
(Sachin Mandalia)
February 3, 2015, 9:32pm
3
ok so in my init() method of the site controller , I have
$app = Yii::app();
$app->language = 'nl';
Which actually converts all the view files to dutch language. BUT! I am looking for something that translates the entire content the view file to selected language… not only attributes and labels…