Report an issue
Class

CKEDITOR.lang

class singleton

Stores language-related functions.

Filtering

Properties

  • languages : Object

    The list of languages available in the editor core.

    alert( CKEDITOR.lang.languages.en ); // 1
    

    Defaults to {af: 1, ar: 1, az: 1, bg: 1, bn: 1, bs: 1, ca: 1, cs: 1, cy: 1, da: 1, de: 1, 'de-ch': 1, el: 1, 'en-au': 1, 'en-ca': 1, 'en-gb': 1, en: 1, eo: 1, es: 1, 'es-mx': 1, et: 1, eu: 1, fa: 1, fi: 1, fo: 1, 'fr-ca': 1, fr: 1, gl: 1, gu: 1, he: 1, hi: 1, hr: 1, hu: 1, id: 1, is: 1, it: 1, ja: 1, ka: 1, km: 1, ko: 1, ku: 1, lt: 1, lv: 1, mk: 1, mn: 1, ms: 1, nb: 1, nl: 1, no: 1, oc: 1, pl: 1, 'pt-br': 1, pt: 1, ro: 1, ru: 1, si: 1, sk: 1, sl: 1, sq: 1, 'sr-latn': 1, sr: 1, sv: 1, th: 1, tr: 1, tt: 1, ug: 1, uk: 1, vi: 1, 'zh-cn': 1, zh: 1}

  • rtl : Object

    The list of languages that are written Right-To-Left (RTL) and are supported by the editor.

    Defaults to {ar: 1, fa: 1, he: 1, ku: 1, ug: 1}

Methods

  • detect( defaultLanguage, [ probeLanguage ] ) → String

    Returns the language that best fits the user language. For example, suppose that the user language is "pt-br". If this language is supported by the editor, it is returned. Otherwise, if only "pt" is supported, it is returned instead. If none of the previous are supported, a default language is then returned.

    alert( CKEDITOR.lang.detect( 'en' ) ); // e.g., in a German browser: 'de'
    

    Parameters

    defaultLanguage : String

    The default language to be returned if the user language is not supported.

    [ probeLanguage ] : String

    A language code to try to use, instead of the browser-based autodetection.

    Returns

    String

    The detected language code.

  • load( languageCode, defaultLanguage, callback )

    Loads a specific language file, or auto detects it. A callback is then called when the file gets loaded.

    Parameters

    languageCode : String

    The code of the language file to be loaded. If null or empty, autodetection will be performed. The same happens if the language is not supported.

    defaultLanguage : String

    The language to be used if languageCode is not supported or if the autodetection fails.

    callback : Function

    A function to be called once the language file is loaded. Two parameters are passed to this function: the language code and the loaded language entries.