Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a implicit fallback throws a warning in the console #1768

Closed
4 tasks done
jleifeld opened this issue Mar 19, 2024 · 1 comment · Fixed by #1798
Closed
4 tasks done

Using a implicit fallback throws a warning in the console #1768

jleifeld opened this issue Mar 19, 2024 · 1 comment · Fixed by #1798
Labels
good first issue Good for newcomers help wanted Extra attention is needed 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing Status: PR Welcome Welcome to Pull Request

Comments

@jleifeld
Copy link

Reporting a bug?

When using implicit fallback values it would make sense not to throw warnings because this is intended. Example:
You are using en-GB and en-US as languages. You don't want to have duplicated snippets for almost the same language. So you are using en for all these snippets like in this guide: https://vue-i18n.intlify.dev/guide/essentials/fallback.html#implicit-fallback-using-locales

But now you still get warnings that there is no snippet defined. For non-implicit fallbacks, e.g. jp to en, this makes sense. But for implicit fallbacks this should not be the case.

Expected behavior

No console warning should be thrown.

Reproduction

https://stackblitz.com/edit/vitejs-vite-4qtyea?file=src%2Fmain.js

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.3 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-vue: ^5.0.4 => 5.0.4 
    vite: ^5.1.6 => 5.1.6 
    vue: ^3.4.21 => 3.4.21 
    vue-i18n: ^9.10.2 => 9.10.2

Screenshot

No response

Additional context

No response

Validations

@jleifeld jleifeld added the Status: Review Needed Request for review comments label Mar 19, 2024
@kazupon kazupon added good first issue Good for newcomers help wanted Extra attention is needed Status: PR Welcome Welcome to Pull Request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing and removed Status: Review Needed Request for review comments labels Mar 21, 2024
@kazupon
Copy link
Member

kazupon commented Mar 21, 2024

Thank you for your feedback!

When using implicit fallback values it would make sense not to throw warnings because this is intended. Example:
You are using en-GB and en-US as languages. You don't want to have duplicated snippets for almost the same language. So you are using en for all these snippets like in this guide: https://vue-i18n.intlify.dev/guide/essentials/fallback.html#implicit-fallback-using-locales

That is make sense.
let's improve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing Status: PR Welcome Welcome to Pull Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants