Localized field name with Java API?

Hi,

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).

Thanks,
Pablo

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.