IDEMPIERE-294 Internationalizing messages

This commit is contained in:
Deepak Pansheriya 2012-12-21 17:12:47 +05:30
parent 147d3626cb
commit 4feb955c34
3 changed files with 27 additions and 2 deletions

View File

@ -0,0 +1,12 @@
-- Dec 21, 2012 7:16:06 AM EST
-- IDEMPIERE-294 Create a mechanism to broadcast messages to clients
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Acknowledge',200130,'U','263e6f73-5932-4e07-979f-1482319a6409','Acknowledge','Y',TO_DATE('2012-12-21 07:16:05','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-12-21 07:16:05','YYYY-MM-DD HH24:MI:SS'))
;
-- Dec 21, 2012 7:16:06 AM EST
-- IDEMPIERE-294 Create a mechanism to broadcast messages to clients
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200130 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
SELECT register_migration_script('201212211710_IDEMPIERE-294.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- Dec 21, 2012 7:16:06 AM EST
-- IDEMPIERE-294 Create a mechanism to broadcast messages to clients
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Acknowledge',200130,'U','263e6f73-5932-4e07-979f-1482319a6409','Acknowledge','Y',TO_TIMESTAMP('2012-12-21 07:16:05','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-12-21 07:16:05','YYYY-MM-DD HH24:MI:SS'))
;
-- Dec 21, 2012 7:16:06 AM EST
-- IDEMPIERE-294 Create a mechanism to broadcast messages to clients
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200130 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
SELECT register_migration_script('201212211710_IDEMPIERE-294.sql') FROM dual
;

View File

@ -29,6 +29,7 @@ import org.compiere.model.MNote;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.idempiere.broadcast.IBroadcastMsgPopup; import org.idempiere.broadcast.IBroadcastMsgPopup;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
@ -89,7 +90,7 @@ public class BroadcastMessageWindow extends Window implements IBroadcastMsgPopup
} }
private void init() { private void init() {
setTitle("Message"); setTitle(Msg.getMsg(Env.getCtx(),"Message"));
Borderlayout layout = new Borderlayout(); Borderlayout layout = new Borderlayout();
this.appendChild(layout); this.appendChild(layout);
addEventListener("onFocus", this); addEventListener("onFocus", this);
@ -172,7 +173,7 @@ public class BroadcastMessageWindow extends Window implements IBroadcastMsgPopup
acknowledged.setParent(rightCell); acknowledged.setParent(rightCell);
acknowledged.setVisible(false); acknowledged.setVisible(false);
//acknowledged.setHflex("6"); //acknowledged.setHflex("6");
acknowledged.setLabel("Acknowledge"); acknowledged.setLabel(Msg.getMsg(Env.getCtx(),"Acknowledge"));
acknowledged.addEventListener("onClick", this); acknowledged.addEventListener("onClick", this);
} }