[otrs-cvs] otrs/var/httpd/htdocs/js Core.UI.RichTextEditor.js, 1.23, 1.24

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/var/httpd/htdocs/js
In directory lancelot:/tmp/cvs-serv20862/var/httpd/htdocs/js

Modified Files:
	Core.UI.RichTextEditor.js 
Log Message:
Fixed bug#8024 - WYSIWYG editor does not get correct language information.

Author: mn

Index: Core.UI.RichTextEditor.js
===================================================================
RCS file: /home/cvs/otrs/var/httpd/htdocs/js/Core.UI.RichTextEditor.js,v
retrieving revision 1.23
retrieving revision 1.24
diff -2 -u -d -r1.23 -r1.24
--- Core.UI.RichTextEditor.js	10 Dec 2012 09:53:24 -0000	1.23
+++ Core.UI.RichTextEditor.js	7 Feb 2013 11:03:50 -0000	1.24
@@ -1,5 +1,5 @@
 // --
 // Core.UI.RichTextEditor.js - provides all UI functions
-// Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
+// Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
 // --
 // $Id$
@@ -47,5 +47,6 @@
         var EditorID = '',
             Editor,
-            Instance;
+            Instance,
+            UserLanguage;
 
         if (isJQueryObject($EditorArea) && $EditorArea.length === 1) {
@@ -71,9 +72,13 @@
         });
 
+        // The format for the language is different between OTRS and CKEditor (see bug#8024)
+        // To correct this, we replace "_" with "-" in the language (e.g. zh_CN becomes zh-cn)
+        UserLanguage = Core.Config.Get('UserLanguage').replace(/_/, "-");
+
         Editor = CKEDITOR.replace(EditorID,
         {
             customConfig: '', // avoid loading external config files
-            defaultLanguage: Core.Config.Get('UserLanguage'),
-            language: Core.Config.Get('UserLanguage'),
+            defaultLanguage: UserLanguage,
+            language: UserLanguage,
             width: Core.Config.Get('RichText.Width', 620),
             resize_minWidth: Core.Config.Get('RichText.Width', 620),
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.