i18n for changing password #3102
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 21 Jun 2016 11:50:43 +0000 (13:50 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 21 Jun 2016 11:51:05 +0000 (13:51 +0200)
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/EditPasswordElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizardPage.java

index 7bd032ac44fbe2ef6132ca503af6c47d930f4487..6ed8a13287cc80cb35ca6cdc9520c89bd43df213 100644 (file)
@@ -60,7 +60,6 @@ command.name.1 = Create Datasource
 command.name.3 = Update Datasource\r
 command.name.4 = Show Login Window\r
 command.name.5 = Open Defined Term Editor\r
-commandParameter.name = inputType\r
 commandParameter.name.0 = inputType\r
 command.name.6 = New Defined Term\r
 command.name.7 = New Term Vocabulary\r
@@ -128,6 +127,10 @@ page.name.27 = Media
 page.name.28 = Checklist Editor\r
 page.name.29 = Editor Profile\r
 page.name.30 = Language\r
+page.name.32 = Taxon Navigator\r
+page.name.33 = Sort of Taxonnodes\r
+page.name.34 = Debug Preferences\r
+page.name.35 = Areas for Distributions\r
 command.label.clone = Clone\r
 command.label.openInSpecimenEditor = Open in Specimen Editor\r
 page.name.31 = Order of Taxonnodes\r
@@ -151,14 +154,8 @@ activity.description.2 = ROLE_USER_MANAGER dependent ui contributions
 activity.name.2 = UserManagement\r
 activity.description.3 = ROLE_PROJECT_MANAGER dependent ui contributions\r
 activity.name.3 = ProjectManagement\r
-Bundle-Vendor = EDIT\r
-Bundle-Name = DataStore Bundle\r
 command.name.13 = delete\r
 command.name.14 = delete\r
-page.name.32 = Taxon Navigator\r
-page.name.33 = Sort of Taxonnodes\r
-page.name.34 = Debug Preferences\r
-page.name.35 = Areas for Distributions\r
 command.name.15 = Open\r
 view.name.SESSIONS = Sessions\r
 command.label.SESSION = Sessions\r
@@ -171,4 +168,5 @@ command.name.OPEN_TAXONNODE_WIZARD = Open Taxon Node Wizard
 \r
 command.name.INSPECT_ACTIVE_SESSIONS = Inspect Active Session\r
 viewCommandMapping.viewerName.CLASSIFICATION_WIZARD = Classification Wizard\r
-viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxon node Wizard
\ No newline at end of file
+viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxon node Wizard\r
+command.label.CHANGE_PASSWORD = Change password
\ No newline at end of file
index d54295aaafdd59b0d7ad3cc6e28cd69aba40a94e..a4a8084e837c1ddb64ee2ec673ec29d9faba88be 100644 (file)
@@ -60,7 +60,6 @@ command.name.1 = Erstelle Datenquelle
 command.name.3 = Aktualisiere Datenquellen
 command.name.4 = Zeige Login Window
 command.name.5 = \u00d6ffne Editor f\u00fcr definierte Begriffe
-commandParameter.name = inputTyp
 commandParameter.name.0 = inputTyp
 command.name.6 = Neuer definierter Begriff
 command.name.7 = Neues Begriffsvokabular
@@ -145,10 +144,18 @@ wizard.name.18 = CSV
 wizard.name.19 = CSV_NAME
 wizard.name.20 = CSV_PRINT
 wizard.name.21 = Specimen Suche
+activity.description = DELETE abhängige UI-Erweiterungen
+activity.name = Löschen
+activity.description.0 = UPDATE abhängige UI-Erweiterungen
+activity.name.0 = Aktualisieren
+activity.description.1 = CREATE abhängige UI-Erweiterungen
+activity.name.1 = Löschen
+activity.description.2 = ROLE_USER_MANAGER abhängige UI-Erweiterungen
+activity.name.2 = User-Management
+activity.description.3 = ROLE_PROJECT_MANAGER abhängige UI-Erweiterungen
+activity.name.3 = Projekt-Management
 command.name.13 = L\u00f6schen
 command.name.14 = L\u00f6schen
-page.name.32 = Taxon Navigator
-page.name.33 = Reihenfolge der Taxon-Nodes
 command.name.15 = \u00d6ffnen
 view.name.SESSIONS = Sessions
 command.label.SESSION = Sessions
@@ -159,7 +166,7 @@ command.name.RE_CONNECT = Aktualisiere Verbindung
 command.name.OPEN_CLASSIFICATION_WIZARD = \u00d6ffne Klassifikations-Wizard
 command.name.OPEN_TAXONNODE_WIZARD = \u00d6ffne Taxon Node-Wizard
 
-
 command.name.INSPECT_ACTIVE_SESSIONS = Aktive Session untersuchen
 viewCommandMapping.viewerName.CLASSIFICATION_WIZARD = Klassifikations-Wizard
-viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxonknoten-Wizard
\ No newline at end of file
+viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxnknoten-Wizard
+command.label.CHANGE_PASSWORD = Kennwort ändern
\ No newline at end of file
index 7d26acc32504f515b4d6e0ea287533a4a94fb649..d324d4dc7177b7b39d2a7d82f233f73825b2b286 100644 (file)
@@ -94,3 +94,17 @@ RemotingLoginDialog_GENERATING_CONFIG_FILE=Generating datasources config file fo
 RemotingLoginDialog_JOB_SERVER_LAUNCH=Managed CDM Server Launch
 RemotingLoginDialog_STARTING_MGD_SERVER=Starting Managed CDM Server. This may take a while.
 RemotingLoginDialog_TASK_LAUNCHING_SERVER=Launching Managed CDM Server
+
+EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER=Please create or save user '%s' before changing password
+EditPasswordElement_USERNAME_DOES_NOT_EXIST=Username does not exist
+PasswordWizard_COULD_NOT_CHANGE_PWD=Could not change password
+PasswordWizard_OLD_PWD_INCORRECT=The old password is not correct.
+PasswordWizard_PROBLEM_WITH_CHANGING_PWD=Problem with changing password
+PasswordWizard_PWD_COULD_NOT_BE_CHANGED=The password could not be changed. 
+PasswordWizardPage_CHANGE_PASSWORD=Change password
+PasswordWizardPage_CHANGE_PASSWORD_AND_CONFIRM=Change password and confirm with current password
+PasswordWizardPage_NEW_PASSWORD=New Password
+PasswordWizardPage_OLD_PASSWORD=Old Password
+PasswordWizardPage_PASSWORD_MIN_CHARACTER=Password has to have at least %s characters
+PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=The passwords do not match
+PasswordWizardPage_REPEAT_PASSWORD=Repeat Password
index 16015fd628c061d1eec7fadb196330914225e835..1b0295b044689f54e03104c5153bcf7bede973b4 100644 (file)
@@ -94,3 +94,17 @@ RemotingLoginDialog_GENERATING_CONFIG_FILE=Generiere Config-Datei f
 RemotingLoginDialog_JOB_SERVER_LAUNCH=Starte internen CDM-Server
 RemotingLoginDialog_STARTING_MGD_SERVER=Starte internen CDM-Server. Dies kann eine Weile dauern.
 RemotingLoginDialog_TASK_LAUNCHING_SERVER=Starte internen CDM-Server
+
+EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER=Bitte erstellen oder speichern sie den Nutzer '%s', bevor Sie das Kennwort ändern
+EditPasswordElement_USERNAME_DOES_NOT_EXIST=Nutzername existiert nicht
+PasswordWizard_COULD_NOT_CHANGE_PWD=Konnte das Kennwort nicht ändern
+PasswordWizard_OLD_PWD_INCORRECT=Das alte Kennwort ist inkorrekt
+PasswordWizard_PROBLEM_WITH_CHANGING_PWD=Fehler beim Ändern des Kennworts
+PasswordWizard_PWD_COULD_NOT_BE_CHANGED=Das Kennwort konnte nicht geändert werden 
+PasswordWizardPage_CHANGE_PASSWORD=Kennwort ändern
+PasswordWizardPage_CHANGE_PASSWORD_AND_CONFIRM=Kennwort ändern und mit altem Kennwort bestätigen
+PasswordWizardPage_NEW_PASSWORD=Neues Kennwort
+PasswordWizardPage_OLD_PASSWORD=Altes Kennwort
+PasswordWizardPage_PASSWORD_MIN_CHARACTER=Kennwort muss mindesten %s Zeichen enthalten
+PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=Die Kennwörter stimmen nicht überein
+PasswordWizardPage_REPEAT_PASSWORD=Kennwort wiederholen
index babc87b9d006d0a9e2290c6dc59154f6f6be365a..70bdd299bf1400dbd87a0960a3ec675ded507c05 100644 (file)
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.store.openPasswordWizzard"
-               label="Change password"
+               label="%command.label.CHANGE_PASSWORD"
                style="push">
             <visibleWhen
                   checkEnabled="true">
index 31af5d0bac9535f6af16333b22798c2ecdf1745e..e958729c7e52397e0f10fd868e5948d0a1e909c2 100644 (file)
@@ -71,6 +71,19 @@ public class Messages extends NLS {
        public static String CdmStoreConnector_SCHEME_NOT_COMPATIBLE;
        public static String CdmStoreConnector_UPDATE_DATASOUREC_OR_CHOOSE_NEW_DATASOURCE;
        public static String CdmStoreConnector_UPDATE_EDITOR_OR_CHOOSE_COMPATIBLE_DATASOURCE;
+    public static String EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER;
+    public static String EditPasswordElement_USERNAME_DOES_NOT_EXIST;
+    public static String PasswordWizard_COULD_NOT_CHANGE_PWD;
+    public static String PasswordWizard_OLD_PWD_INCORRECT;
+    public static String PasswordWizard_PROBLEM_WITH_CHANGING_PWD;
+    public static String PasswordWizard_PWD_COULD_NOT_BE_CHANGED;
+    public static String PasswordWizardPage_CHANGE_PASSWORD;
+    public static String PasswordWizardPage_CHANGE_PASSWORD_AND_CONFIRM;
+    public static String PasswordWizardPage_NEW_PASSWORD;
+    public static String PasswordWizardPage_OLD_PASSWORD;
+    public static String PasswordWizardPage_PASSWORD_MIN_CHARACTER;
+    public static String PasswordWizardPage_PASSWORDS_DO_NOT_MATCH;
+    public static String PasswordWizardPage_REPEAT_PASSWORD;
     public static String RemotingLoginDialog_CHOOSE_COMPATIBLE_CDM_SERVER;
        public static String RemotingLoginDialog_LABEL_ADVANCED;
        public static String RemotingLoginDialog_LABEL_CDM_INSTANCE;
index e6010ddfca59f3ca7aede683471cbbcf2e3fe462..9ac5d8c502f8a3028a5d43a32d9d55e4435ed293 100644 (file)
@@ -22,6 +22,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.AbstractCdmFormElement;
@@ -51,7 +52,7 @@ public class EditPasswordElement extends AbstractCdmFormElement implements Selec
                Label label = formFactory.createLabel(getLayoutComposite(), null);
                addControl(label);
 
-               String buttonLabelString = (labelString != null) ? labelString : "Change Password";
+               String buttonLabelString = (labelString != null) ? labelString : Messages.PasswordWizardPage_CHANGE_PASSWORD;
 
                button = formFactory.createButton(getLayoutComposite(), buttonLabelString, SWT.PUSH);
                button.setLayoutData(LayoutConstants.RIGHT());
@@ -63,7 +64,7 @@ public class EditPasswordElement extends AbstractCdmFormElement implements Selec
        @Override
        public void widgetSelected(SelectionEvent e) {
                if(!CdmStore.getService(IUserService.class).userExists(user.getUsername())) {
-                       MessagingUtils.warningDialog("Username does not exist", this, "Please create or save user '" + user.getUsername() + "' before changing password");
+                       MessagingUtils.warningDialog(Messages.EditPasswordElement_USERNAME_DOES_NOT_EXIST, this, String.format(Messages.EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER, user.getUsername()));
                } else {
                        PasswordWizard wizard = new PasswordWizard(user, conversation);
                        WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
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){
index 4d1b7514862775e556fddff26f6a0653002b4179..df8b005ac5f811fe64f0bbe73fd22eaa606c0549 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.Messages;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -35,8 +36,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implements ModifyListener{
 
-       public static final String NAME = "USER_WIZARD_PAGE";
-
        private TextWithLabelElement text_oldPassword;
        private TextWithLabelElement text_password;
        private TextWithLabelElement text_passwordRepeat;
@@ -48,8 +47,8 @@ public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implem
 
                passwordValidator = new PasswordValidator();
 
-               setTitle("Change password");
-               setDescription("Change password and confirm with current password");
+               setTitle(Messages.PasswordWizardPage_CHANGE_PASSWORD);
+               setDescription(Messages.PasswordWizardPage_CHANGE_PASSWORD_AND_CONFIRM);
        }
 
        @Override
@@ -63,10 +62,10 @@ public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implem
                WizardPageRootElement rootElement = new WizardPageRootElement(formFactory, control, getConversationHolder());
 
                if(isChangingOwnPassword()) {
-                   text_oldPassword = formFactory.createTextWithLabelElement(rootElement, "Old Password", null, SWT.PASSWORD);
+                   text_oldPassword = formFactory.createTextWithLabelElement(rootElement, Messages.PasswordWizardPage_OLD_PASSWORD, null, SWT.PASSWORD);
                }
-               text_password =  formFactory.createTextWithLabelElement(rootElement, "New Password", null, SWT.PASSWORD);
-               text_passwordRepeat =  formFactory.createTextWithLabelElement(rootElement, "Repeat Password", null, SWT.PASSWORD);
+               text_password =  formFactory.createTextWithLabelElement(rootElement, Messages.PasswordWizardPage_NEW_PASSWORD, null, SWT.PASSWORD);
+               text_passwordRepeat =  formFactory.createTextWithLabelElement(rootElement, Messages.PasswordWizardPage_REPEAT_PASSWORD, null, SWT.PASSWORD);
 
                ((Text)text_passwordRepeat.getMainControl()).addModifyListener(this);
 
@@ -109,10 +108,10 @@ public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implem
 
        private class PasswordValidator implements IInputValidator{
 
-               private static final int PW_MIN_LENGTH = 5;
+               private final int PW_MIN_LENGTH = 5;
 
-               private static final String TO_SHORT = "Password has to have at least " + PW_MIN_LENGTH + " characters";
-               private static final String NO_MATCH = "The passwords do not match";
+               private final String TO_SHORT = String.format(Messages.PasswordWizardPage_PASSWORD_MIN_CHARACTER, PW_MIN_LENGTH);
+               private final String NO_MATCH = Messages.PasswordWizardPage_PASSWORDS_DO_NOT_MATCH;
 
                @Override
         public String isValid(String newText) {