-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
No support for xx-xx style locale codes (en-US, zh-TW etc.) #854
Comments
Here are the most common locales, widely supported by systems and platforms out there:
|
I need to find a list of all ISO 639-1 (xx) and 639-2 (xxx) but with an appropriate native language name. Then I also need to cross correlate this with a list of locale-based names (en-GB, en-US, zh-CN, zh-TW, etc) but these need to have appropriate native names too. This is not easy to find! Links to info I've found far: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes So far i've been able to find resources to ISO 639-1 and 639-2, but nothing to locale-based names with native languages. |
Ok this is closest so far: https://github.com/jlongster/php-product-details/blob/master/localeDetails.class.php |
I've released an update for this plugin that causes the languages to be displayed with suffix in parens:
This is not the final solution. A proper update to the array with more local languages is the ideal solution, but this will at least work for the time being. |
Fixed for next Grav release: d7f286f |
@rhukster could you also add support for |
Hi @rhukster , is it possible to add custom languages not defined into LanguageCodes.php without editing the core? |
I discovered this issue when I was playing around with langswitcher plugin. I noticed that
xx-xx
style locales doesn't show up on front-end and after further investigation in this topic @rhukster pointed me to this:Grav\Common\Languages\LanguageCodes::getNames()
only knows how to lookupxx
style language codes. This would have to be improved to supportxx-xx
styles too.https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Language/LanguageCodes.php
The text was updated successfully, but these errors were encountered: