X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Flang.js;h=46fe1292fcc334d314a133d25b22ac9394b68103;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=add998259ed66ccc6a65f7af0f338db76514f9cc;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git diff --git a/_source/core/lang.js b/_source/core/lang.js index add9982..46fe129 100644 --- a/_source/core/lang.js +++ b/_source/core/lang.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -7,6 +7,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var loadedLangs = {}; + /** + * @namespace Holds language related functions. + */ CKEDITOR.lang = { /** @@ -50,8 +53,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license 'is' : 1, 'it' : 1, 'ja' : 1, + 'ka' : 1, 'km' : 1, 'ko' : 1, + 'ku' : 1, 'lt' : 1, 'lv' : 1, 'mn' : 1, @@ -71,6 +76,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license 'sv' : 1, 'th' : 1, 'tr' : 1, + 'ug' : 1, 'uk' : 1, 'vi' : 1, 'zh-cn' : 1, @@ -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 * then called when the file gets loaded. * @param {String} languageCode The code of the language file to be - * loaded. If "autoDetect" is set to true, this language will be - * used as the default one, if the detect language is not - * available in the core. - * @param {Boolean} autoDetect Indicates that the function must try to - * detect the user language and load it instead. - * @param {Function} callback The function to be called once the + * loaded. If null or empty, autodetection will be performed. The + * same happens if the language is not supported. + * @param {String} defaultLanguage The language to be used if + * languageCode is not supported or if the autodetection fails. + * @param {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. * @example @@ -121,6 +126,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license * supported, a default language is then returned. * @param {String} defaultLanguage The default language to be returned * if the user language is not supported. + * @param {String} [probeLanguage] A language code to try to use, + * instead of the browser based autodetection. * @returns {String} The detected language code. * @example * alert( CKEDITOR.lang.detect( 'en' ) ); // e.g., in a German browser: "de" @@ -128,7 +135,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license detect : function( defaultLanguage, probeLanguage ) { var languages = this.languages; - probeLanguage = probeLanguage || navigator.userLanguage || navigator.language; + probeLanguage = probeLanguage || navigator.userLanguage || navigator.language || defaultLanguage; var parts = probeLanguage .toLowerCase()