Yii Framework Forum: Internalization - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Internalization Convert the Yii model to desired language

#1 User is offline   Hema Baskaran 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 19-August 13

Posted 19 August 2013 - 07:56 AM

Hi All,

I need to convert the whole portal to desired language.Configuration are completed and internalization are working fine.I need a suggestion how to convert the list of values(dropdown values are fetched from model files using custom function) into desired language?

Note:We are using database for translation.

Thanks,
Hema
0

#2 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 488
  • Joined: 08-October 12
  • Location:Austria

Posted 13 November 2013 - 08:54 AM

View PostHema Baskaran, on 19 August 2013 - 07:56 AM, said:

Hi All,

I need to convert the whole portal to desired language.Configuration are completed and internalization are working fine.I need a suggestion how to convert the list of values(dropdown values are fetched from model files using custom function) into desired language?

Note:We are using database for translation.

Thanks,
Hema


I hope you are using messages folder for internalization..

In resoursebundle

messages/english.php
return array(
'Gut'=>'Good'
);


In controller
yii::t('english','Gut') --> Good


In controller

after fetching the dropdown items from databases...
just pass that value to yii::t('english',array value) and store the value in another array ...problem solved
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users