diff --git a/src/main/java/DataverseUserBundle.properties b/src/main/java/DataverseUserBundle.properties new file mode 100644 index 00000000000..1e5a6ec9b59 --- /dev/null +++ b/src/main/java/DataverseUserBundle.properties @@ -0,0 +1,65 @@ +# Internationalization for dataverseuser.xhtml and DataverseUserPage.java +# + +# for dataverseuser.xhtml +# pageTitle +pageTitleText=User + + +# the Edit Account button +editAccountButton=Edit Account +accountInformationText=Account Information +passwdText=Password + + +# msgs about losting password +lostPasswdMsg=If you have lost or forgotten your password, please enter your username or email address below and click Submit. We will send you an e-mail with your new password. + + +# data related to me tab and Notifications tab +dataRelatedToMeTab=Data Related To Me +notificationsTab=Notifications + + +# msgs about notifications +wasCreatedInText=,was created in +wasAddedToText=, was added to +toPublishText=. Don't forget to publish it! +welcomeToDataverseText=Welcome to Dataverse 4.0 Beta! Please take a look around, try everything out, and check out our +googleGroupText= Google Group +toLeaveFeedbackText= to leave feedback. +removeNotificationText=Remove notification + + +# sign up , edit Account and change password +userNameText=Username +retypePasswdText=Retype Password +firstNameText=First Name +lastNameText=Last Name +emailText=Email +affiliationText=Affiliation +positionText=Position + +currentPasswdText=Current Password +newPasswdText=New Password + +submitButton=Submit +cancelButton=Cancel + +createAccountButton=Create Account +saveChangesButton=Save Changes + + + +# for DataverseUserPage.java + +usernameIsTakenMsg=This Username is already taken. +usernameOrEmailisIncorrectMsg=Username or Email is incorrect. +passwdIsIncorrectMsg=Password is incorrect. + + + + + + + diff --git a/src/main/java/ValidationMessages.properties b/src/main/java/ValidationMessages.properties new file mode 100644 index 00000000000..cfe2cf57fce --- /dev/null +++ b/src/main/java/ValidationMessages.properties @@ -0,0 +1,4 @@ +# msgs from bean validator + +# from DataverseUserPage.java +validator.enterPasswdMsg=Please enter a password for your account. \ No newline at end of file diff --git a/src/main/java/edu/harvard/iq/dataverse/DataverseUserPage.java b/src/main/java/edu/harvard/iq/dataverse/DataverseUserPage.java index 7b262127f31..73f556c3b2b 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DataverseUserPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DataverseUserPage.java @@ -20,6 +20,7 @@ import javax.inject.Named; import org.hibernate.validator.constraints.NotBlank; import org.primefaces.event.TabChangeEvent; +import java.util.ResourceBundle; /** * @@ -50,10 +51,10 @@ public enum EditMode { private DataverseUser dataverseUser; private EditMode editMode; - @NotBlank(message = "Please enter a password for your account.") + @NotBlank(message = "{validator.enterPasswdMsg}") private String inputPassword; - @NotBlank(message = "Please enter a password for your account.") + @NotBlank(message = "{validator.enterPasswdMsg}") private String currentPassword; private Long dataverseId; private String permissionType; @@ -61,6 +62,8 @@ public enum EditMode { private List notificationsList; private int activeIndex; private String selectTab = "somedata"; + + ResourceBundle resourceBundlePageInfo=ResourceBundle.getBundle("DataverseUserBundle"); public DataverseUser getDataverseUser() { if (dataverseUser == null) { @@ -198,7 +201,7 @@ public void validateUserName(FacesContext context, UIComponent toValidate, Objec } if (userNameFound) { ((UIInput) toValidate).setValid(false); - FacesMessage message = new FacesMessage("This Username is already taken."); + FacesMessage message = new FacesMessage(resourceBundlePageInfo.getString("usernameIsTakenMsg")); context.addMessage(toValidate.getClientId(context), message); } } @@ -217,7 +220,7 @@ public void validateUserNameEmail(FacesContext context, UIComponent toValidate, } if (!userNameFound) { ((UIInput) toValidate).setValid(false); - FacesMessage message = new FacesMessage("Username or Email is incorrect."); + FacesMessage message = new FacesMessage(resourceBundlePageInfo.getString("usernameOrEmailisIncorrectMsg")); context.addMessage(toValidate.getClientId(context), message); } } @@ -227,7 +230,7 @@ public void validatePassword(FacesContext context, UIComponent toValidate, Objec String encryptedPassword = PasswordEncryption.getInstance().encrypt(password); if (!encryptedPassword.equals(dataverseUser.getEncryptedPassword())) { ((UIInput) toValidate).setValid(false); - FacesMessage message = new FacesMessage("Password is incorrect."); + FacesMessage message = new FacesMessage(resourceBundlePageInfo.getString("passwdIsIncorrectMsg")); context.addMessage(toValidate.getClientId(context), message); } } diff --git a/src/main/webapp/WEB-INF/faces-config.xml b/src/main/webapp/WEB-INF/faces-config.xml index 539867c273b..f5ede1a7eeb 100644 --- a/src/main/webapp/WEB-INF/faces-config.xml +++ b/src/main/webapp/WEB-INF/faces-config.xml @@ -10,4 +10,11 @@ edu.harvard.iq.dataverse.FileUploadRenderer + + + en + zh_CN + ja + + \ No newline at end of file diff --git a/src/main/webapp/dataverseuser.xhtml b/src/main/webapp/dataverseuser.xhtml index 5f0bee0db0d..2879d9b1ae9 100644 --- a/src/main/webapp/dataverseuser.xhtml +++ b/src/main/webapp/dataverseuser.xhtml @@ -10,11 +10,13 @@ - + + + @@ -44,7 +46,7 @@
@@ -78,12 +80,12 @@ - + - + - +
@@ -115,34 +117,34 @@ - + - + - + - + - + - + - + - +
@@ -151,16 +153,16 @@
- +
- - - + + + @@ -171,34 +173,34 @@ - + - + - - + + - + - + - + - - - + + + @@ -207,8 +209,8 @@ - - + + @@ -216,8 +218,8 @@ - - + + @@ -226,7 +228,7 @@ - + @@ -235,7 +237,7 @@ - + @@ -247,9 +249,9 @@
- - - + + +