IDEMPIERE-2363 HTML Editor (CKEditor) shown in browser language instead of login language

This commit is contained in:
Carlos Ruiz 2014-12-16 12:21:09 -05:00
parent 2d6ac29ea2
commit c0f90d236b
2 changed files with 14 additions and 0 deletions

View File

@ -22,7 +22,9 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -57,6 +59,7 @@ import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.EMail; import org.compiere.util.EMail;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Language;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
import org.zkforge.ckez.CKeditor; import org.zkforge.ckez.CKeditor;
@ -120,6 +123,9 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
fMessage = new CKeditor(); fMessage = new CKeditor();
fMessage.setCustomConfigurationsPath("/js/ckeditor/config.js"); fMessage.setCustomConfigurationsPath("/js/ckeditor/config.js");
fMessage.setToolbar("MyToolbar"); fMessage.setToolbar("MyToolbar");
Map<String,Object> lang = new HashMap<String,Object>();
lang.put("language", Language.getLoginLanguage().getAD_Language());
fMessage.setConfig(lang);
commonInit(from, to, subject, message, attachment); commonInit(from, to, subject, message, attachment);
} // EmailDialog } // EmailDialog

View File

@ -12,6 +12,9 @@
*****************************************************************************/ *****************************************************************************/
package org.adempiere.webui.window; package org.adempiere.webui.window;
import java.util.HashMap;
import java.util.Map;
import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Tab; import org.adempiere.webui.component.Tab;
@ -21,6 +24,8 @@ import org.adempiere.webui.component.Tabpanels;
import org.adempiere.webui.component.Tabs; import org.adempiere.webui.component.Tabs;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.compiere.util.Env;
import org.compiere.util.Language;
import org.zkforge.ckez.CKeditor; import org.zkforge.ckez.CKeditor;
import org.zkoss.zk.au.out.AuScript; import org.zkoss.zk.au.out.AuScript;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
@ -161,6 +166,9 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
editor = new CKeditor(); editor = new CKeditor();
editor.setCustomConfigurationsPath("/js/ckeditor/config.js"); editor.setCustomConfigurationsPath("/js/ckeditor/config.js");
editor.setToolbar("MyToolbar"); editor.setToolbar("MyToolbar");
Map<String,Object> lang = new HashMap<String,Object>();
lang.put("language", Language.getLoginLanguage().getAD_Language());
editor.setConfig(lang);
tabPanel.appendChild(editor); tabPanel.appendChild(editor);
editor.setVflex("1"); editor.setVflex("1");
editor.setWidth("100%"); editor.setWidth("100%");