Vue-i18n: data attributes aren't translated?

Created on 24 Aug 2016  路  6Comments  路  Source: kazupon/vue-i18n

Why isn't data-placeholder="{{ $t('path.to.key') }} being translated when all the other "translations" are working, is it because its a data attribute? Shouldn't those work as well?

Most helpful comment

I have solved this issue. Hope it will help you.https://jsfiddle.net/2av8r31w/3/

All 6 comments

It seems the problem is that a Vue directive to apply select2 (https://select2.github.io/) to a select box runs before the translation happens. Select2 picks up the value of data-placeholder before the translation occurs.

Any ideas how to fix this?

I tried with other values and they arent being processed either, so it isnt a vue-i18n issue. Closing and moving issue to vue.

hi,does this issue solved锛烮 have the same problem with you and look forward to your answer. thank you!

I have solved this issue. Hope it will help you.https://jsfiddle.net/2av8r31w/3/

I guess what @mygaochunming wrote, specifically the usage of v-bind, is something that should be inserted into the documentation, in case that this is the correct way of solving this issue.

Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darkylmnx picture darkylmnx  路  5Comments

zhangruinian picture zhangruinian  路  4Comments

abou7mied picture abou7mied  路  3Comments

shaunnetherby picture shaunnetherby  路  5Comments

jarikmarwede picture jarikmarwede  路  4Comments