THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
The PersistentLocale service can be used to programmatically override the locale. Note: You should be careful to only set the persistent locale to a supported locale.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@Inject private PersistentLocale persistentLocale; void onActionFromLocaleToggle() { if ("en".equalsIgnoreCase(persistentLocale.get().getLanguage())) { persistentLocale.set(new Locale("de")); } else { persistentLocale.set(new Locale("en")); } return this; } public String getDisplayLanguage() { return persistentLocale.get().getDisplayLanguage(); } |
...