/*\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
{\r
var loadedLangs = {};\r
\r
+ /**\r
+ * @namespace Holds language related functions.\r
+ */\r
CKEDITOR.lang =\r
{\r
/**\r
'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
'sv' : 1,\r
'th' : 1,\r
'tr' : 1,\r
+ 'ug' : 1,\r
'uk' : 1,\r
'vi' : 1,\r
'zh-cn' : 1,\r
* 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
* 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
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