I’d like to develop a Yii2 reusable component, but it has substential feedback strings that need js representation.
So what is the best practice inside yii2?
Shall I create a view that creates a js object with all strings for a language with Yii::t()?
Shall I create a set of js files, one per language, very much like Yii2 message files?
I’d prefer to avoid one of those js i18n package if possible. (I think that you don’t actually need one.)
Most Yii2 extensions that have similar needs often rely on the i18n coming with the js/jquery extension they expose in yii2. (For example, look at the numerous datepicker extensions.)
Thanks for your advices.