From 48fccec0e9ed2f2da53207c6ecabf2780c3a194c Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Tue, 18 Sep 2018 14:23:05 -0700 Subject: [PATCH] Set default locale when creating account based on setting in wise.properties. --- .../web/controllers/student/StudentAccountController.java | 1 + .../web/controllers/teacher/TeacherAccountController.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/org/wise/portal/presentation/web/controllers/student/StudentAccountController.java b/src/main/java/org/wise/portal/presentation/web/controllers/student/StudentAccountController.java index 7c1b436b67..6058f4b656 100644 --- a/src/main/java/org/wise/portal/presentation/web/controllers/student/StudentAccountController.java +++ b/src/main/java/org/wise/portal/presentation/web/controllers/student/StudentAccountController.java @@ -115,6 +115,7 @@ public synchronized String createStudent( birthday.set(Calendar.MONTH, birthmonth-1); // month is 0-based birthday.set(Calendar.DATE, birthdate); userDetails.setBirthday(birthday.getTime()); + userDetails.setLanguage(wiseProperties.getProperty("defaultLocale", "en")); studentAccountFormValidator.validate(accountForm, result); if (result.hasErrors()) { diff --git a/src/main/java/org/wise/portal/presentation/web/controllers/teacher/TeacherAccountController.java b/src/main/java/org/wise/portal/presentation/web/controllers/teacher/TeacherAccountController.java index 5b229aab86..1510b0840a 100644 --- a/src/main/java/org/wise/portal/presentation/web/controllers/teacher/TeacherAccountController.java +++ b/src/main/java/org/wise/portal/presentation/web/controllers/teacher/TeacherAccountController.java @@ -169,6 +169,7 @@ protected String createNewTeacher( try { userDetails.setDisplayname(userDetails.getFirstname() + " " + userDetails.getLastname()); userDetails.setEmailValid(true); + userDetails.setLanguage(wiseProperties.getProperty("defaultLocale", "en")); User createdUser = this.userService.createUser(userDetails); NewAccountEmailService newAccountEmailService = new NewAccountEmailService(createdUser, request.getLocale(), request); Thread thread = new Thread(newAccountEmailService);