Hi,
I'm new to groovy and I need to show in a combo box some values for setting up the language for my app. The current structure looks like this:
def countries = ["Bulgarian": ["Bulgaria": "bg-BG"],
"Chinese (Simplified)": ["China": "zh-CN", "Hong Kong": "zh-HK", "Taiwan, Province of China": "zh-TW"],
"Dutch": ["Belgium": "nl-BE", "Netherlands": "nl-NL"]]
I'd like to show this in my combo box:
Bulgarian - Bulgaria (bg-BG)
Chinese (Simplified) - China (zh-CN)
Chinese (Simplified) - Hong Kong (zh-HK)
Chinese (Simplified) - Taiwan, Province of China (zh-TW)
Dutch - Belgium(nl-BE)
Dutch - Netherlands(nl-NL)
My code looks like this but it's wrong:
def countriesList = [:] | |
---|---|
countries.each { countriesList << [${it.key}: it.value]} |
Anyone has an idea how I can get it right?