From: Roland Häder Date: Mon, 23 May 2016 07:21:17 +0000 (+0200) Subject: added user-specific locale. this allows the user to have hin/her language back once... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c89cc28f7a686deb0dbc80e792a3511d27d9644d;p=juser-activity-core.git added user-specific locale. this allows the user to have hin/her language back once login is done. --- diff --git a/src/org/mxchange/jusercore/model/user/LoginUser.java b/src/org/mxchange/jusercore/model/user/LoginUser.java index 523567d..a8a835d 100644 --- a/src/org/mxchange/jusercore/model/user/LoginUser.java +++ b/src/org/mxchange/jusercore/model/user/LoginUser.java @@ -17,6 +17,7 @@ package org.mxchange.jusercore.model.user; import java.util.Calendar; +import java.util.Locale; import java.util.Objects; import javax.persistence.Basic; import javax.persistence.CascadeType; @@ -129,6 +130,12 @@ public class LoginUser implements User { @Column (name = "user_last_locked_reason") private String userLastLockedReason; + /** + * User locale + */ + @Column(name = "user_locale") + private Locale userLocale; + /** * User name */ @@ -176,6 +183,7 @@ public class LoginUser implements User { this.setUserLastLocked(user.getUserLastLocked()); this.setUserUpdated(user.getUserUpdated()); this.setUserProfileMode(user.getUserProfileMode()); + this.setUserLocale(user.getUserLocale()); } @Override @@ -276,6 +284,16 @@ public class LoginUser implements User { this.userLastLockedReason = userLastLockedReason; } + @Override + public Locale getUserLocale () { + return this.userLocale; + } + + @Override + public void setUserLocale (final Locale userLocale) { + this.userLocale = userLocale; + } + @Override public String getUserName () { return this.userName; diff --git a/src/org/mxchange/jusercore/model/user/User.java b/src/org/mxchange/jusercore/model/user/User.java index 1c8692a..8bdd4c7 100644 --- a/src/org/mxchange/jusercore/model/user/User.java +++ b/src/org/mxchange/jusercore/model/user/User.java @@ -18,6 +18,7 @@ package org.mxchange.jusercore.model.user; import java.io.Serializable; import java.util.Calendar; +import java.util.Locale; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; import org.mxchange.jusercore.model.user.status.UserAccountStatus; @@ -190,9 +191,24 @@ public interface User extends Serializable { */ void setUserUpdated (final Calendar userUpdated); + /** + * Getter for user's locale + *

+ * @return User's locale + */ + Locale getUserLocale (); + + /** + * Setteror user's locale + *

+ * @param userLocale User's locale + */ + void setUserLocale (final Locale userLocale); + @Override boolean equals (final Object object); @Override int hashCode (); + }