hbb20 / hbb20/CountryCodePickerProject

Using Java's own Locale data for region names

Ouverte
#302 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
1.5k
Forks
509
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Instead of having to duplicate and manually translate the region names and data with the raw xml files, Java's build-in Locale data could probably be used.

Current we are using a following trick to generate a list of localized country names for the user to select from:

// Code in Kotlin
```
Locale
.getISOCountries() // Fetch list of ISO 3166 country codes
.map { // Create a new Locale in users default language, but set country to X
it to Locale("", it).displayCountry // then extract the localized name of the country.
}
.toMap() // Turn into Map with ISO 3166 key and Localised country name as value
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.