Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Use multiple translators when generating translations #1228

arne-s opened this Issue · 1 comment

3 participants


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).

Pull request is here: #1229


@Arne-S you can link issues on github like this to auto create a backlink on the other side: #1229

@samdark samdark referenced this issue from a commit
@samdark samdark Enh #1228: Added ability to MessageCommand to generate translation fi…
…les for multiple functions
@samdark samdark was assigned
@samdark samdark closed this
@klimov-paul klimov-paul referenced this issue from a commit in klimov-paul/yii
@klimov-paul klimov-paul Unit test case for issue #1228 has been added. 1dde759
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.