How to use the function yii::t();
in js
files yii::t();
? For example, how to translate the "cancel" in this piece of js code:
"btn-primary cancel-comment'>Отмена</button><button type='button' class='btn "
The problem is only with the translation of js
files, in php
files - everything is ok.
Update
The trouble is that in this case there are no views, there are only js
files for modal windows with "close", "save" buttons and so on ... I am very weak in js
, therefore, if it does not complicate you, whether it is possible in more detail regarding the "similar" function on js
- an example of a thread or something.
yii::t()
? Customized? Inphp
files used? Is the problem only withjs
scripts or is the translation not configured at all? - Alexey Shimanskyjavascript
code in the views, then do the same as Usually<?= Yii::t('translateCatalog', 'translateTag'); ?>
<?= Yii::t('translateCatalog', 'translateTag'); ?>
- Alexey Shimansky