JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.6.1
[ckeditor.git] / _source / core / lang.js
index add9982..46fe129 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -7,6 +7,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 {\r
        var loadedLangs = {};\r
 \r
+       /**\r
+        * @namespace Holds language related functions.\r
+        */\r
        CKEDITOR.lang =\r
        {\r
                /**\r
@@ -50,8 +53,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        'is'    : 1,\r
                        'it'    : 1,\r
                        'ja'    : 1,\r
+                       'ka'    : 1,\r
                        'km'    : 1,\r
                        'ko'    : 1,\r
+                       'ku'    : 1,\r
                        'lt'    : 1,\r
                        'lv'    : 1,\r
                        'mn'    : 1,\r
@@ -71,6 +76,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        'sv'    : 1,\r
                        'th'    : 1,\r
                        'tr'    : 1,\r
+                       'ug'    : 1,\r
                        'uk'    : 1,\r
                        'vi'    : 1,\r
                        'zh-cn' : 1,\r
@@ -81,12 +87,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                 * Loads a specific language file, or auto detect it. A callback is\r
                 * then called when the file gets loaded.\r
                 * @param {String} languageCode The code of the language file to be\r
-                *              loaded. If "autoDetect" is set to true, this language will be\r
-                *              used as the default one, if the detect language is not\r
-                *              available in the core.\r
-                * @param {Boolean} autoDetect Indicates that the function must try to\r
-                *              detect the user language and load it instead.\r
-                * @param {Function} callback The function to be called once the\r
+                *              loaded. If null or empty, autodetection will be performed. The\r
+                *              same happens if the language is not supported.\r
+                * @param {String} defaultLanguage The language to be used if\r
+                *              languageCode is not supported or if the autodetection fails.\r
+                * @param {Function} callback A function to be called once the\r
                 *              language file is loaded. Two parameters are passed to this\r
                 *              function: the language code and the loaded language entries.\r
                 * @example\r
@@ -121,6 +126,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                 * supported, a default language is then returned.\r
                 * @param {String} defaultLanguage The default language to be returned\r
                 *              if the user language is not supported.\r
+                * @param {String} [probeLanguage] A language code to try to use,\r
+                *              instead of the browser based autodetection.\r
                 * @returns {String} The detected language code.\r
                 * @example\r
                 * alert( CKEDITOR.lang.detect( 'en' ) );  // e.g., in a German browser: "de"\r
@@ -128,7 +135,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                detect : function( defaultLanguage, probeLanguage )\r
                {\r
                        var languages = this.languages;\r
-                       probeLanguage = probeLanguage || navigator.userLanguage || navigator.language;\r
+                       probeLanguage = probeLanguage || navigator.userLanguage || navigator.language || defaultLanguage;\r
 \r
                        var parts = probeLanguage\r
                                        .toLowerCase()\r