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

feat: extend lazy loading #1801

Merged
merged 11 commits into from
Jan 21, 2023
Merged

feat: extend lazy loading #1801

merged 11 commits into from
Jan 21, 2023

Conversation

kazupon
Copy link
Collaborator

@kazupon kazupon commented Jan 19, 2023

resolve #1797

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.


This is useful because it is efficient to manage multiple files that define only differences without duplicating locale messages.

For example, let’s think for the case of Spanish language supporting. There are **79 Spanish-speaking countries** according to [wikipedia](https://en.wikipedia.org/wiki/Spanish_language)!
Copy link
Collaborator

@userquin userquin Jan 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

19 countries listed on ISO (official): only these https://github.com/elk-zone/elk/pull/1172/files#diff-fb2fd6012fe1954c1021496a3bc2260acb3878612e64f1e0dbdbf30862bbf8f8R93

There are also a few countries on what spanish was official but no rn: Filipinas for example

https://es.wikipedia.org/wiki/Anexo:Pa%C3%ADses_donde_el_espa%C3%B1ol_es_idioma_oficial

Copy link
Collaborator

@userquin userquin Jan 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still 79, it should be 19, read the article again, these are estimated people who speak Spanish in those countries: in Spain there are people who speak Japanese but in Spain Japanese is not official, you don't have to count Spain as countries speaking japanese ;)

Check Geographical distribution, it just mention 20 countries, you're using Spanish speakers by country entry.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upps (updated to 15), why showing changes shows previouws version?


In the above `es-AR` example, it has `es.json` and `es-AR.json` into `files`. In this case, @nuxtjs/i18n lazy-load `es.json`, and the it lazy-load `es-AR.json` and overrides for `es.json` locale messages.

In the example above, only two files are defined for `files`, ofcourse you can specify more files over 2 files. In that case, the files will be loaded and override in array order too.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wording: of course (space)

@kazupon
Copy link
Collaborator Author

kazupon commented Jan 20, 2023

@userquin
Thanks! I've updated docs from your feedback!

@kazupon kazupon mentioned this pull request Jan 21, 2023
4 tasks
@kazupon kazupon marked this pull request as ready for review January 21, 2023 12:44
@kazupon kazupon merged commit 045d7e6 into next Jan 21, 2023
@kazupon kazupon deleted the fix/1797 branch January 21, 2023 12:44
DarthGigi pushed a commit to DarthGigi/i18n that referenced this pull request Apr 16, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extend locale lazy-loading
2 participants