Open cingaldi opened 4 years ago
I think this is actually already implemented. Let me check and get back to you in a few hours
Otherwise it should be rather easy to implement.
Thank you so much! I've seen this line and after inspection seems that does the job.Right?
Yepp. Exactly. You can set a fallback locale with $i18n.fallback(locale)
inside a component or Vue.i18n.fallback(locale)
when accessing the module directly.
The chain to find a translation message is actually like this:
de-ch
de
onTranslationNotFound
and use the respective response message if one is returned. This can be used to asynchronously fetch missing translationsHope this clears things up a bit. We are still working on version 2 of the library with better documentation and more features (such as «embedded components»), but will probably hold it off until vue 3.0 is available.
Hi,
I was looking for a way to set a fallback language when a translation is not found. Instead of adding a default value for each $t() , our workflow is to add a new string to the en.json file and then wait for the translator that sends back all updated language JSONs. This could save time because the developer adds a new string once (In default language JSON) instead of twice (in $t() and language JSON). I have in mind something like
Is it easy implementable?