Entering content frame

Procedure documentation Translating Text Resources into Other Languages

 

This graphic is explained in the accompanying text

In the current version of the Sneak Preview, an error occurs when you save the *.xlf files. For this reason, you cannot translate the English texts into German as described below under Translating *_de.xlf.

 

In Web Dynpro, the text elements created at design time are isolated in resource bundles.

*.xlf files are created for the following Web Dynpro elements. The corresponding texts are saved and isolated in these files:

  • MessagePool

This graphic is explained in the accompanying text <Web Dynpro Component Name>MessagePool.wdmessagepool.xlf

  • View

This graphic is explained in the accompanying text <View Name>.wdview.xlf

This graphic is explained in the accompanying text <View Name>.wdcontroller.xlf (text of the actions, for example)

  • Window

This graphic is explained in the accompanying text <Window Name>.wdwindow.xlf (title of the window, for example)

  • SimpleType

This graphic is explained in the accompanying text <SimpleType Name>.dtsimpletype.xlf

 

To internationalize the Web Dynpro application, copy the automatically generated *.xlf files and save them under a new name in the same directory. The new name must meet the following convention:

Choose an appropriate language key. For example, if you are creating *.xlf files for German, use the language key de.

You can edit and translate these new *.xlf files in the S2X Editor.

 

Procedure

The following section describes how you add English and German texts to the example application.

You can also add other languages (such as Spanish) to the application. Just use the appropriate translations and language keys in the following steps.

Copying the *.xlf Files

...

       1.      To copy the automatically generated *.xlf files, and save them under new language keys, switch to the Package Explorer.

       2.      Open the This graphic is explained in the accompanying textsrc/packages directory (choose TutWD_Languages_Init ® src/packages). Open both This graphic is explained in the accompanying textcom.sap.tut.wd.languages and This graphic is explained in the accompanying textcom.sap.tut.wd.languages.simpletypes. These two directories contain all *.xlf files that belong to the application.

This graphic is explained in the accompanying text

       3.      In the context menu of the This graphic is explained in the accompanying textFormView.wdcontroller.xlf file, choose This graphic is explained in the accompanying textCopy.

       4.      In the context menu of the This graphic is explained in the accompanying textcom.sap.tut.wd.languages directory, choose This graphic is explained in the accompanying textPaste.

       5.      In the next dialog box, add _de before .xlf and choose OK.

 This graphic is explained in the accompanying text

       6.      Repeat steps 5-6 for English (enter _en before .xlf).

       7.      Repeat steps 3-6 for the following files:

¡        This graphic is explained in the accompanying textFormView.wdview.xlf

¡        This graphic is explained in the accompanying textLanguagesCompMessagePool.wdmessagepool.xlf

¡        This graphic is explained in the accompanying textLocation.dtsimpletype.xlf

¡        This graphic is explained in the accompanying textVehicleType.dtsimpletype.xlf

¡        This graphic is explained in the accompanying textReturnDate.dtsimpletype.xlf

Insert the copies of VehicleType and ReturnDate in the This graphic is explained in the accompanying textcom.sap.tut.wd.languages.simpletypes directory.

This graphic is explained in the accompanying text

 

Translating the *_de.xlf Files

The TutWD_Languages_Init project has been created in the project language American English. You define this default language when you create a new Web Dynpro project. For this reason, all text input in the tutorial has been in English up to now. The *.xlf files that are not assigned to a specific language are used as default values.

Since the *.xlf files without language keys are already defined for English texts, you do not need to translate the resource bundles with the language key _en.

...

       1.      Open the file This graphic is explained in the accompanying textFormView.wdcontroller_de.xlf by double-clicking it. This file is displayed in the S2X Editor.

       2.      On the Header tab page, change the source language to German by selecting this language from the dropdown list.

       3.      Switch to the Resource Text tab page. In the Action:Rent@text row, go to the Action:Rent@text column and translate Rent as Mieten. Choose Enter to confirm your entries.

This graphic is explained in the accompanying text

       4.      Save the change by choosing the This graphic is explained in the accompanying text icon in the toolbar.

       5.      Repeat steps 1-4 for the following files:

·         FormView.wdview_de.xlf

·         LanguagesCompMessagePool.wdmessagepool_de.xlf

·         Location.dtsimpletype_de.xlf

·         VehicleType.dtsimpletype_de.xlf

·         ReturnDate.dtsimpletype_de.xlf

Use the following translations:

English Text

German Text

This graphic is explained in the accompanying text FormView.wdview_de.xl f

Pickup Date

Abholdatum

Rental Settings

Mietwagen Buchung

This graphic is explained in the accompanying text LanguagesCompMessagePool.wdmessagepool_de.xlf

You have chosen a cabriolet.

Sie haben ein Cabriolet gemietet.

You have chosen a van.

Sie haben einen Van gemietet.

You have chosen a first class car.

Sie haben einen Luxusklasse Wagen gemietet.

You have chosen an economy class car.

Sie haben einen Economyklasse Wagen gemietet.

You have chosen a business class car.

Sie haben einen Mittelklasse Wagen gemietet.

Please choose a vehicle type!

Bitte geben Sie einen Fahrzeugtyp an!

This graphic is explained in the accompanying text VehicleType.dtsimpletype_de.xl f

Cabriolet

Cabriolet

Economy

Economy

Van

Van

Business

Mittelklasse

First Class

Luxusklasse

Vehicle Type

Fahrzeugtyp

Choose a vehicle type.

Wählen Sie einen Fahrzeugtyp.

This graphic is explained in the accompanying text ReturnDate.dtsimpletype_de.xlf

ReturnDate

Rückgabedatum

Choose a date

Wählen Sie ein Rückgabedatum.

This graphic is explained in the accompanying text Location.dtsimpletype_de.xlf

Pickup Location

Abholort

Choose a pickup location

Wählen Sie einen Abholort.

 

Result

You have made the example application available in English and German.

 

Next step:

Defining Language-Specific Application Properties

 

Leaving content frame