Language Selector
Dependency:
compile "org.grails.plugins:lang-selector:0.3"
Summary
Installation
grails install-plugin lang-selector
Description
Introduction.
This plugin provides a simple to use tag, to display flags for countrys of the languages your application supports, that when clicked, changes the language of your application using the i18n support provided by Grails.Provided by the plugin:- Flag icons 16x16 pixels from FamFamFam
- Installation
- Description
- ScreenShots
- Tips&tricks
Usage.
Add the next tag to your gsp.<langs:selector langs="es, en, en_US, pt_BR, pt, pt_pt"/><langs:selector langs="es, en, en_US, pt_BR, pt, pt_pt" url="${createLink(action:'list', controller:'libro', params:[paramun:123]) }"/><langs:selector langs="es, en, en_US, pt_BR, pt, pt_pt" default="es" />
<langs:resources ></langs:resources>
Configuration.
Optionally you can add this property to the Config.groovy to tell the plugin which flag display for the language. By default has the value shown below. Its a map that in the keys are the languages and the values are the countrys.com.mfelix.grails.plugins.langSelector.lang.flags = ["es":"es", "en":"gb", "fr":"fr", "da":"dk", "de":"de", "it":"it", "ja":"jp", "nl":"nl", "ru":"ru", "th":"th", "zh":"cn", "pt":"pt" ]
Tips&tricks
- The i18n support its executed in a filter attached to all controllers in your app, so in order to get it working in "/", you have to point it to a controller in the urlMappings file.
"/"(controller:"oneController", action:"oneAction")
Plugin history
- 2011-02-02 - version 0.3
- Added "default" param, to set the default flag to be highlighted.
- 2010-10-20 - version 0.2
- Fixed bug in generated url when it had params, added url param
- 2010-09-04 - version 0.1.1
- Bug fixed - some missing trim()
- 2010-08-27 - version 0.1
- First release