Package org.ametys.cms.languages
Class LanguagesManager
- java.lang.Object
-
- org.ametys.cms.languages.LanguagesManager
-
- All Implemented Interfaces:
Component
,Configurable
public class LanguagesManager extends Object implements Configurable, Component
Handle possible languages
-
-
Constructor Summary
Constructors Constructor Description LanguagesManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration configuration)
Map<String,Language>
getAvailableLanguages()
Get the list of possible languagesList<Map<String,Object>>
getAvailableLanguagesAsJsonObject()
Get the list of available languages as a JSON objectLanguage
getLanguage(String code)
Get the language by its codeprotected Map<String,Object>
toJson(Language language)
Return the JSON representation of a language
-
-
-
Constructor Detail
-
LanguagesManager
public LanguagesManager()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getLanguage
public Language getLanguage(String code)
Get the language by its code- Parameters:
code
- The language code- Returns:
- The language or
null
if not found
-
getAvailableLanguages
public Map<String,Language> getAvailableLanguages()
Get the list of possible languages- Returns:
- the association language-code Language object
-
getAvailableLanguagesAsJsonObject
public List<Map<String,Object>> getAvailableLanguagesAsJsonObject()
Get the list of available languages as a JSON object- Returns:
- The available languages
-
-