Show TOC Start of Content Area

Object documentation Creating Language-Dependent Resources at Design Time  Locate the document in its SAP Library structure

Overview

Language-specific resources that you specify as a declaration at runtime include text elements that you assign to a UI element, for example. These declaratively specified texts are stored in a properties file. The SAP NetWeaver Developer Studio supports the creation of the resource bundles or the properties files and generates corresponding properties files and S2X files that are relevant for the SAP translation process. While the properties files are loaded at runtime and are therefore available to the Web Dynpro application, the S2X files are used solely for the translation process.

Use

Within a Web Dynpro project, you create – on the one hand – a properties file with the name Resource+<Web-Dynpro-Component-Name>.properties. This contains texts that were defined within a Web Dynpro component. On the other hand, you create a properties file with the name simpleTypesResource.properties. This contains texts that were defined when data types were created in the Dictionary.

The following language-dependent files are generated when data types are created in the Dictionary.

·        An appropriate properties file that has the name simpleTypesResource.properties

·        An S2X file for each created data type with the name <Simple-Type-Name>.dtsimpletype.xlf

 

The following language-dependent files are generated for a Web Dynpro component:

·        A corresponding properties file that has the name Resource+<Web-Dynpro-Component-Name>.properties
For example, this file runs under the name ResourceTest.properties if you have created a Web Dynpro component with the name “Text”.

Note

At runtime, the relevant properties file can be loaded dynamically, depending on the language ID of the current user. If the Web Dynpro application requires user authentication, the language indicator is determined through the user who is logged on. If no user authentication is required for the Web Dynpro application, the language indicator of the Browser is used for selection of the properties file. For more information on the search for the required properties file, refer to Determining the Required Resource Bundle.

·        Various S2X files that support the translation process with the name:

¡        View Layout: <View Name>.wdview.xlf when creating a Web Dynpro component (for example, text for pushbuttons)

¡        View Controller: <View-Name>.wdcontroller.xlf (for example, text for actions)

¡        Message Pool: <Web-Dynpro-Component-Name>MessagePool.wdmessagepool.xlf for creating a message pool

These S2X files contain context information required for a correct translation. The context information tells you which user interface element is to display the text and how long the text is allowed to be for the relevant UI element. For example, for the UI element TextView, the text can be no longer than 16384 characters. Then, the properties files are automatically converted to S2X files with the extension .xlf. The resources can be processed in the translation process supported by SAP in this format only. The S2X files contain additional context information that is very important for the correct translation of the resources.

Storage Location of the Properties Files

The properties files for a Web Dynpro component are in the directory /gen_wdp/packages under the name of the respective Web Dynpro component.

The properties files for the Dictionary data types are in the directory /gen_ddic/datatypes.

See also: Internationalization of a Web Dynpro Application.

Example

A properties file contains simple name/value pairs for a specific language ID, as the following example of a properties file ResourceTestMessagePool.properties (generated automatically by the SAP NetWeaver Developer Studio) shows:

---------------------------------------------------------------------------

# This file has been generated by the Web Dynpro Code Generator

# DON'T MODIFY!!! CHANGES WILL BE LOST WHENEVER THE FILE GETS GENERATED AGAIN

# ---------------------------------------------------------------------------

 

 

# Resource bundle for TestMessagePool

 

 

# message pool

message.error1 = Meldungstext f\u00fcr Meldungstyp "error"

message.standard1 = Meldungstext f\u00fcr Meldungstyp "standard"

message.warning1 = Meldungstext f\u00fcr Meldungstyp "warning"

 

# view TestViewInternationalization

view.TestViewInternationalization.Button_1.text = Save

view.TestViewInternationalization.DefaultTextView.text = Test to Describe the Internationalization Process

 

The properties file in the Web Dynpro example component TestMessagePool contains all messages created using the Message Editor and all texts assigned to the UI elements as key/value pairs. For example, the value „Test to Describe the Internationalization Process” is assigned to the text property of the pushbutton UI element with the name Button_1, which is inserted into the view “TestViewInternationalization”.

  

  

 

End of Content Area