Answer the question
In order to leave comments, you need to log in
How to not show element if no translation exists (i18n with Vue/Nuxt)?
Question about vue-i18n
either module nuxt-i18n
If the data translation does not exist, how to show nothing at all?
Just turning it off fallbackLocale
still shows the name of the key, instead of the data.
For example
This exists only in English. If I switch to another language the browser shows me the . What the hell, damn it? I don't want to show anything.
Is there a way to check if a translation exists? But this is also a bad option, to cling to each element with localization looks like complete idiocy. <h3>{{ $t('anotherMessage') }}</h3>
anotherMessage
v-if
Answer the question
In order to leave comments, you need to log in
But this is also a bad option, cling v-if to each element with localization looks like complete idiocy.
v-if="'anotherMessage' in $i18n.messages[$i18n.locale]"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question