cbi18n
Search…
How do I change Locales?
Well, it would not make any sense to use i18n for just one locale, would it? That is why you need to be able to change the application's locale programmatically. You can do this in two ways:
  1. 1.
    Using the i18n mixin method setfwLocale().
  2. 2.
    Using the i18n service setfwLocale().
Below you can see an example:
1
function changeLocale( event, rc, prc ){
2
setFWLocale( rc.locale );
3
relocate('main.home');
4
}
Copied!
Or use via injection
1
component{
2
3
property name="i18n" inject="[email protected]";
4
5
function changeLocale(){
6
i18n.setFWLocale( 'en_US' );
7
}
8
9
}
Copied!
Last modified 10mo ago
Copy link
Edit on GitHub