Closed olliechick closed 1 year ago
Why not use a tms that has full support for i18next, like locize.com, and at the same time you support the future of i18next? You already said it, the browser uses the locale standard BCP 47 (https://www.i18next.com/how-to/faq#how-should-the-language-codes-be-formatted)
My company is already using Transifex and it would be difficult to move off it
In the meantime, as a workaround, I have reimplemented all the detectors from https://github.com/i18next/i18next-browser-languageDetector/tree/master/src/browserLookups but changed them to do the mapping of -
to _
.
v7.1.0
🚀 Feature Proposal
Add the ability to specify a mapping function.
Motivation
To allow customising the language code before returning it.
Example
Using Transifex, language codes need to use underscores (e.g.
en_US
), not dashes (e.g.en-US
), but browsers set the language code with dashes. To get around this, it would be good to be able to specify a function that replaces dashes with underscores.