Create Translation Keys

As you develop your App UI, you'll need to enter text for any new headings, labels, and messages you add. To make sure these text strings are translated, you'll need to create a translation key for each new translatable string.

You can do this in one of two ways. You can open the New String popup from your App UI translation bundle. Or, you can create a new translation key from the Properties pane for a new UI component and bind it to the component. In either case, you'll provide a key value, the translatable string, and a description. The description provides your translators with additional context.

You can also provide custom metadata for a translation key as well as placeholder metadata for strings that include expressions. Access these fields from the Properties pane for a translation key when you select it from your App UI's translation bundle.

Strings can be either static values or expressions written in International Components for Unicode (ICU) format. If you want to use an expression in a translatable string, see Use an Expression in a Translatable String.

Once you’ve added a string to your translation bundle, you can associate it with a UI component using the Translatable String popup available from the component's Properties pane.

If the string you want to use has already been saved, you don’t need to add it here. You can just search for and select it using the Translatable String popup when you add the UI component.

Note:

This task describes how to create a translation key from a translation bundle. For the steps to create a translation key from a component's Properties pane, see Associate a Translation Key with a UI Component.

To create a key for a translatable string from your translation bundle:

  1. Open the Translations pane using the Translations icon (Translations) in the Navigator.
    The Translation pane displays a list of the bundles for the App UI you are creating as well as any for the App UI you are extending under From Dependencies.
  2. Select a translation bundle to open it in the canvas.
  3. Click + String from the top right of the translation bundle page to open the New String dialog.
  4. Enter a unique value in the Key field, then type the string you want to save in the String Editor.
    If you enter an expression, VB Studio parses the string as you type to check that it is syntactically correct. If there are errors, these are displayed below along with a preview of the string.
  5. When you're satisfied, click Create.
    The translatable string is added to the translation bundle.
  6. To add a description for the string, select the key from the list and type a description in the Properties pane.


    The Description field can provide additional context for the string that can be useful to translators when translating the string.

  7. To add custom metadata, click Add beside Custom Metadata and enter a key and value in the available fields.


    You can add any information here that helps others understand the purpose or context of the translation key.

  8. If there are placeholders in the translatable string, you can add placeholder metadata here. Click Add beside Placeholders and enter a placeholder name and description for each placeholder in your expression.
    For more information about placeholder metadata, see Use an Expression in a Translatable String.