Problem with language - ID: 2629646

This commit is contained in:
Heng Sin Low 2009-04-17 08:32:35 +00:00
parent cb823262ab
commit b497017bdd
1 changed files with 14 additions and 8 deletions

View File

@ -182,14 +182,7 @@ public class LoginPanel extends Window implements EventListener
{ {
if(eventComp.getId().equals(lstLanguage.getId())) { if(eventComp.getId().equals(lstLanguage.getId())) {
String langName = (String) lstLanguage.getSelectedItem().getLabel(); String langName = (String) lstLanguage.getSelectedItem().getLabel();
Language language = Language.getLanguage(langName); languageChanged(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"));
} }
} }
// Elaine 2009/02/06 - initial language // Elaine 2009/02/06 - initial language
@ -212,6 +205,7 @@ public class LoginPanel extends Window implements EventListener
if(li.getLabel().equals(initDefault)) if(li.getLabel().equals(initDefault))
{ {
lstLanguage.setSelectedIndex(i); lstLanguage.setSelectedIndex(i);
languageChanged(li.getLabel()); // Elaine 2009/04/17 language changed
break; 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 * validates user name and password when logging in
* *