Language tags used in `locales`
Environment
- Operating System:
Darwin - Node Version:
v18.15.0 - Nuxt Version:
- - CLI Version:
3.9.0 - Nitro Version:
- - Package Manager:
unknown - Builder:
- - User Config:
- - Runtime Modules:
- - Build Modules:
-
Reproduction
https://github.com/nuxt-modules/i18n/blob/6394a48c0d349c24d4005d490df7ce1b6d3a17c3/docs/content/3.options/2.routing.md?plain=1#L40-L42
Describe the bug
The name iso here is not quite accurate and I think it can be changed to something like language. If it is too late to update it due to backward compatibility concerns, at least the description in the docs here can be updated.
Both navigator.language(s) and Accept-Language refer to BCP 47 and the IANA Language Subtag Registry, which is based on underlying standards, including the various parts of ISO 639 (639-1, 639-2, 639-3, etc.), ISO 15924 script codes, ISO 3166, and UN M.49 region codes.
Additional context
Related information:
- https://www.w3.org/International/questions/qa-choosing-language-tags.en.html
- https://www.w3.org/International/articles/language-tags/index
- https://www.w3.org/International/questions/qa-accept-lang-locales.en.html
- https://www.w3.org/TR/international-specs/#lang_values
Logs
No response
I think iso certainly is a mistake from a specification standard. but, nuxt i18n v8 is RC, we cannot do breaking changes can be made.
I think it would be better to put the details in the documentation, and then add language or lang while keeping iso compatibility.
We can probably add language as a sort of 'alias' for iso after stable v8 release and fully deprecate/replace iso at some point for v9.
I remember having a hard time finding (or reading) docs describing the standards, using correct/common terminology and referencing the relevant information will definitely help me and other devs out!