(Quick Reference)

5.6.6 Application Locale - Reference Documentation

Authors: Andres Almiray

Version: 1.2.0

5.6.6 Application Locale

Starting with Griffon 0.9 applications have a bound locale property that is initialized to the default Locale. Components can listen to Locale changes by registering themselves as PropertyChangeListeners on the application instance.

The value of this property can be changed at any time. Doing so will also update the value of the default Locale used in the currently running JVM process.

You may specify a configuration flag in Application.groovy that can be used as the initial value for this property, like this

application {
    title = 'Sample'
    startupGroups = ['foo']

locale = 'es

// Should Griffon exit when no Griffon created frames are showing? autoShutdown = true

// If you want some non-standard application class, apply it here //frameClass = 'javax.swing.JFrame' }

This flag accepts instances of java.util.Locale or java.util.String with the following formats:

  • language
  • language_country
  • language_country_variant