From b497017bdd61853ad3058e3c3317c911727a9586 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 17 Apr 2009 08:32:35 +0000 Subject: [PATCH] Problem with language - ID: 2629646 --- .../org/adempiere/webui/panel/LoginPanel.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java index 081122035a..ed93418053 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java @@ -182,14 +182,7 @@ public class LoginPanel extends Window implements EventListener { if(eventComp.getId().equals(lstLanguage.getId())) { String langName = (String) lstLanguage.getSelectedItem().getLabel(); - Language language = Language.getLanguage(langName); - Env.verifyLanguage(ctx, language); - Env.setContext(ctx, Env.LANGUAGE, language.getAD_Language()); - - res = ResourceBundle.getBundle(RESOURCE, language.getLocale()); - lblUserId.setValue(res.getString("User")); - lblPassword.setValue(res.getString("Password")); - lblLanguage.setValue(res.getString("Language")); + languageChanged(langName); } } // Elaine 2009/02/06 - initial language @@ -212,6 +205,7 @@ public class LoginPanel extends Window implements EventListener if(li.getLabel().equals(initDefault)) { lstLanguage.setSelectedIndex(i); + languageChanged(li.getLabel()); // Elaine 2009/04/17 language changed break; } } @@ -221,6 +215,18 @@ public class LoginPanel extends Window implements EventListener } // } + + private void languageChanged(String langName) + { + Language language = Language.getLanguage(langName); + Env.verifyLanguage(ctx, language); + Env.setContext(ctx, Env.LANGUAGE, language.getAD_Language()); + + res = ResourceBundle.getBundle(RESOURCE, language.getLocale()); + lblUserId.setValue(res.getString("User")); + lblPassword.setValue(res.getString("Password")); + lblLanguage.setValue(res.getString("Language")); + } /** * validates user name and password when logging in *