Transition of the portal widget in some other langauge

Nisha Mishra23
Tera Contributor

We want to change the translate the widget in other language . How should we proceed with that and does this will change the form as well which are been used under that .

2 REPLIES 2

Chetna_dev
Kilo Sage

To translate a widget in ServiceNow and apply translations to the forms within the widget, follow these steps:

1. Translate the Widget:

ServiceNow provides the ability to translate widgets using Resource Bundles.

  • Create a Resource Bundle:

    1. Navigate to System UI > Resource Bundles.
    2. Create a new resource bundle with the widget's texts in different languages.
    3. Add key-value pairs for each language. For example, en for English, fr for French, etc.
  • Use Resource Bundles in the Widget: Modify the widget's HTML or client-side script to use the resource bundle keys, like this:

    html
    Copy code
    <span>{{::'resource_key_name' | i18n}}</span>

    This will ensure that the text is automatically translated based on the user’s language settings.

2. Translate Forms (Used in Widgets):

Forms (and form fields) are translated separately using Field Translations and Messages.

  • Form Field Translations:

    1. Go to System Localization > Field Translations.
    2. Add translations for fields used in forms.
    3. Ensure the translations for each language are provided for the form fields.
  • Messages Translations: Messages used within the widget or in forms can be managed in System UI > Messages.

3. Apply Translations:

  • The translations will automatically apply when a user changes their language preference in their profile (Settings > Language).
  • Both the widget and the forms used in it will reflect the appropriate translations if they are configured correctly.

if you found this helpful please accept as solution and mark helpful

best

Chetna

Unable to find resource bundle. Is there any other option by which we can do that?