Skip to end of metadata
Go to start of metadata

Description

Enables localization of messages using Spring's MessageSource.

Installation

The current version of griffon-i18n-plugin is 0.4.1
To install just issue the following command

Usage

This plugin creates a suitable instance of a MessageSource and attaches it to the application using the messageSource property name (it is also aliased to i18n). MessageSource's API has been enhanced to accept a List of arguments (not just Object[]) and the application's Locale as default if non is specified. The following list enumerates all methods that you can call on this MessageSource object when running with Griffon:

Original

  • getMessage(String code, Object[] args, String defaultMessage, Locale locale)
  • getMessage(String code, Object[] args, Locale locale)l
  • getMessage(MessageSourceResolvable resolvable, Locale locale)

Enhancements

  • getMessage(String code, String defaultMessage, Locale locale)
  • getMessage(String code, String defaultMessage)
  • getMessage(String code, List args, String defaultMessage, Locale locale)
  • getMessage(String code, List args, Locale locale)
  • getMessage(String code, Object[] args, String defaultMessage)
  • getMessage(String code, Object[] args)
  • getMessage(MessageSourceResolvable resolvable)
  • getMessage(String code, List args, String defaultMessage)
  • getMessage(String code, List args)
  • getMessage(String code)

These methods are also added to the current application instance via metaclasses. The file griffon-app/i18n/messages.properties will be picked by default. You may add more files but you must specify their inclusion in griffon-app/conf/Config.grooy by using griffon.i18n.basenames flag

Application.groovy

The previous config flag instructs the application to search for foo.properties, bar.properties and message.properties. The file messages.properties will be configured always, no need to specify it.

History

Version

Date

Notes

0.4.1

10-21-11

Release sync with Griffon 0.9.4

0.4

07-05-11

Release sync with Griffon 0.9.3-beta-2

0.3.1

04-01-11

Added more methods

0.3

12-21-10

Release sync with Griffon 0.9.2

0.2

07-22-10

Release sync with Griffon 0.9

0.1

03-01-10

Initial release

  • No labels