Represents a utility class for working with ISO 639-1 language codes and additional custom codes.

Constructors

Methods

  • Gets the name of the language corresponding to the given code.

    Parameters

    • code: string

      The language code.

    Returns
        | "Bhojpuri"
        | "Cebuano"
        | "Chinese Simplified"
        | "Chinese Traditional"
        | "Dogri"
        | "Filipino"
        | "Hawaiian"
        | "Hebrew"
        | "Hmong"
        | "Ilocano"
        | "Javanese"
        | "Konkani"
        | "Krio"
        | "Kurdish"
        | "Maithili"
        | "Meitei (Manipuri)"
        | "Mizo"
        | "Northern Sotho"

    • The name of the language.
  • Gets all language names, including ISO 639-1 and additional custom codes.

    Returns string[]

    • An array of language names.
  • Gets the native name of the language corresponding to the given code.

    Parameters

    • code: string

      The language code.

    Returns
        | "भोजपुरी"
        | "Cebuan"
        | "简体中文"
        | "繁體中文"
        | "𑠖𑠵𑠌𑠤𑠮"
        | "Wikang Filipino"
        | "ʻŌlelo Hawaiʻi"
        | "עִבְרִית"
        | "Mong"
        | "Ilokano"
        | "basa jawa"
        | "कोंकणी"
        | "Krio"
        | "کوردی"
        | "मैथिली"
        | "ꯃꯩꯇꯩꯂꯣꯟ"
        | "Mizo ṭawng"
        | "Sesotho sa Lebowa"

    • The native name of the language.
  • Gets all native language names, including ISO 639-1 and additional custom codes.

    Returns string[]

    • An array of native language names.
  • Gets language options for the given language codes, including ISO 639-1 and additional custom codes.

    Parameters

    • codes: string[]

      An array of language codes.

    Returns LanguageOption[]

    • An array of language options.
  • Validates whether the given code is a valid language code.

    Parameters

    • code: string

      The language code to validate.

    Returns boolean

    • True if the code is valid, false otherwise.