question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fall back to root locale?

See original GitHub issue

@kazupon When changing $i18n.locale at a component, it doesn’t update the root locale. So when a key is not found in the component, the translation falls back to the root which can have a different locale.

To solve this issue, should the root locale be updated when setting $i18n.locale? Or should the locale in _t() be passed to t() so the same locale is used for fallback to root?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
aligajanicommented, Dec 25, 2018

This works this.$root.$i18n.locale

0reactions
sudhir600commented, Apr 23, 2018

I am facing the same issue. Here is my work scenario. when my page load 1st time, it will be in English (that’s working fine) now lets say i change the locale to ‘de’ and refresh the page. whats happening here is that, my page is being load in English 1st and then less then in second it updating in ‘German’. So its looking really a bug.

My setup -

 "dependencies": {
    "vue-i18n": "^7.6.0"
}

added i18n in plugin folder and then initialized in nuxt.config.js as below-

plugins: [  { src: '~/plugins/i18n.js'} ],
vendor: ['vue-i18n']

I don’t know where i m doing wrong. @kazupon @cslee Please suggest.

See this output - https://user-images.githubusercontent.com/4952560/39049618-dad49b26-44bf-11e8-8b6b-26b47b6bbae9.gif

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable warnings for fallback to root locale #139
My use case for component locales is as follows: Commonly used words are global locales (firstname, lastname, .
Read more >
Fallback localization | Vue I18n
If a locale is given containing a territory and an optional dialect, the implicit fallback is activated automatically.
Read more >
Root locale and fallback
Issues. ULocale#getFallback() never get to ULocale. ROOT (ticket#6673), instead, the final locale is empty locale (new ULocale("")), then null.
Read more >
Falling back to the standard locale - Solution - Linux Tutorials
Debian-based and Ubuntu solution · First make sure that you have the locales package installed: $ sudo apt update $ sudo apt install...
Read more >
Fallbacking - Vue I18n - Intlify
If a locale is given containing a territory and an optional dialect, the implicit fallback is activated automatically.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found