imcode.server
Class LanguageMapper
java.lang.Object
imcode.server.LanguageMapper
public class LanguageMapper
- extends java.lang.Object
- Author:
- kreiger
|
Constructor Summary |
LanguageMapper(com.imcode.db.Database database,
java.lang.String defaultLanguage)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ISO639_2
public static final java.lang.String ISO639_2
- http://www.loc.gov/standards/iso639-2/langhome.html
- See Also:
- Constant Field Values
LanguageMapper
public LanguageMapper(com.imcode.db.Database database,
java.lang.String defaultLanguage)
getCurrentLanguageNameInUsersLanguage
public java.lang.String getCurrentLanguageNameInUsersLanguage(UserDomainObject user,
java.lang.String documentLanguage)
createLanguagesOptionList
public java.lang.String createLanguagesOptionList(UserDomainObject user,
java.lang.String documentLanguage)
getAsIso639_2OrDefaultLanguage
public static java.lang.String getAsIso639_2OrDefaultLanguage(java.lang.String langStr,
java.lang.String defaultLanguage)
convert639_1to639_2
public static java.lang.String convert639_1to639_2(java.lang.String language)
throws LanguageMapper.LanguageNotSupportedException
- Parameters:
language - The iso-639-1 representation of the language, i.e. 'sv'.
- Returns:
- the iso-639-2 representation of the language, i.e. 'swe'.
- Throws:
java.lang.IllegalArgumentException - If an unsupported language is requested.
LanguageMapper.LanguageNotSupportedException
convert639_2to639_1
public static java.lang.String convert639_2to639_1(java.lang.String language)
throws LanguageMapper.LanguageNotSupportedException
- Parameters:
language - The iso-639-2 representation of the language, i.e. 'swe'.
- Returns:
- the iso-639-1 representation of the language, i.e. 'sv'.
- Throws:
java.lang.IllegalArgumentException - If an unsupported language is requested.
LanguageMapper.LanguageNotSupportedException
existsIsoCode639_2
public static boolean existsIsoCode639_2(java.lang.String isoCode639_2)
getDefaultLanguage
public java.lang.String getDefaultLanguage()