How can i change language in jira from Jira API in Java ?

Hi Guys.

How can i change default language for user in jira from Jira API in Java ?

I must do it in my own plugin.

Thanks for any help.



3 answers

2 votes

Are you sure this is necessary? The default language is a one-off setting which your admin will generally set during installation. It's rare to need to change it again, and even then you really really want your admins to do it because they'll think about it. I'd never use a plugin that did that because I absolutely do not want the default language to change without me doing it explicitly.

Hi Mik,

Here's how I do:

private Locale getLocale(User user)
		if (user == null)
			return Locale.getDefault();
		String userLocaleString = getUserPreferencesManager().getPreferences(user).getString(PreferenceKeys.USER_LOCALE);
		if (userLocaleString == null)
			return Locale.getDefault();
		StringTokenizer tokenizer = new StringTokenizer(userLocaleString, "_");
		String language = tokenizer.nextToken();
		String region = tokenizer.nextToken();
		if (language != null && region != null)
			return new Locale(language, region);
			return Locale.getDefault();

As you can see my entry point is a User (com.atlassian.crowd.embedded.api.User), and from this I get its locale (its locale is the language the user set in its preferences).

Then I instantiate a I18NHelper with this locale:


So that the language used to display 18N Strings is the one set by the user if any, or JIRA server language if user language is not set,

Hope this helps,


I understood the need was to display strings depending on the language set by user...

I suspect your understanding was better than mine. The use of the word "default" made me jump because it's rather upsetting for admins to have things they've chosen changed without warning.

But, setting an individual user's preferred language from their chosen region is a friendly and useful thing to do.

This doesn't change the default language for a user, it sets their preference for them based on their chosen location. (Which is really nice)

Yes I agree, I find this more logical to have a language set for the whole instance, and then let users define another one if they want to. The code I pasted is to make a plugin sensitive to this user setting.

Hi Frédéric,

This is exectly what I needed.

Thanks for discusion guys.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,166 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you