Show Navigation


Render all Grails i18n messages to Javascript

Owner: salex772 | 0.4.2 | May 26, 2016 | Package | Issues | Source | License: Apache-2.0

dependencies {
    compile 'org.grails.plugins:i18n-javascript:0.4.2'


Render all Grails i18n messages to Javascript

This plugin includes

  • i18nService to get all messages from messageSource bean
  • i18nJs taglib to render in GSP
  • I18nJsController to get JSON object in Javascript app


Add to build.gradle

dependencies {
     compile "org.grails.plugins:i18n-javascript:0.4.2"


In application.groovy add config with desired including and excluding prefixes

i18nJs {
    prefixInclude = [

    prefixExclude = [
        'default', 'other'

So 'i18nJs.page1.header' will be rendered whereas 'default.home.label' will not. Without this all items from wiil be in JS

Get messages

In GSP use


to render all messages in output HTML

Or make request to /I18nJs/getMessages within AJAX call.