Yii Framework Forum: Use translations in JS - Yii Framework Forum

Jump to content

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

Use translations in JS Rate Topic: -----

#1 User is offline   wisp 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 192
  • Joined: 04-February 11

Posted 24 July 2012 - 03:16 PM

Translations are working fine server side, but they would also be useful clientside. We could make this happen by encoding a specified language and category to a json string and append it to the page. Then use a jquery plugin to translate strings within the code. The plugin knows the current language and is able to translate any string in realtime. We could use a function like Yii:t('my string') and have it translated into the current language.

Off course, the yiic translation tool should be able to recoginize the javascript translations while generating the translated files.
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