BF [2750447] Translations on Home tab

- partial fix
This commit is contained in:
Heng Sin Low 2009-04-27 09:08:53 +00:00
parent 8c9bb8bfa9
commit 6246c699f2
4 changed files with 242 additions and 234 deletions

View File

@ -24,6 +24,7 @@ import org.compiere.model.MRole;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
@ -62,8 +63,8 @@ public class DPActivities extends DashboardPanel implements EventListener {
btnNotice = new Button();
vbox.appendChild(btnNotice);
btnNotice.setLabel("Notice : 0");
btnNotice.setTooltiptext("Notice");
btnNotice.setLabel(Msg.translate(Env.getCtx(), "AD_Note_ID") + " : 0");
btnNotice.setTooltiptext(Msg.translate(Env.getCtx(), "AD_Note_ID"));
btnNotice.setImage("/images/GetMail16.png");
int AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Notice' AND IsSummary = 'N'");
btnNotice.setName(String.valueOf(AD_Menu_ID));
@ -71,8 +72,8 @@ public class DPActivities extends DashboardPanel implements EventListener {
btnRequest = new Button();
vbox.appendChild(btnRequest);
btnRequest.setLabel("Request : 0");
btnRequest.setTooltiptext("Request");
btnRequest.setLabel(Msg.translate(Env.getCtx(), "R_Request_ID") + " : 0");
btnRequest.setTooltiptext(Msg.translate(Env.getCtx(), "R_Request_ID"));
btnRequest.setImage("/images/Request16.png");
AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Request' AND IsSummary = 'N'");
btnRequest.setName(String.valueOf(AD_Menu_ID));
@ -80,8 +81,8 @@ public class DPActivities extends DashboardPanel implements EventListener {
btnWorkflow = new Button();
vbox.appendChild(btnWorkflow);
btnWorkflow.setLabel("Workflow Activities : 0");
btnWorkflow.setTooltiptext("Workflow Activities");
btnWorkflow.setLabel(Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : 0");
btnWorkflow.setTooltiptext(Msg.getMsg (Env.getCtx(), "WorkflowActivities"));
btnWorkflow.setImage("/images/Assignment16.png");
AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Workflow Activities' AND IsSummary = 'N'");
btnWorkflow.setName(String.valueOf(AD_Menu_ID));
@ -189,9 +190,9 @@ public class DPActivities extends DashboardPanel implements EventListener {
return;
c = c.getParent();
}
btnNotice.setLabel("Notice : " + noOfNotice);
btnRequest.setLabel("Request : " + noOfRequest);
btnWorkflow.setLabel("Workflow Activities : " + noOfWorkflow);
btnNotice.setLabel(Msg.translate(Env.getCtx(), "AD_Note_ID") + " : " + noOfNotice);
btnRequest.setLabel(Msg.translate(Env.getCtx(), "R_Request_ID") + " : " + noOfRequest);
btnWorkflow.setLabel(Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow);
}
public void onEvent(Event event)

View File

@ -393,7 +393,10 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
public void updateUI() {
int total = noOfNotice + noOfRequest + noOfWorkflow;
windowContainer.setTabTitle(0, "Home (" + total + ")",
"Notice : " + noOfNotice + ", Request : " + noOfRequest + ", Workflow Activities : " + noOfWorkflow);
windowContainer.setTabTitle(0, Msg.getMsg(Env.getCtx(), "Home").replaceAll("&", "")
+ " (" + total + ")",
Msg.translate(Env.getCtx(), "AD_Note_ID") + " : " + noOfNotice
+ ", " + Msg.translate(Env.getCtx(), "R_Request_ID") + " : " + noOfRequest
+ ", " + Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow);
}
}

View File

@ -434,6 +434,8 @@ public class NavBar2Desktop extends TabbedDesktop implements MenuListener, Seria
public void updateUI() {
int total = noOfNotice + noOfRequest + noOfWorkflow;
shortcutPanel.setLabel(1, "Activities (" + total + ")");
shortcutPanel.setTooltiptext(1, "Notice : " + noOfNotice + ", Request : " + noOfRequest + ", Workflow Activities : " + noOfWorkflow);
shortcutPanel.setTooltiptext(1, Msg.translate(Env.getCtx(), "AD_Note_ID") + " : " + noOfNotice
+ ", " + Msg.translate(Env.getCtx(), "R_Request_ID") + " : " + noOfRequest
+ ", " + Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow);
}
}

View File

@ -162,7 +162,7 @@ public class NavBarDesktop extends TabbedDesktop implements MenuListener, Serial
div = new Div();
Executions.createComponents(VIEWS_PATH, div, null);
navigationPanel.add(div, "Views");
navigationPanel.add(div, Msg.getMsg(Env.getCtx(), "View").replaceAll("&", ""));
navigationPanel.setSelectedIndex(0);
@ -450,6 +450,8 @@ public class NavBarDesktop extends TabbedDesktop implements MenuListener, Serial
public void updateUI() {
int total = noOfNotice + noOfRequest + noOfWorkflow;
navigationPanel.setLabel(2, "Activities (" + total + ")");
navigationPanel.setTooltiptext(2, "Notice : " + noOfNotice + ", Request : " + noOfRequest + ", Workflow Activities : " + noOfWorkflow);
navigationPanel.setTooltiptext(2, Msg.translate(Env.getCtx(), "AD_Note_ID") + " : " + noOfNotice
+ ", " + Msg.translate(Env.getCtx(), "R_Request_ID") + " : " + noOfRequest
+ ", " + Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow);
}
}