org.apache.fop.util

## Class LanguageTags

- java.lang.Object
- - org.apache.fop.util.LanguageTags

-     public final class LanguageTags
      extends 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 and Description
    --- | ---
    `static String` | `toLanguageTag(Locale locale)` Converts the given locale to an RFC 3066 compliant language tag.
    `static Locale` | `toLocale(String languageTag)` Converts an RFC 3066 compliant language tag to a locale.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### toLanguageTag

          public static String toLanguageTag(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 Locale toLocale(String languageTag)

      Converts an RFC 3066 compliant language tag to a locale.
      Parameters:
        `languageTag` - language tag to convert
      Returns:
        the corresponding locale

Copyright © 2025 Apache Software Foundation. All rights reserved.