-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
extend locale lazy-loading #1797
Comments
The main problem is the locale (we need it, we cannot use a generic locale), I mean, the html lang tag and
About messages duplication: |
I think we can configure those to
for arabic, sorry, I’m not familiar with that language. sorry, could you please give me some more detail explanation? 🙏 |
My previous comment was just to justify the PR. Just check i18n module https://github.com/elk-zone/elk/blob/main/config/i18n.ts: rn we're using only About arabic, check the script we've in Elk contributing.md file, if we use |
[1, 12, 123, 1234, 12345, 123456, 1234567].forEach((n) => {
const acc = {}
Array.from(['ar-EG', 'ar']).forEach((l) => {
const nf = new Intl.NumberFormat(l, {
style: 'decimal',
maximumFractionDigits: 0,
})
const nf2 = new Intl.NumberFormat(l, {
notation: 'compact',
compactDisplay: 'short',
maximumFractionDigits: 1,
})
acc[l] = {
number: n,
format: nf.format(n),
compact: nf2.format(n),
}
})
console.table(acc)
}) |
Thanks! I appreciate your kindful explanation. I’m working at #1801. |
The only thing I need confirmation is that a module is generated per language with the overwritten messages: for Spanish surely there will not be too many messages to overwrite, but for other languages (Arabic) surely yes |
In That PR, it's generated by the bundler (vite) for per language. |
Thx man: we've also some problems with i18n module and ts types overriden #1711 (should also be included in the new beta 8?) |
* feat: extend lazy loading resolve nuxt-modules#1797 * feat: extend lazy loading resolve nuxt-modules#1797 * update nuxt module * update playground * remove settings * add docs * update docs * update docs * update testing * docs: tweak
Describe the feature
describe
Currently, lazy-loading loads the locale messages specified in the i18n.locales file.
BCP47 supports language tags such as language - script - region - variant - extension - privateuse.
https://en.wikipedia.org/wiki/IETF_language_tag
If you define locale messages as resources in a file according to that specification, there is a possibility of duplication.
For example,
en-US
anden-GB
have the same language, just different regions.In that case, most resources would be the same.
For convenience in managing resources for locale messages, it would be useful to have a mechanism to define resources only for the difference of region and variant and to be able to load them lazily.
usecase projects
elk-zone/elk#1172
more details for this feature request
https://discord.com/channels/1044887051155292200/1045783579520684062/1063952424764719154
Additional information
Final checks
The text was updated successfully, but these errors were encountered: