lajax / yii2-translate-manager

Translation Manager
MIT License
227 stars 89 forks source link

Dynamic php variables not working #142

Closed roshan2014rishu closed 3 years ago

roshan2014rishu commented 3 years ago

I am adding translation and I have to use dynamic category names in the place of static category names. When I scan it doesn't show any new translation added. $category = "myApp"; Yii::t($category, 'My Translation message');

gs63875 commented 3 years ago

@lajax @moltam facing same issue any solution?

moltam commented 3 years ago

In short, this is not supported.

The scanner analyses your code statically, it cannot evaluate dynamic expressions. If your category depends on some condition that is evaluated at runtime, the scanner cannot detect it, as it would need to run your code.