Open dariuszdawidowski opened 10 months ago
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 zh_CN
but if we had traditional Chinese or Cantonese it would probably look very different.
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?
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.