Created
December 12, 2011 20:40
-
-
Save sprohaszka/1468989 to your computer and use it in GitHub Desktop.
Create list of countries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def countries | |
Locale.availableLocales.each { locale -> | |
String iso = locale.getISO3Country() | |
String code = locale.country | |
String name = locale.displayCountry | |
if (iso && code && name) { | |
Address.@countries += [iso: iso, code: code, name: name] | |
} | |
} | |
countries.sort { a, b -> | |
return a.name.compareToIgnoreCase(b.name) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment