{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":39706,"path":"platform-administration/system-localization/t_TranslateAClientScriptMessage.md","title":"Translate a client script message","bundle":null,"doc_type":null,"release":"australia","body":"\n# Translate a client script message\n\nTranslate the messages used by client scripts.\n\n## Before you begin\n\nCreate a client script that contains messages. For information about creating client scripts, see [Client scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/scripts/client-scripts.md).\n\nRole required: admin\n\n## About this task\n\nClient scripts include a multi-line Messages field, which is for message strings that the client script can use as a key to look up a localized message alternative from the Message \\[sys\\_ui\\_message\\] table. Each message key in a client script is on a separate line in the Messages field. The instance looks for a localized message string anytime the client script makes a getMessage\\(msg\\) call where the msg string matches a key in the Messages field in the client script.\n\n\\[Omitted image \"client-script-messages.png\"\\] Alt text: A client script form with message key strings in the Messages field and getMessage calls in the script field.\n\nFor example, if you add the string `Please populate the Reason` field to the Messages field in the client script, then the instance will look for a localized string from the Message `[sys_ui_message]` table any time the client script calls:\n\n`getMessage(\"Please populate the Reason field\")`\n\n**Note:** If you create a record in the Message \\[sys\\_ui\\_message\\] table that uses an existing key and the same language, the message for existing references using the key can change. For example, if a record exists with \"Refresh\" for the key, English for the language, and \"Refresh\" for the message, and you create another record with the same key and language but a different message of \"Refresh the screen\", existing UI strings using the \"Refresh\" key will display the new \"Refresh the screen\" message. Records in this table are created in the global scope and aren’t scope-restricted.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Localization** &gt; **Messages**.\n\n2.  Select **New**.\n\n3.  On the form, fill in the required fields.\n\n    |Field|Description|\n    |-----|-----------|\n    |Key|The internal unique identifier for this message.|\n    |Language|The language the message is translated into.|\n    |Message|The translated text that users see.|\n\n    \\[Omitted image \"translated-message.png\"\\] Alt text: A message form with a message key translated into Spanish.\n\n4.  Select **Submit**.\n\n    A new record is added to the Message `[sys_ui_message]` table for the localized message key string. For more information about this table, see [Message table](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/system-localization/r_MessageTable.md).\n\n\n"}}