Code Index | File Index

Namespaces

Classes


Namespace CKEDITOR.lang

Holds language related functions.
Defined in: core/lang.js.

Field Summary
Field Attributes Field Name and Description
<static>  
CKEDITOR.lang.languages
The list of languages available in the editor core.
Method Summary
Method Attributes Method Name and Description
<static>  
CKEDITOR.lang.detect(defaultLanguage, probeLanguage)
Returns the language that best fit the user language.
<static>  
CKEDITOR.lang.load(languageCode, defaultLanguage, callback)
Loads a specific language file, or auto detect it.
Field Detail
<static> {Object} CKEDITOR.lang.languages
Since: 3.0
The list of languages available in the editor core.
alert( CKEDITOR.lang.en );  // "true"
Method Detail
<static> {String} CKEDITOR.lang.detect(defaultLanguage, probeLanguage)
Since: 3.0
Returns the language that best fit 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:
{String} defaultLanguage
The default language to be returned if the user language is not supported.
{String} probeLanguage Optional
A language code to try to use, instead of the browser based autodetection.
Returns:
{String} The detected language code.

<static> {Undefined} CKEDITOR.lang.load(languageCode, defaultLanguage, callback)
Since: 3.0
Loads a specific language file, or auto detect it. A callback is then called when the file gets loaded.
Parameters:
{String} languageCode
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.
{String} defaultLanguage
The language to be used if languageCode is not supported or if the autodetection fails.
{Function} callback
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.

Copyright © 2003-2010, CKSource - Frederico Knabben. All rights reserved.