Open matchdav opened 4 years ago
These conventions include:
o [ISO639-1] recommends that language codes be written in lowercase ('mn' Mongolian).
o [ISO15924] recommends that script codes use lowercase with the initial letter capitalized ('Cyrl' Cyrillic).
o [ISO3166-1] recommends that country codes be capitalized ('MN' Mongolia).
We enforce the ISO recommendations
That doesn't make sense, you're not enforcing anything. No errors are thrown. It's silent failure.
In any case, the ISO is a recommendation whereas the above is a spec; the recommendation is for human readability, not how the headers are handled over the wire.
consistent formatting and presentation of language tags will aid users.
This is basically my code should run even if it fails linting.
Seems we talk about different things...i18next gets something passed in as locale from a detector (I did not write them all myself - so not sure what you refer too) -> it uses that and reformats it to ISO recommendation -> further uses that to lookup paths in the backend (which needs some sort of agreed case sensitivity)...
so I'm not sure what you like to change? but I guess it's only the detector for header?!? That would mean to change the regex here https://github.com/i18next/i18next-express-middleware/blob/master/src/languageLookups/header.js#L16
From the RFC spec
So for example,
eS
should resolve toes
https://tools.ietf.org/html/rfc5646#section-2.1
I would submit a patch for this but I'm not sure where the final value is set