- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 05:58 PM
I am using getDisplayValue() to get the label name of a field.
However, it is retrieved in English.
How can I get it in Japanese?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 07:10 PM
Can write a script include to get the choice labels in specified language and use that.
Example:
var ChoiceHelper2 = Class.create();
ChoiceHelper2.prototype = {
initialize: function() {
},
getChoice: function(table, value, lang) {
var grChoice = new GlideRecord('sys_choice');
grChoice.addQuery('name', table);
grChoice.addQuery('value', value);
grChoice.addQuery('language', lang);
grChoice.query();
if (grChoice.next()) {
return grChoice.label;
}
},
type: 'ChoiceHelper2'
};
Test:
var choiceHelper = new ChoiceHelper2();
var label = choiceHelper.getChoice('incident', 'request', 'ja');
gs.info(label);
Result:
*** Script: 要求

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 06:39 PM
Try
gs.getMessageLang('message_key', 'ja');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 06:45 PM
Not sure of the question. getDisplayValue() is used to get the value of the field.
Following code can be used to get the message in specified language.
gs.getMessageLang('message_key', 'language_id');
The label should be translated depending on the language set in user's profile. If it is desired to get a label in a different language then the chosen lang, label names are stored in sys_documentation table so it is possible to query this table to get the label string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 06:48 PM
I didn't word it well, but we are getting the label name of the choices.
I want to get the Japanese label name of the choices.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 06:50 PM
Choices should also be translated depending on user's selected language in user's profile.
Check choices table sys_choice to make sure the translation are there.