public interface CockpitLocaleService
| Modifier and Type | Method and Description |
|---|---|
<T> T |
executeWithLocale(AbstractExecutionBody<T> executionBody,
Locale locale)
Using this method you can execute code in a context of a different locale than the current one
|
List<Locale> |
getAllLocales()
Returns a list of all available locales.
|
List<Locale> |
getAvailableDataLocales(String principal)
Returns a collection of available data locales (both enabled and disabled) for specified principal.
|
Locale |
getCurrentLocale()
Returns the currently active locale.
|
Locale |
getDefaultDataLocale(String principal)
Returns the default data locale for specified principal.
|
List<Locale> |
getEnabledDataLocales(String principal)
Returns a collection of enabled locales for specified principal.
|
boolean |
isDataLocaleEnabled(Locale locale,
String principal)
Checks if the given data locale is an active data locale for the given user.
|
void |
setCurrentLocale(Locale locale)
Changes the current locale to the given one.
|
void |
toggleDataLocale(Locale locale,
String principal)
Toggles the specified data locale.
|
Locale getCurrentLocale()
List<Locale> getAllLocales()
void setCurrentLocale(Locale locale)
Executions.sendRedirect(String) with null as a parameter to re-render the application.locale - the locale to be set as the current one<T> T executeWithLocale(AbstractExecutionBody<T> executionBody, Locale locale)
executionBody - the execution bodylocale - the localevoid toggleDataLocale(Locale locale, String principal)
locale - to toggleprincipal - needed to filter available cockpit localesAvailableLocaleException - when an attempt to toggle the cockpit
locale failed.List<Locale> getAvailableDataLocales(String principal)
AvailableLocaleException is thrown when an attempt to load the cockpit locales
failed.principal - needed to filter available cockpit localesAvailableLocaleException - when an attempt to load the cockpit
locales failed.List<Locale> getEnabledDataLocales(String principal)
AvailableLocaleException is thrown when an attempt to load the cockpit locales
failed.principal - needed to filter available cockpit localesAvailableLocaleException - when an attempt to load the cockpit
locales failed.Locale getDefaultDataLocale(String principal)
AvailableLocaleException is thrown when an attempt to load the cockpit locales
failed.principal - needed to filter available cockpit localesLocaleAvailableLocaleException - when an attempt to load the cockpit
locales failed.Copyright © 2018. All rights reserved.