Project

General

Profile

« Previous | Next » 

Revision 41d514e3

Added by Patrick Plitzner almost 8 years ago

i18n for changing password #3102

View differences:

eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
60 60
command.name.3 = Update Datasource
61 61
command.name.4 = Show Login Window
62 62
command.name.5 = Open Defined Term Editor
63
commandParameter.name = inputType
64 63
commandParameter.name.0 = inputType
65 64
command.name.6 = New Defined Term
66 65
command.name.7 = New Term Vocabulary
......
128 127
page.name.28 = Checklist Editor
129 128
page.name.29 = Editor Profile
130 129
page.name.30 = Language
130
page.name.32 = Taxon Navigator
131
page.name.33 = Sort of Taxonnodes
132
page.name.34 = Debug Preferences
133
page.name.35 = Areas for Distributions
131 134
command.label.clone = Clone
132 135
command.label.openInSpecimenEditor = Open in Specimen Editor
133 136
page.name.31 = Order of Taxonnodes
......
151 154
activity.name.2 = UserManagement
152 155
activity.description.3 = ROLE_PROJECT_MANAGER dependent ui contributions
153 156
activity.name.3 = ProjectManagement
154
Bundle-Vendor = EDIT
155
Bundle-Name = DataStore Bundle
156 157
command.name.13 = delete
157 158
command.name.14 = delete
158
page.name.32 = Taxon Navigator
159
page.name.33 = Sort of Taxonnodes
160
page.name.34 = Debug Preferences
161
page.name.35 = Areas for Distributions
162 159
command.name.15 = Open
163 160
view.name.SESSIONS = Sessions
164 161
command.label.SESSION = Sessions
......
171 168

  
172 169
command.name.INSPECT_ACTIVE_SESSIONS = Inspect Active Session
173 170
viewCommandMapping.viewerName.CLASSIFICATION_WIZARD = Classification Wizard
174
viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxon node Wizard
171
viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxon node Wizard
172
command.label.CHANGE_PASSWORD = Change password
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
60 60
command.name.3 = Aktualisiere Datenquellen
61 61
command.name.4 = Zeige Login Window
62 62
command.name.5 = \u00d6ffne Editor f\u00fcr definierte Begriffe
63
commandParameter.name = inputTyp
64 63
commandParameter.name.0 = inputTyp
65 64
command.name.6 = Neuer definierter Begriff
66 65
command.name.7 = Neues Begriffsvokabular
......
145 144
wizard.name.19 = CSV_NAME
146 145
wizard.name.20 = CSV_PRINT
147 146
wizard.name.21 = Specimen Suche
147
activity.description = DELETE abh?ngige UI-Erweiterungen
148
activity.name = L?schen
149
activity.description.0 = UPDATE abh?ngige UI-Erweiterungen
150
activity.name.0 = Aktualisieren
151
activity.description.1 = CREATE abh?ngige UI-Erweiterungen
152
activity.name.1 = L?schen
153
activity.description.2 = ROLE_USER_MANAGER abh?ngige UI-Erweiterungen
154
activity.name.2 = User-Management
155
activity.description.3 = ROLE_PROJECT_MANAGER abh?ngige UI-Erweiterungen
156
activity.name.3 = Projekt-Management
148 157
command.name.13 = L\u00f6schen
149 158
command.name.14 = L\u00f6schen
150
page.name.32 = Taxon Navigator
151
page.name.33 = Reihenfolge der Taxon-Nodes
152 159
command.name.15 = \u00d6ffnen
153 160
view.name.SESSIONS = Sessions
154 161
command.label.SESSION = Sessions
......
159 166
command.name.OPEN_CLASSIFICATION_WIZARD = \u00d6ffne Klassifikations-Wizard
160 167
command.name.OPEN_TAXONNODE_WIZARD = \u00d6ffne Taxon Node-Wizard
161 168

  
162

  
163 169
command.name.INSPECT_ACTIVE_SESSIONS = Aktive Session untersuchen
164 170
viewCommandMapping.viewerName.CLASSIFICATION_WIZARD = Klassifikations-Wizard
165
viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxonknoten-Wizard
171
viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxnknoten-Wizard
172
command.label.CHANGE_PASSWORD = Kennwort ?ndern
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
94 94
RemotingLoginDialog_JOB_SERVER_LAUNCH=Managed CDM Server Launch
95 95
RemotingLoginDialog_STARTING_MGD_SERVER=Starting Managed CDM Server. This may take a while.
96 96
RemotingLoginDialog_TASK_LAUNCHING_SERVER=Launching Managed CDM Server
97

  
98
EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER=Please create or save user '%s' before changing password
99
EditPasswordElement_USERNAME_DOES_NOT_EXIST=Username does not exist
100
PasswordWizard_COULD_NOT_CHANGE_PWD=Could not change password
101
PasswordWizard_OLD_PWD_INCORRECT=The old password is not correct.
102
PasswordWizard_PROBLEM_WITH_CHANGING_PWD=Problem with changing password
103
PasswordWizard_PWD_COULD_NOT_BE_CHANGED=The password could not be changed. 
104
PasswordWizardPage_CHANGE_PASSWORD=Change password
105
PasswordWizardPage_CHANGE_PASSWORD_AND_CONFIRM=Change password and confirm with current password
106
PasswordWizardPage_NEW_PASSWORD=New Password
107
PasswordWizardPage_OLD_PASSWORD=Old Password
108
PasswordWizardPage_PASSWORD_MIN_CHARACTER=Password has to have at least %s characters
109
PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=The passwords do not match
110
PasswordWizardPage_REPEAT_PASSWORD=Repeat Password
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
94 94
RemotingLoginDialog_JOB_SERVER_LAUNCH=Starte internen CDM-Server
95 95
RemotingLoginDialog_STARTING_MGD_SERVER=Starte internen CDM-Server. Dies kann eine Weile dauern.
96 96
RemotingLoginDialog_TASK_LAUNCHING_SERVER=Starte internen CDM-Server
97

  
98
EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER=Bitte erstellen oder speichern sie den Nutzer '%s', bevor Sie das Kennwort ?ndern
99
EditPasswordElement_USERNAME_DOES_NOT_EXIST=Nutzername existiert nicht
100
PasswordWizard_COULD_NOT_CHANGE_PWD=Konnte das Kennwort nicht ?ndern
101
PasswordWizard_OLD_PWD_INCORRECT=Das alte Kennwort ist inkorrekt
102
PasswordWizard_PROBLEM_WITH_CHANGING_PWD=Fehler beim ?ndern des Kennworts
103
PasswordWizard_PWD_COULD_NOT_BE_CHANGED=Das Kennwort konnte nicht ge?ndert werden 
104
PasswordWizardPage_CHANGE_PASSWORD=Kennwort ?ndern
105
PasswordWizardPage_CHANGE_PASSWORD_AND_CONFIRM=Kennwort ?ndern und mit altem Kennwort best?tigen
106
PasswordWizardPage_NEW_PASSWORD=Neues Kennwort
107
PasswordWizardPage_OLD_PASSWORD=Altes Kennwort
108
PasswordWizardPage_PASSWORD_MIN_CHARACTER=Kennwort muss mindesten %s Zeichen enthalten
109
PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=Die Kennw?rter stimmen nicht ?berein
110
PasswordWizardPage_REPEAT_PASSWORD=Kennwort wiederholen
eu.etaxonomy.taxeditor.store/plugin.xml
431 431
         </command>
432 432
         <command
433 433
               commandId="eu.etaxonomy.taxeditor.store.openPasswordWizzard"
434
               label="Change password"
434
               label="%command.label.CHANGE_PASSWORD"
435 435
               style="push">
436 436
            <visibleWhen
437 437
                  checkEnabled="true">
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
71 71
	public static String CdmStoreConnector_SCHEME_NOT_COMPATIBLE;
72 72
	public static String CdmStoreConnector_UPDATE_DATASOUREC_OR_CHOOSE_NEW_DATASOURCE;
73 73
	public static String CdmStoreConnector_UPDATE_EDITOR_OR_CHOOSE_COMPATIBLE_DATASOURCE;
74
    public static String EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER;
75
    public static String EditPasswordElement_USERNAME_DOES_NOT_EXIST;
76
    public static String PasswordWizard_COULD_NOT_CHANGE_PWD;
77
    public static String PasswordWizard_OLD_PWD_INCORRECT;
78
    public static String PasswordWizard_PROBLEM_WITH_CHANGING_PWD;
79
    public static String PasswordWizard_PWD_COULD_NOT_BE_CHANGED;
80
    public static String PasswordWizardPage_CHANGE_PASSWORD;
81
    public static String PasswordWizardPage_CHANGE_PASSWORD_AND_CONFIRM;
82
    public static String PasswordWizardPage_NEW_PASSWORD;
83
    public static String PasswordWizardPage_OLD_PASSWORD;
84
    public static String PasswordWizardPage_PASSWORD_MIN_CHARACTER;
85
    public static String PasswordWizardPage_PASSWORDS_DO_NOT_MATCH;
86
    public static String PasswordWizardPage_REPEAT_PASSWORD;
74 87
    public static String RemotingLoginDialog_CHOOSE_COMPATIBLE_CDM_SERVER;
75 88
	public static String RemotingLoginDialog_LABEL_ADVANCED;
76 89
	public static String RemotingLoginDialog_LABEL_CDM_INSTANCE;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/EditPasswordElement.java
22 22
import eu.etaxonomy.cdm.api.service.IUserService;
23 23
import eu.etaxonomy.cdm.model.common.User;
24 24
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
25
import eu.etaxonomy.taxeditor.Messages;
25 26
import eu.etaxonomy.taxeditor.model.MessagingUtils;
26 27
import eu.etaxonomy.taxeditor.store.CdmStore;
27 28
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
......
51 52
		Label label = formFactory.createLabel(getLayoutComposite(), null);
52 53
		addControl(label);
53 54

  
54
		String buttonLabelString = (labelString != null) ? labelString : "Change Password";
55
		String buttonLabelString = (labelString != null) ? labelString : Messages.PasswordWizardPage_CHANGE_PASSWORD;
55 56

  
56 57
		button = formFactory.createButton(getLayoutComposite(), buttonLabelString, SWT.PUSH);
57 58
		button.setLayoutData(LayoutConstants.RIGHT());
......
63 64
	@Override
64 65
	public void widgetSelected(SelectionEvent e) {
65 66
		if(!CdmStore.getService(IUserService.class).userExists(user.getUsername())) {
66
			MessagingUtils.warningDialog("Username does not exist", this, "Please create or save user '" + user.getUsername() + "' before changing password");
67
			MessagingUtils.warningDialog(Messages.EditPasswordElement_USERNAME_DOES_NOT_EXIST, this, String.format(Messages.EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER, user.getUsername()));
67 68
		} else {
68 69
			PasswordWizard wizard = new PasswordWizard(user, conversation);
69 70
			WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizard.java
20 20
import eu.etaxonomy.cdm.api.service.IUserService;
21 21
import eu.etaxonomy.cdm.model.common.User;
22 22
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
23
import eu.etaxonomy.taxeditor.Messages;
23 24
import eu.etaxonomy.taxeditor.model.MessagingUtils;
24 25
import eu.etaxonomy.taxeditor.store.CdmStore;
25 26
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
......
43 44
	public PasswordWizard(User user, ConversationHolder conversation){
44 45
		this.conversation = conversation;
45 46
		this.user = user;
46
		setWindowTitle("Change password");
47
		setWindowTitle(Messages.PasswordWizardPage_CHANGE_PASSWORD);
47 48
	}
48 49

  
49 50
	@Override
......
60 61
		ConversationHolder internalConversation = CdmStore.getCurrentApplicationConfiguration().NewConversation();
61 62
	    internalConversation.bind();
62 63
	    internalConversation.startTransaction();
63
		try{
64
		String warningTitle = Messages.PasswordWizard_COULD_NOT_CHANGE_PWD;
65
        String warningMessage = Messages.PasswordWizard_OLD_PWD_INCORRECT;
66
        try{
64 67
			if(passwordPage.isChangingOwnPassword()){
65 68
			    // change own password with validating of old one
66 69
				CdmStore.getService(IUserService.class).changePassword(passwordPage.getOldPassword(), passwordPage.getNewPassword());
......
74 77
		    internalConversation.close();
75 78
			return true;
76 79
		}catch(AccessDeniedException e){
77
			MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
80
			MessagingUtils.warningDialog(warningTitle, this, warningMessage);
78 81
			return false;
79 82
		}catch (AuthenticationException e){
80
			MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
83
			MessagingUtils.warningDialog(warningTitle, this, warningMessage);
81 84

  
82 85
			return false;
83 86
		}catch(Exception e){
84
			MessagingUtils.warningDialog("Problem with changing password", this, "The password could not be changed. " + e.getMessage());
87
			MessagingUtils.warningDialog(Messages.PasswordWizard_PROBLEM_WITH_CHANGING_PWD, this, Messages.PasswordWizard_PWD_COULD_NOT_BE_CHANGED + e.getMessage());
85 88
			return false;
86 89
		}finally{
87 90
		    if(conversation != null){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizardPage.java
20 20

  
21 21
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
22 22
import eu.etaxonomy.cdm.model.common.User;
23
import eu.etaxonomy.taxeditor.Messages;
23 24
import eu.etaxonomy.taxeditor.store.CdmStore;
24 25
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
25 26
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
......
35 36
 */
36 37
public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implements ModifyListener{
37 38

  
38
	public static final String NAME = "USER_WIZARD_PAGE";
39

  
40 39
	private TextWithLabelElement text_oldPassword;
41 40
	private TextWithLabelElement text_password;
42 41
	private TextWithLabelElement text_passwordRepeat;
......
48 47

  
49 48
		passwordValidator = new PasswordValidator();
50 49

  
51
		setTitle("Change password");
52
		setDescription("Change password and confirm with current password");
50
		setTitle(Messages.PasswordWizardPage_CHANGE_PASSWORD);
51
		setDescription(Messages.PasswordWizardPage_CHANGE_PASSWORD_AND_CONFIRM);
53 52
	}
54 53

  
55 54
	@Override
......
63 62
		WizardPageRootElement rootElement = new WizardPageRootElement(formFactory, control, getConversationHolder());
64 63

  
65 64
		if(isChangingOwnPassword()) {
66
		    text_oldPassword = formFactory.createTextWithLabelElement(rootElement, "Old Password", null, SWT.PASSWORD);
65
		    text_oldPassword = formFactory.createTextWithLabelElement(rootElement, Messages.PasswordWizardPage_OLD_PASSWORD, null, SWT.PASSWORD);
67 66
		}
68
		text_password =  formFactory.createTextWithLabelElement(rootElement, "New Password", null, SWT.PASSWORD);
69
		text_passwordRepeat =  formFactory.createTextWithLabelElement(rootElement, "Repeat Password", null, SWT.PASSWORD);
67
		text_password =  formFactory.createTextWithLabelElement(rootElement, Messages.PasswordWizardPage_NEW_PASSWORD, null, SWT.PASSWORD);
68
		text_passwordRepeat =  formFactory.createTextWithLabelElement(rootElement, Messages.PasswordWizardPage_REPEAT_PASSWORD, null, SWT.PASSWORD);
70 69

  
71 70
		((Text)text_passwordRepeat.getMainControl()).addModifyListener(this);
72 71

  
......
109 108

  
110 109
	private class PasswordValidator implements IInputValidator{
111 110

  
112
		private static final int PW_MIN_LENGTH = 5;
111
		private final int PW_MIN_LENGTH = 5;
113 112

  
114
		private static final String TO_SHORT = "Password has to have at least " + PW_MIN_LENGTH + " characters";
115
		private static final String NO_MATCH = "The passwords do not match";
113
		private final String TO_SHORT = String.format(Messages.PasswordWizardPage_PASSWORD_MIN_CHARACTER, PW_MIN_LENGTH);
114
		private final String NO_MATCH = Messages.PasswordWizardPage_PASSWORDS_DO_NOT_MATCH;
116 115

  
117 116
		@Override
118 117
        public String isValid(String newText) {

Also available in: Unified diff