language/utils
@ckeditor/ckeditor5-language/src/utils
Filtering
Functions
-
parseLanguageAttribute( str ) → Object
module:language/utils~parseLanguageAttribute
Retrieves language properties converted to attribute value by the stringifyLanguageAttribute function.
Parameters
str : String
The attribute value.
Returns
Object
result
String
result.languageCode The language code in the ISO 639 format.
String
result.textDirection The language text direction.
-
stringifyLanguageAttribute( languageCode, [ textDirection ] ) → String
module:language/utils~stringifyLanguageAttribute
Returns the language attribute value in a human-readable text format:
<languageCode>:<textDirection>
languageCode
- The language code used for thelang
attribute in the ISO 639-1 format.textDirection
- One of the following values:rtl
orltr
, 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 onlanguageCode
.Parameters
languageCode : String
The language code in the ISO 639-1 format.
[ textDirection ] : 'ltr' | 'rtl'
The language text direction. Automatically detected if omitted.
Returns
String
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.