Show TOC

 Changing Labels for PropertiesLocate this document in the navigation structure

Use

The use of bundle files allows you to modify labels as well as localize the language.

The following example shows how to use targeted labels for particular languages and how to swap the English label Read only of the cm_readonly property with the label Write protected.

 

Prerequisites

You have worked through the steps that are described in Creating an Example Project in SAP NetWeaver Developer Studio .

 

Procedure

 

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

    <bundle file name>_<language>.properties

    For example: 

    my-labels_de.properties

    my-labels_es.properties

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

    my-labels.properties

 

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

     

    Note

    You can find the keys of existing properties in the configuration (parameter Key for Label).

 

For example:

For the German bundle file my-labels_de.properties:

cm_readonly=Schreibgeschützt

For the Spanish bundle file my-labels_es.properties:

cm_readonly=Solo lectura

For the default bundle file my-labels.properties:

cm_readonly=Write protected

 

Note

Remember to use Unicode notation for umlauts and special characters. Below are some examples for German umlauts:

\u00E4 =ä

\u00C4 =Ä

\u00DF =ß

\u00F6 =ö

\u00D6 =Ö

\u00FC =ü

\u00DC =Ü

Do not use spaces in keys. Use underscores instead.

 

  1. Build and deploy the SDA file that contains the bundle files (see Building and Deploying Development Components ).

 

  1. In the portal, choose System Administration → System Configuration → Knowledge Management → Content Management → Global Services → Property Metadata → Metadata Extensions and create a new metadata extension.

    For example, my_metadata_extension.

    Enter the name of the bundle file from step one with the package structure, but without the extension:

    For example, Bundle File = com.<%your company name%>.km.resource.bundle.my-labels

 

  1. Call up the configuration of the property (for example, cm_readonly) under Content Management → Global Services → Property Metadata → Properties.

    In the Metadata Extension parameter, choose the metadata extension that you created in step five, for example, Metadata Extension = my_metadata_extension.

    Enter the key used in the Key for Label parameter, for example, cm_readonly, and save your entry.

 

Result

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