Skip to content

Commit

Permalink
Merge branch 't/11911'
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed May 9, 2014
2 parents 81dc623 + d320698 commit 5b1b8ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -4,6 +4,7 @@ CKEditor 4 Changelog
## CKEditor 4.4.1

Fixed Issues:
* [#11911](http://dev.ckeditor.com/ticket/11911): Fixed setting the `dir` attribute for preloaded language in [CKEDITOR.lang](http://docs.ckeditor.com/#!/api/CKEDITOR.lang).
* [#9661](http://dev.ckeditor.com/ticket/9661): Added optional, [configurable](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-linkJavaScriptLinksAllowed) possibility to set JavaScript code in `href` attribute in anchor tags.
* [#11809](http://dev.ckeditor.com/ticket/11809): Set indentation to four spaces in [Code Snippet](http://ckeditor.com/addon/codesnippet) sample.
* [#11223](http://dev.ckeditor.com/ticket/11223): Fixed: issue when [Protected Source](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-protectedSource) was not working in the title element.
Expand Down
21 changes: 11 additions & 10 deletions core/lang.js
Expand Up @@ -4,8 +4,6 @@
*/

( function() {
var loadedLangs = {};

/**
* Stores language-related functions.
*
Expand All @@ -16,7 +14,7 @@
/**
* The list of languages available in the editor core.
*
* alert( CKEDITOR.lang.en ); // 1
* alert( CKEDITOR.lang.languages.en ); // 1
*/
languages: { af: 1, ar: 1, bg: 1, bn: 1, bs: 1, ca: 1, cs: 1, cy: 1, da: 1, de: 1, el: 1,
'en-au': 1, 'en-ca': 1, 'en-gb': 1, en: 1, eo: 1, es: 1, et: 1, eu: 1, fa: 1, fi: 1, fo: 1,
Expand Down Expand Up @@ -49,13 +47,16 @@
if ( !languageCode || !CKEDITOR.lang.languages[ languageCode ] )
languageCode = this.detect( defaultLanguage, languageCode );

if ( !this[ languageCode ] ) {
CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( 'lang/' + languageCode + '.js' ), function() {
this[ languageCode ].dir = this.rtl[ languageCode ] ? 'rtl' : 'ltr';
callback( languageCode, this[ languageCode ] );
}, this );
} else
callback( languageCode, this[ languageCode ] );
var that = this,
loadedCallback = function() {
that[ languageCode ].dir = that.rtl[ languageCode ] ? 'rtl' : 'ltr';
callback( languageCode, that[ languageCode ] );
};

if ( !this[ languageCode ] )
CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( 'lang/' + languageCode + '.js' ), loadedCallback, this );
else
loadedCallback();
},

/**
Expand Down

0 comments on commit 5b1b8ed

Please sign in to comment.