-
Notifications
You must be signed in to change notification settings - Fork 463
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
refactor!: vueI18n
options from config path
#1973
Conversation
src/gen.ts
Outdated
// }` | ||
// genCodes += ` ${rootKey}.${key} = await ${optionLoaderVariable}(context)\n` | ||
genCodes += ` ${rootKey}.${key} = ${vueI18nConfigPath != null ? 'vueI18nOptions' : {} }\n` | ||
genCodes += ` if (${rootKey}.${key}.messages) { console.warn("[${NUXT_I18N_MODULE_ID}]: Cannot include 'messages' option in '${value}'. Please use Lazy-load translations."); ${rootKey}.${key}.messages = {}; }\n` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MEMO(TODO):
If we have messages
options, we must pre-compile the resource using dynamic import & bundler (virtual module) at i18n.options.mjs
(gen.ts
). This is because, in production, vue-i18n assumes that the resource is pre-compiled.
Minor future task: allow configuration from |
* docs: mention callbacks * chore: initial commit * chore: progress * chore: updating minor bits and tests * refactor!: `vueI18n` options from config path * fix: complete config load implementation * updates * fix: unit tests * fix: e2e testing * update lock file * tweak docs --------- Co-authored-by: Inesh Bose <2504266b@student.gla.ac.uk>
π Linked issue
closes #1948
β Type of change
π Description
ref: #1948
π Checklist