Skip to content Skip to sidebar Skip to footer

How To Translate Text Using Gettext In Vue?

I have many component which contain static texts, I would like to translate these text from polish language to english language and vice versa using gettext plugin. Here is how tex

Solution 1:

I searched about vue-gettext and from the documentation here: https://vuejsexamples.com/translate-your-vue-js-applications-with-gettext/, you can translate a text by using the translate component:

<translate>Hello!</translate>

or using the v-translate directive:

<span v-translate>Hello!</span>

I don't see the use of having the __ in your code, unless you have a function for that. I think this would work already:

<h1 v-translate>Mail kontaktowy</h1>

Post a Comment for "How To Translate Text Using Gettext In Vue?"