i18n for changing password #3102
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / password / PasswordWizard.java
index 9b000fcb436c94831fd43abf9e5a6f0bcb0c2834..da6134bab023df6ec5eac378cc6e61b0364c9030 100644 (file)
@@ -20,6 +20,7 @@ import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.Messages;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -43,7 +44,7 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
        public PasswordWizard(User user, ConversationHolder conversation){
                this.conversation = conversation;
                this.user = user;
-               setWindowTitle("Change password");
+               setWindowTitle(Messages.PasswordWizardPage_CHANGE_PASSWORD);
        }
 
        @Override
@@ -60,7 +61,9 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
                ConversationHolder internalConversation = CdmStore.getCurrentApplicationConfiguration().NewConversation();
            internalConversation.bind();
            internalConversation.startTransaction();
-               try{
+               String warningTitle = Messages.PasswordWizard_COULD_NOT_CHANGE_PWD;
+        String warningMessage = Messages.PasswordWizard_OLD_PWD_INCORRECT;
+        try{
                        if(passwordPage.isChangingOwnPassword()){
                            // change own password with validating of old one
                                CdmStore.getService(IUserService.class).changePassword(passwordPage.getOldPassword(), passwordPage.getNewPassword());
@@ -74,14 +77,14 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
                    internalConversation.close();
                        return true;
                }catch(AccessDeniedException e){
-                       MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
+                       MessagingUtils.warningDialog(warningTitle, this, warningMessage);
                        return false;
                }catch (AuthenticationException e){
-                       MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
+                       MessagingUtils.warningDialog(warningTitle, this, warningMessage);
 
                        return false;
                }catch(Exception e){
-                       MessagingUtils.warningDialog("Problem with changing password", this, "The password could not be changed. " + e.getMessage());
+                       MessagingUtils.warningDialog(Messages.PasswordWizard_PROBLEM_WITH_CHANGING_PWD, this, Messages.PasswordWizard_PWD_COULD_NOT_BE_CHANGED + e.getMessage());
                        return false;
                }finally{
                    if(conversation != null){