language/utils
module
Functions
parseLanguageAttribute( str ) → objectinternalmodule:language/utils~parseLanguageAttributeRetrieves language properties converted to attribute value by the stringifyLanguageAttribute function.
Parameters
str : stringThe attribute value.
Returns
objectThe object with properties:
- languageCode - The language code in the ISO 639 format.
- textDirection - The language text direction.
stringifyLanguageAttribute( languageCode, [ textDirection ] ) → stringinternalmodule:language/utils~stringifyLanguageAttributeReturns the language attribute value in a human-readable text format:
<languageCode>:<textDirection>Copy codelanguageCode- The language code used for thelangattribute in the ISO 639-1 format.textDirection- One of the following values:rtlorltr, indicating the reading direction of the language.
See the text part language configuration for more information about language properties.
If the
textDirectionargument is omitted, it will be automatically detected based onlanguageCode.Parameters
languageCode : stringThe language code in the ISO 639-1 format.
[ textDirection ] : LanguageDirectionThe language text direction. Automatically detected if omitted.
Returns
string