Sign up (with export icon)

language/utils

Api-module icon module

Functions

  • Chevron-right icon

    parseLanguageAttribute( str ) → object
    internal

    Retrieves language properties converted to attribute value by the stringifyLanguageAttribute function.

    Parameters

    str : string

    The attribute value.

    Returns

    object

    The object with properties:

    • languageCode - The language code in the ISO 639 format.
    • textDirection - The language text direction.
  • Chevron-right icon

    stringifyLanguageAttribute( languageCode, [ textDirection ] ) → string
    internal

    Returns the language attribute value in a human-readable text format:

    <languageCode>:<textDirection>
    
    Copy code
    • languageCode - The language code used for the lang attribute in the ISO 639-1 format.
    • textDirection - One of the following values: rtl or ltr, indicating the reading direction of the language.

    See the text part language configuration for more information about language properties.

    If the textDirection argument is omitted, it will be automatically detected based on languageCode.

    Parameters

    languageCode : string

    The language code in the ISO 639-1 format.

    [ textDirection ] : LanguageDirection

    The language text direction. Automatically detected if omitted.

    Returns

    string