-
Notifications
You must be signed in to change notification settings - Fork 5
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
Extend Language to ISO 639-3 codes #29
Comments
we have 186 entries now and use Locale to retrieve an english and native title. |
The official list has only english titles: https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3.tab |
I've quickly tried an extended enum and its not gonna work. Compilation error "Java code too large" |
This will be covered in #51 |
Proposal: Use This seems to support pretty much everything, and moves the question of what values should be allowed to the classes. "Website language" might need 6+ constants defined, "User language" would need a list of living languages, and checklists can record any language -- it's up to the parser to decide what to do with new Locale.Builder()
.setLanguage("zh").setScript("Hant").build().toLanguageTag()
→ "zh-Hant"
new Locale.Builder()
.setLanguage("es").setRegion("419").build().getDisplayName()
→ "Spanish (Latin America and the Caribbean)"
// All the bits for Locale("en", "GB"):
en_GB
en
English
英文 // getDisplayLanguage(Locale.SIMPLIFIED_CHINESE)
GB
United Kingdom
English (United Kingdom)
eng
// (no script)
en-GB // toLanguageTag() |
I've run all the Crowdin language through All the GBIF Language enumeration values parse fine. |
I'll try |
Based on gbif/checklistbank#73 we need to deal with more languages than the current enum based on ISO 639-2 codes holds. The simplest option would be to extend the Language enum with all ~7700 codes and store both 2 and 3 letter codes as enum properties. But is a large enum like this still a good idea? Enum values are only initialised when they are first used, so should not be a JVM issue
The text was updated successfully, but these errors were encountered: