Overview
// Mixins
i18n()
resourceService()
// Injection
property name="i18n" inject="i18n@cbi18n";
property name="resourceService" inject="resourceService@cbi18n"Your locale is #getFwLocale()#!
// localized button
#html.submitButton( $r( 'btn.submit' ) )#
// Localized string with replacements via arrays
#html.h2( $r(resource="txt.hello", values=[ "Luis", "Majano" ] ) )#
// txt.hello resource
txt.hello="Hello Mr {1} {2}! I hope you have an awesome day Mr. {2}!"
// Localized string with replacements via structs
#html.h2( $r( resource="txt.hello", values={ name="Luis", age="35" } ) )#
// txt.hello resource
txt.hello="Hello Mr {name}! You are {age} years old today!"
// Localized string from a bundle, notice the @cbcore alias
#$r( 'common.ok@cbcore' )#
// function change a user's locale
function changeLocale(event,rc,prc){
setFwlocale( rc.locale );
relocate( 'home' );
}Last updated
Was this helpful?