-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify language codes in the i18n file names. #395
Comments
Yeah this is a historical result of which languages folks decided to add translations for. And some of the translators decided to specify e.g. Brazilian Portuguese rather than just Portuguese. (I'm not an expert on Portuguese, so I deferred to the translator's judgment.) There is also some trickiness with "languages" with vastly different writing systems or vocabulary. Like we have |
BTW this would be a breaking change. Assuming what you're asking for is for all the language codes to just be the two-letter version and not the double ISO names? |
I think double ISO names are better. Broser variable window.navigator.language already contains double name (but with dash not underscore) this could be used directly to initialize language. |
You should differentiate here between language and locale. An iso language code is a two letter code like "de", "en" and so on. A locale code consists of a language and a country (region). This is needed to distinguish between countries and languages. As example english is spoken in multiple countries. So as example we have en-GN and en-US. If you now want to display special units for number values, there might be different rules for US and GB. Therefore a locale is needed here. If you only want to translate things without applying special rules to numbers or dates, ..., the two character language code is enough. Regarding a underscore or hyphen in locale codes. Based on RFC 4646 the hyphen is the standard. But codes with underscore are also used frequently. |
I think it would be better to use ISO language codes for all file names in emoji-picker-element/i18n/*.js so it would be easy to use with window.navigator.language. At this moment some of them has double ISO name like pt_BR, some not like: pl, en, etc.
The text was updated successfully, but these errors were encountered: