Guess of locale should be case insensitive
Hi, thank you for this helpfull module! I have a problem with the guess of the current locale: if I define locales in the "xx-XX" format (e.g. "en-GB") the guessLanguage function fails in guess the current locale when guessing from queryParam. I think it is due to the toLowerCase() operation performed on the locale, that prevent to find by key the locale in the locales array.
An odd workaround can be to set the fallbackLanguage option as an object like {"en-gb": "en-GB"}.
Is it possible to make the guessLanguage operation case insensitive?
Many thanks, eajimmy
(BCC: @xflofoxx)
will need to review #128 #255
@eajimmy Try passing option
i18n.configure(
{ preserveLegacyCase:false }
)
I believe this will give you the behavior you are looking for.