Using Bundle Files for Multilingual Texts

Prerequisites

In the SAP NetWeaver Developer Studio, you have created a project for Web forms. You can easily create a project by using the example project provided by SAP.

Context

When creating new configuration objects that are required for use in your new Web forms, you can specify bundle files that contain keys and labels for translation purposes.

If the system cannot find a key label pair in a referenced customer-specific bundle file, it searches for the bundle files delivered by SAP. If the system cannot find a suitable key label pair there either, it displays only the technical names of the configuration object.

Procedure

  1. In the SAP NetWeaver Developer Studio, create a bundle file in your project for each language. Note the following conventions:

    <bundle file name> _ <language> .properties

    You also need a bundle file for the default language (usually English).

  2. Create entries for the labels of properties in these files. The entries must have the form key=label .

    In each of the property files you have to maintain a key label pair for all labels for which you need a language-specific translation, or for which you require a display name instead of a technical ID.

  3. Configure the following three keys for the relevant property files:
    1. Configure the key that is used for displaying the label of the new Web form commands and for displaying the label of the new Web form in the container description.

    2. Configure the key that is used for displaying the name of the Web Form in the editor.

    3. Configure the key for the name of the Web Form that is displayed in Preview mode.

    You must use the following prefixes for certain keys:

    • Keys for the title of the Web resource type in the editor:

      cod.xtit. <technical name of the Web resource type>

      For example: cod.xtit.company_news = Company News

    • Keys for a Web resource type in the list of permitted Web resource types in a container:

      cod.xlbl. <technical name of the Web resource type>

      For example: cod.xlbl.company_news = Company News

    You can find the key for the name of an element in a Web form in the associated XML file. The key corresponds to the description attribute for the <elements> XML element.

  4. (Optional) If you want to use your own keys for elements or properties in the XML file, you need to maintain the key label pairs additionally in your bundle property file.

    You can reuse the keys for elements or properties provided by SAP without needing to reference them in your bundle file. The system checks if a bundle file for the keys is available and uses it.

  5. Export and deploy the EAR file that contains the bundle files.
  6. In the configuration of the following configuration objects, enter the name of the bundle file from step 1 with the package structure, but without the extension:

Results

The label for the command is now displayed in the portal language on the interface. If there is no bundle file for the language set, the label is displayed in the language of the default bundle file (English).