Package org.ametys.cms.languages
Class LanguagesManager
java.lang.Object
org.ametys.cms.languages.LanguagesManager
- All Implemented Interfaces:
Component
,Configurable
Handle possible languages
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) Get the list of possible languagesGet the list of available languages as a JSON objectgetLanguage
(String code) Get the language by its codeReturn the JSON representation of a language
-
Field Details
-
ROLE
The component role
-
-
Constructor Details
-
LanguagesManager
public LanguagesManager()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getLanguage
Get the language by its code- Parameters:
code
- The language code- Returns:
- The language or
null
if not found
-
getAvailableLanguages
Get the list of possible languages- Returns:
- the association language-code Language object
-
getAvailableLanguagesAsJsonObject
Get the list of available languages as a JSON object- Returns:
- The available languages
-
toJson
Return the JSON representation of a language- Parameters:
language
- The language- Returns:
- The json object representing the language
-