Vaadin 7 on Grails 2.x
  • Introduction
  • Project setup
    • Command Line
    • IntelliJ IDEA
    • Eclipse
    • NetBeans
    • Plugin Configuration
    • Clean up
    • Best Practices
  • Database
    • GORM
      • Create Domain Model
      • Transactions
      • LazyInitializationException
      • Open Session In View I.
      • Open Session In View II.
      • Table Container
    • Groovy SQL
      • Create Sql
      • Execute SQLs
    • MyBatis
      • Configuration
      • Basics
    • JdbcTemplate
      • Create Beans
      • Usage
    • Clean Up With Alternatives
  • Architecture
    • Model View Presenter
  • Spring Autowiring
    • Create Simple Application
    • Application With Navigator
  • UI
    • Re-using GORM Validations
    • Async Push
    • Multiple application
    • SASS Compilation
    • Widgetset Compilation
  • Spring Security
    • Spring Security Dependency
    • Spring Security Basics
    • Secured Navigator
  • Localization
    • Localization Basics
    • Custom MessageSource
  • REST
    • Without using root URL
    • Using root URL for Vaadin app
  • Plugin development
    • Github
    • Development
Powered by GitBook
On this page

Was this helpful?

  1. Localization

Localization Basics

PreviousLocalizationNextCustom MessageSource

Last updated 5 years ago

Was this helpful?

Example code is available on .

Localization property files are stored in grails-app/i18n folder.

Localization 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)
github.com/vaadin-on-grails/localization-basics