!--a11y-->
Translating Text Resources into Other
Languages 
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:
|
|
|
|
|
|
|
|
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.
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.
...
1. To copy the automatically generated *.xlf files, and save them under new language keys, switch to the Package Explorer.
2.
Open the
src/packages directory (choose
TutWD_Languages_Init à src/packages). Open both
com.sap.tut.wd.languages and
com.sap.tut.wd.languages.simpletypes.
These two directories contain the *.xlf files that belong to the
application.

3.
In the context menu
of the
FormView.wdcontroller.xlf
file, choose
Copy.
4.
In the context menu
of the
com.sap.tut.wd.languages
directory, choose
Paste.
5. In the next dialog box, add _de before .xlf and choose OK.

6. Repeat steps 5-6 for English (enter _en before .xlf).
7. Repeat steps 3-6 for the following files:
¡
FormView.wdview.xlf
¡
LanguagesCompMessagePool.wdmessagepool.xlf
¡
Location.dtsimpletype.xlf
¡
VehicleType.dtsimpletype.xlf
¡
ReturnDate.dtsimpletype.xlf
Insert the
copies for Location, VehicleType, and ReturnDate in the directory
com.sap.tut.wd.languages.simpletypes.

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
FormView.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. Confirm with Enter.

4.
Save the change by
choosing the
icon in the toolbar.
5. Repeat steps 1-4 for the following files:
a.
FormView.wdview_de.xlf
b.
LanguagesCompMessagePool.wdmessagepool_de.xlf
c.
Location.dtsimpletype_de.xlf
d.
VehicleType.dtsimpletype_de.xlf
e.
ReturnDate.dtsimpletype_de.xlf
Use the following translations:
English Text |
German Text |
|
|
Web Dynpro I18N - Quick Car Rental |
Web Dynpro I18N – Mietwagenbuchung |
Pickup Date |
Abholdatum |
Rental Settings |
Mietwagenbuchung |
|
|
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! |
|
|
Cabriolet |
Cabriolet |
Economy |
Economy |
Van |
Van |
Business |
Mittelklasse |
First Class |
Luxusklasse |
Vehicle Type |
Fahrzeugtyp |
Choose a vehicle type. |
Wählen Sie einen Fahrzeugtyp. |
|
|
ReturnDate |
Rückgabedatum |
Choose a date |
Wählen Sie ein Rückgabedatum. |
|
|
Pickup Location |
Abholort |
Choose a pickup location |
Wählen Sie einen Abholort. |
You have made the example application available in English and German.

However, the new and modified *.xlf files only take effect when you execute Reload for the Web Dynpro project. The procedure is described under Executing and Testing the Application.
Defining Language-Specific Application Properties