Package org.apache.fop.util
Class LanguageTags
- java.lang.Object
-
- org.apache.fop.util.LanguageTags
-
public final class LanguageTags extends java.lang.Object
Provides utility methods for manipulating language tags compliant with the RFC 3066 specification available at http://www.ietf.org/rfc/rfc3066.txt. A typical language tag is a 2-letter language code sometimes followed by a country code. For example: en, en-US.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
toLanguageTag(java.util.Locale locale)
Converts the given locale to an RFC 3066 compliant language tag.static java.util.Locale
toLocale(java.lang.String languageTag)
Converts an RFC 3066 compliant language tag to a locale.
-
-
-
Method Detail
-
toLanguageTag
public static java.lang.String toLanguageTag(java.util.Locale locale)
Converts the given locale to an RFC 3066 compliant language tag.- Parameters:
locale
- a locale- Returns:
- the corresponding language tag
-
toLocale
public static java.util.Locale toLocale(java.lang.String languageTag)
Converts an RFC 3066 compliant language tag to a locale.- Parameters:
languageTag
- language tag to convert- Returns:
- the corresponding locale
-
-