-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
Foolproofing and trigger error, when locale is not set. #1788
Comments
I'm not sure where See the component example on this page of the docs: https://vue-i18n.intlify.dev/guide/essentials/scope.html#global-scope-1 for reference. As for why it's possible to set the locale without it throwing an error, I'm not sure, perhaps there are use cases in which this would be fine? 😅 |
May be it is falling back to the first default language, right now I do not have 3 languages to test. It should at least write some console.log(...) or something. |
I have a question, when For example: export const SUPPORT_LOCALES = ["en", "ja", "cn"] as const;
export type SupportLocale = typeof SUPPORT_LOCALES[number];
async function loadLocaleMessages(i18n: I18n, locale: SupportLocale) {
const messages = await import(
`~/assets/_locales/${locale}.json`
);
i18n.global.setLocaleMessage(locale, messages.default);
return nextTick();
} I get the browser language setting through |
Clear and concise description of the problem
Quasar 2.x
In
src/boot/i18n.js
we havein
layouts/MainLayout.vue
we haveNotice that the select box has
en_US
but there is no such locale. There isen-US
.Suggested solution
Error should be triggered when user tries to set invalid, unavailable locale.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: