!--a11y-->
Translating Text Resources into Other
Languages

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:
|
|
|
|
|
|
|
|
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 all *.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 of VehicleType and ReturnDate in the
com.sap.tut.wd.languages.simpletypes
directory.

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. Choose Enter to confirm your entries.

4.
Save the change by
choosing the
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 |
|
|
Pickup Date |
Abholdatum |
Rental Settings |
Mietwagen Buchung |
|
|
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.
Defining Language-Specific Application Properties
