Localized field name with Java API?


With the FieldManager component it easy to get a issue field:

	FieldManager fieldManager = ComponentAccessor.getFieldManager();
	Field field = fieldManager.getField(IssueFieldConstants.ISSUE_KEY);
    String fieldName = field.getName();

But how to get the localized name? (German, Spanish, Russian, etc).


Instead of field.getName(); use field.getNameKey();. This will return the i18n key. Then retrieve the actual translated string with the i18nHelper. Hope this helps.

Edit: According to the JavaDoc, field.getName() already returns the i18n’ed string.