Package net.sf.okapi.common
Class LCIDUtil
- java.lang.Object
-
- net.sf.okapi.common.LCIDUtil
-
public class LCIDUtil extends Object
Converts Microsoft's LCID to Okapi LocaleId back and forth.
-
-
Constructor Summary
Constructors Constructor Description LCIDUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<net.sf.okapi.common.LCIDUtil.LCIDDescr>getDescriptors()Gets a list of all descriptors for the registered LCID.static intgetLCID(String tag)Gets an LCID for a given language tag.static intgetLCID(LocaleId locId)Gets the LCID for a given locale id.static StringgetLCID_asString(LocaleId locId)Gets the LCID as a string, for a given locale id.static HashMap<String,net.sf.okapi.common.LCIDUtil.LCIDDescr>getLcidLookup()static LocaleIdgetLocaleId(int lcid)Creates a locale id for a given LCID value.static LocaleIdgetLocaleId(String tag)Creates a locale id for a given language tag.static StringgetTag(int lcid)Gets the language tag for a given LCID.static StringgetTag(LocaleId locId)Gets the language tag for a given locale id.static HashMap<Integer,net.sf.okapi.common.LCIDUtil.LCIDDescr>getTagLookup()
-
-
-
Method Detail
-
getDescriptors
public static List<net.sf.okapi.common.LCIDUtil.LCIDDescr> getDescriptors()
Gets a list of all descriptors for the registered LCID.- Returns:
- a list of all descriptors for the registered LCID.
-
getTag
public static String getTag(int lcid)
Gets the language tag for a given LCID.- Parameters:
lcid- the LCID value.- Returns:
- the language tag found or an empty string
-
getLCID
public static int getLCID(String tag)
Gets an LCID for a given language tag.- Parameters:
tag- the language tag to lookup.- Returns:
- the LCID value found.
-
getTag
public static String getTag(LocaleId locId)
Gets the language tag for a given locale id.- Parameters:
locId- the locale id to lookup.- Returns:
- the language tag found, or an empty string.
-
getLCID
public static int getLCID(LocaleId locId)
Gets the LCID for a given locale id.- Parameters:
locId- the locale id to lookup.- Returns:
- the LCID value found, or 0 if nothing is found.
-
getLCID_asString
public static String getLCID_asString(LocaleId locId)
Gets the LCID as a string, for a given locale id.- Parameters:
locId- the localie id to lookup.- Returns:
- the LCID found, as a string.
-
getLocaleId
public static LocaleId getLocaleId(String tag)
Creates a locale id for a given language tag.This method is the same as calling
new LocaleId(tag).- Parameters:
tag- the language tag.- Returns:
- a new locale id for the given language tag.
-
getLocaleId
public static LocaleId getLocaleId(int lcid)
Creates a locale id for a given LCID value.- Parameters:
lcid- the LCID to lookup.- Returns:
- a new locale id for the given LCID value.
-
getTagLookup
public static HashMap<Integer,net.sf.okapi.common.LCIDUtil.LCIDDescr> getTagLookup()
-
getLcidLookup
public static HashMap<String,net.sf.okapi.common.LCIDUtil.LCIDDescr> getLcidLookup()
-
-