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.

Disable warnings for fallback to root locale

See original GitHub issue

vue & vue-i18n version

2.2.6, 6.0.0

Steps to reproduce

Use the example for component locales

What is Expected?

No warning in developer console

What is actually happening?

[vue-i18n] Value of key 'message.greeting' is not a string!
[vue-i18n] Fall back to translate the keypath 'message.greeting' with root locale.

My use case for component locales is as follows:

  • Commonly used words are global locales (firstname, lastname, …)
  • Each page in my SPA ships with its own component locales (benefits from code splitting: only load locales for the current page)
  • The page component uses both global and component locales

Right now I get warnings whenever I use a global locale. They go away when compiling for production, but it is still annoying as it interrupts the development process. Can you please provide a way to disable these warnings?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:32
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

29reactions
dnomakcommented, Nov 22, 2017

In case of someone need it

new VueI18n({
  locale,
  messages,
  silentTranslationWarn: true
})
25reactions
alexandremagrocommented, Jun 27, 2018

In my opinion, if fallbackRoot is false and value of key was not found, it’s should warning, and is returned the key, as documented.

If fallbackRoot is true, the warning should only be triggered if the key value is not found, neither in the current locale, nor in root locale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fallback localization | Vue I18n
To suppress the automatic fallback, add the postfix exclamation mark ! , for example de-DE! # Explicit fallback with one locale. Sometimes some ......
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 >
Avoid I18n Fallback to default locale - ruby on rails
My default locale is set to :at (Austria). Which I require for Route Translation. Rails server won't start without it and to be...
Read more >
[root tip] [How To] Troubleshooting locale errors - Tutorials
As root edit the file /etc/locale.gen; Enable the needed locales - including en_US.UTF-8 UTF-8 as fallback. Rebuild the locale database ...
Read more >
Locale settings are not right. How can I reset them? - Ask Ubuntu
Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. The locale command produces error messages locale: Cannot set LC_CTYPE...
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