Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use multiple translators when generating translations #1228

Closed
arne-s opened this Issue · 1 comment

3 participants

@arne-s

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

@cebe
Owner

@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
fee50f1
@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.