The Vaadin Wiki is temporarily in read only mode due to large recent spam attacks.

Coding

Vaadin on Grails - Localization

WARNING: This wiki page was last edited over a year ago and might be outdated.

Versions used in this tutorial: Grails 2.3.x, Vaadin 7.1.x. News and updates about Vaadin on Grails are available on VaadinOnGrails. This is continuation of Vaadin on Grails - Database access

Localization property files are stored in

grails-app/i18n
folder.

In order to access the values in from the localized property files, use

Grails.i18n()
method.
Grails
class is provided by the plugin.

Here are various ways how to use i18n method:

import static com.vaadin.grails.Grails.i18n
import static java.util.Locale.ENGLISH

String label = i18n("default.home.label")

String homeEng = i18n("default.home.label", ENGLISH)

Object[] newItemArgs = ["Proper label to be shown"] String newItem = i18n("default.home.label", newItemArgs)

String newItemEng = i18n("default.home.label", newItemArgs, ENGLISH)

String newItemEngDef = i18n("do.not.exist", newItemArgs, "Default label for {0}", ENGLISH) }}}

Now you can continue with Vaadin on Grails - Multipole UIs

0 Attachments
6151 Views
Average (1 Vote)
Comments