jquery.i18n icon indicating copy to clipboard operation
jquery.i18n copied to clipboard

Fallbacks fail with uppercase locale tags

Open arvola opened this issue 8 years ago • 2 comments

The fallbacks are all defined in lowercase, but a lot of browsers report the locale with uppercase region. For example, the browser is reporting zh-TW, which should fall back to zh-hant. However, because it doesn't match zh-tw in the fallbacks file, it uses en instead.

The standard as far as I know is that the tags should be case insensitive (https://tools.ietf.org/html/bcp47), so it should correctly fall back regardless of the input case.

For now, I'm just forcing the locale to lowercase, which resolves this issue, but it should probably be fixed in the library itself.

arvola avatar Dec 14 '16 00:12 arvola

Agreed; zh-TW on my cordova app in chrome displays zh, which is better than falling back to en, but still shows that the upper-case problem is happening, since it should fall back to zh-hant. So I guess it recognizes the zh part but fails to parse the TW part since it's in uppercase.

zhengzheli avatar Jun 18 '19 02:06 zhengzheli

(CC self)

winstonsung avatar Jun 11 '23 10:06 winstonsung