Whenever you create a UI text entity that can hold language-specific content, and you use the appropriate Web Dynpro tool, this UI text is automatically stored in a resource file. For each type of UI text entity, a corresponding resource file is created. These files are of S2X format and use the XLF file extension. To edit XLF files, you use the S2X Editor.
The following UI texts create XLF files:
UI Text Entity |
Description |
XLF File |
UI element |
text, tooltip, and imageAlt values in a view layout |
<view>.wdview.xlf |
User message |
Created with the Message Editor tool |
<WDcomponent>MessagePool. wdmessagepool.xlf |
Window title |
Title value of window property |
<window>.wdwindow.xlf |
Action text |
Action object created in a view controller. Displayed with the UI element that triggers the action |
<view>.wdcontroller.xlf |
Dictionary simple types |
Enumeration description, field label, column header, and quick info |
<simple type>.dtsimpletype.xlf |
These XLF files contain the texts in the language that you determined when you created the Web Dynpro project. For every language version other than this original language, you create a copy of the XLF file and enter the language-specific translations.
Languages other than the original language are referred to as source languages.
If you change or add UI text entities, after the corresponding language-specific XLF file has been created, only the XLF files for the original language are automatically updated. The XLF files for source languages remain unchanged. You must update the language-specific XLF files manually.
WD Project and WD Component have been defined.
...
1. Create user messages, UI element texts, or dictionary simple types as usual.
With this, you automatically create the XLF files in the original language.
2. Switch to the Navigator view of the Developer Studio. In the current Web Dynpro project, open the following paths:
○ src/packages/com/sap/demo/ <wd development component>/<wd application>/comp
○ src/packages/<simple type package>
3. Copy all XLF files within their directory. Rename the copied files’ names adding an underscore ( _ ) and the appropriate language-specific two character locale value before the XLF file extension
You must enter the locale value in lower case. Do not modify the original name of the XLF file except for this language-specific addition.
E.g. change the copied files’ names of file wdview.xlf to
○ wdview_en.xlf for English
○ wdview_de.xlf for German
4. To open the language-specific XLF file, in the context menu, choose Open.
5. On the Header tab, select the required source language.
6. On the Resource Text tab, select the entry that you want to translate and choose Edit. Enter the required translation and choose OK.
7. For every language version, repeat steps 3 – 6.
8. To include the new files in the deployment, choose File → Save All. In the Web Dynpro Explorer, select the Web Dynpro project and in the context menu choose Reload, then Rebuild Project.