LoginSignup
2
1

More than 3 years have passed since last update.

[ServiceNow] Annotation を多言語対応にする方法

Last updated at Posted at 2020-10-08

ServiceNow のフォーム上、フィールドのラベルは、Field Labels で設定することで多言語対応にできます。
セクション名は、Translated Name / Fields で sys_ui_section の caption で、英語に対する翻訳をいれることで多言語対応にすることができます。
Annotation については、以下の Docs の記事にある通り、Messages を使って多言語対応にできます。
https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/form-administration/concept/c_FormAnnotation.html
gs.getMessage を使って、Messages から取り出すようにするのですが、書き方が少し特殊ですので、ここで紹介しておきます。
「$」と「{}」を使って以下のように書くとgetMessageが Annotation で使えて、多言語対応ができるようになります。

${gs.getMessage('Message_Key')}

自分の環境で検証してみましたが、以下のキャプチャのように英語、日本語を出し分けすることができました。

英語モードの画面:
image.png

日本語モードの画面:
image.png

以上です。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1