Groovy leverages Java's I18N features. Here is a Swing example using Dates, Numbers and Locales:
import groovy.swing.SwingBuilder import static javax.swing.JFrame.EXIT_ON_CLOSE as EXIT import static java.text.NumberFormat.getNumberInstance as numberFormat import static java.text.DateFormat.getDateInstance as dateFormat import static java.text.DateFormat.FULL def locales = [ new Locale("en", "US"), new Locale("ja","JP"), new Locale("iw","IL"), new Locale("hi","IN"), new Locale("th","TH","TH"), new Locale("de", "DE"), new Locale("es", "ES"), new Locale("zh", "CN"), new Locale("it", "IT") ] def swing = new SwingBuilder() int row = 0 def d = new Date() def frame = swing.frame(title:'Frame', size:[300,300], defaultCloseOperation:EXIT) { tableLayout { locales.each { loc -> tr { td { label(numberFormat(loc).format(++row)) } td { label(loc.toString()) } td { label(loc.getDisplayLanguage(loc)) } td { label(dateFormat(FULL, loc).format(d)) } } } } } frame.pack() frame.show()
Which should look something like this:

You can also use properties files to capture language strings. Using the LablesBundle.properties, LablesBundle.properties_de and LablesBundle_fr.properties files from this tutorial. We can then use this code:
def locales = [Locale.FRENCH, Locale.GERMAN, Locale.ENGLISH] def keys = ["s1", "s2", "s3", "s4"] [locales, keys].combinations().each{ loc, key -> def labels = ResourceBundle.getBundle("LabelsBundle", loc) println "Locale = ${loc.toString()}, key = $key, value = ${labels.getString(key)}" }
To produce this result:
Locale = fr, key = s1, value = Ordinateur Locale = de, key = s1, value = Computer Locale = en, key = s1, value = computer Locale = fr, key = s2, value = Disque dur Locale = de, key = s2, value = Platte Locale = en, key = s2, value = disk Locale = fr, key = s3, value = Moniteur Locale = de, key = s3, value = Monitor Locale = en, key = s3, value = monitor Locale = fr, key = s4, value = Clavier Locale = de, key = s4, value = Tastatur Locale = en, key = s4, value = keyboard






