Yii Framework Forum: Use multiple translators when generating translations - Yii Framework Forum

Jump to content

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

Use multiple translators when generating translations Rate Topic: ***** 2 Votes

#1 User is offline   wisp 

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

Posted 13 August 2012 - 11:38 AM

I'm working on an extension that can use Yii translations in javascript. I've stumbled across one problem: Yii uses Yii::t as translator, but in javascript I have to use Yii.t. Since the translator property of MessageCommand only accepts one translator (it's a string) I can't use one config to scan all my translations. The workaround is to use a separate config for JS and PHP, but then you can't share the same translation files between PHP and JS. They would override each others translations during generation of the translations in yiic.

The simplest solution is to change the translator property from a string to an array, and make it accept multiple translations, this doesn't break backwards compatibility and adds the feature of being able to scan multiple languages (PHP, JS, templates, etc).

Is this something worth considering? I could make a pull request for it.
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 519
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 14 August 2012 - 03:20 PM

Sounds like a nice feature, you can create an issue on github for it.
0

#3 User is offline   wisp 

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

Posted 14 August 2012 - 04:00 PM

Done https://github.com/y...yii/issues/1228
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