Class FormLanguageHelper
java.lang.Object
de.xima.fc.gui.designer.form.utils.FormLanguageHelper
Helper methods related to the languages available for a form.
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptioncreateAdditionalLanguages(Locale locale) static List<javax.faces.model.SelectItem>createCombinedLanguages(Locale locale, FormDesignerLanguageModel model) createDefaultLanguages(Locale locale, Mandant client) createExtraFormLanguagesMap(Locale locale, FormPersist persist) createFormLanguagesMap(Locale locale, String persistJson) static StringcreateLocaleDisplayName(Locale locale, String tag)
-
Method Details
-
createAdditionalLanguages
- Parameters:
locale- Locale to use for the display name of the languages.- Returns:
- A map with additional languages available on the system. The key is the language tag, the value is the display name of the language.
-
createCombinedLanguages
public static List<javax.faces.model.SelectItem> createCombinedLanguages(Locale locale, FormDesignerLanguageModel model) - Parameters:
locale- Locale to use for the display name of the languages.model- Form language model to use.- Returns:
- A list with select items representing all languages from the given form model that can be selected in the UI.
-
createDefaultLanguages
- Parameters:
locale- Locale to use for the display name of the languages.client- Client scope for the I18N variables.- Returns:
- A map with all languages from the I18N variables of the given client. Key is the language tag, the value is the display name of the language.
-
createExtraFormLanguagesMap
- Parameters:
locale- Locale for the display name of the locales.persist- A form persist with the form metadata and the items.- Returns:
- A map with all languages from the given persist JSON. The key is the language tag, value the display name.
-
createFormLanguagesMap
- Parameters:
locale- Locale for the display name of the locales.persistJson- A form persist JSON.- Returns:
- A map with all languages from the given persist JSON. The key is the language tag, value the display name.
-
createLocaleDisplayName
- Parameters:
locale- Locale with the language in which to render the language tag.tag- A language tag to process.- Returns:
- The display name of the given language tag, e.g.
German - Germany (de-DE).
-