get preference language?

Juan Ramirez March 19, 2014

How can i get the userPreferences, being more specific the language a user select's in the profile window?, i am looking for information about the use of UserPreferencesManager, included in Jira 6.1.7 Api.

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2014

Here's a sample if I understood correctly:

String userLocale = ComponentAccessor.getUserPreferencesManager().getExtendedPreferences(user).getString(PreferenceKeys.USER_LOCALE)

0 votes
Juan Ramirez March 20, 2014

I have tried it, and it function well like you said, thanks for the help.

0 votes
Juan Ramirez March 20, 2014

hello, i have type the last answer and the result of userLocale in a local enviroment is "null". i have verify with debugger the field user and it is correct.

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2014

The value will be null if the locale is equal to the default user locale. If that's the case try setting different locale and then see what will the code I've suggested will produce.

TAGS
AUG Leaders

Atlassian Community Events