You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, I'm trying to to create sample data when the user signup.
I did it on the method save(Identity) of the UserService but the problem is that on this method I don't have the user language, context or even the request to translate the sample data.
How can I get the user language? I've used the code below but it always bring my machine language (Locale.getDefault()):
if (play.mvc.Http.Context.current.get() != null) {
lang = play.mvc.Http.Context.current().lang();
logger.debug("Has a Context!!" + lang);
} else {
logger.debug("No Context!! :(");
Locale defaultLocale = Locale.getDefault();
lang = new Lang(defaultLocale.getLanguage(), defaultLocale.getCountry());
}
Is there a correct / better place to do that? Can I access the user language on that place?
The text was updated successfully, but these errors were encountered:
antonini
added a commit
to antonini/securesocial
that referenced
this issue
Apr 16, 2014
Well, I'm trying to to create sample data when the user signup.
I did it on the method save(Identity) of the UserService but the problem is that on this method I don't have the user language, context or even the request to translate the sample data.
How can I get the user language? I've used the code below but it always bring my machine language (Locale.getDefault()):
Is there a correct / better place to do that? Can I access the user language on that place?
The text was updated successfully, but these errors were encountered: