kalessil / yii2inspections

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[dev] craft\web\View::registerTranslations('category', ['', ...])

kalessil opened this issue · comments

  • Apply "Translation message correctness" inspection to the translations array
  • Register translations from the array as used while indexing

@samdark: does anything like this exist in Yii2?

No, not really. That's custom.

Yeah Yii doesn't have a major front-end framework built in (nor should it), so it doesn't need to worry about how to register translation messages for Javascript use.

Feature description:

If the project contains a craft\web\View class, the plugin should find calls to its registerTranslations() method, and index each of translation messages passed into the $messages argument (array), with the $category argument (string) as the translation category.