Examples of language settings are
en for English,
de for German. Language and locale combinations allow for dialects of languages such as
en_US for British and American English. SAPUI5 will also allow an app to select the most appropriate language. If a device is set to
de_CH for Swiss German, but that file isn’t included in the app, it will look for a
de (German) file to load.
Step 1: Enable beta services
Since the SAP Translation Hub service is currently in beta release, you need to verify that your HCP account is configured for enabling beta services.
Log into SAP HANA Cloud Platform by opening the following URL in a new tab: https://account.hanatrial.ondemand.com
Make sure you are using the Europe (Trial) landscape, then click on the pencil icon next to your account ID.
Step 2: Beta services checkbox
If Beta Features is not checked, check it and click Save. If it is checked click Cancel.
Step 3: Open your HCP cockpit
Click on your Account ID to return to your HCP cockpit.
Step 4: Open the SAP Translation Hub overview page
Select Services in the left-hand navigation bar, and scroll down until you see the SAP Translation Hub tile.
Click on the tile to open the overview page.
Step 5: Enable and Go To Service
If the SAP Translation Hub is not enabled, click on the blue Enable button, and wait for the green Enabled badge to appear.
Click on the Go to Service link.
Step 6: Create a new translation project
When the Translation Hub page loads, click the + icon at the bottom of the window, and then select Git Project to create a new translation process.
Step 7: Fill in project details
Fill in the project details as shown below:
|Path to properties file
Click on Save
Step 8: Initiate translations
Once the project is created click the green Get Translations button, and log in if prompted.
Step 9: Translation completion
You will see the “All done.” toast message at the bottom of the screen when the translations are complete.
Step 10: Pull translated files to Web IDE
Return to SAP Web IDE and open the Git pane.
You will notice that there is only the original
i18n.properties file in your project folder.
In the Git pane, click the Pull button to pull the translated files from your Git repository to your local project folder.
Step 11: Confirm translated files in project
If you check the
i18n folder in your project, you will see the two new files:
Step 12: Commit files, and deploy to the cloud
Commit your new files to Git and deploy the application to HCP (following the same procedure as in the previous tutorial.
Right-click on your
te2016 project folder, and select Deploy > Deploy to SAP HANA Cloud Platform and click Deploy.
Step 13: Testing your language files
To test the language support in the deployed app, we can utilize the SAPUI5
sap-ui-language URL parameter.
To do so, just append
?sap-ui-language=xx_YY to your application URL
- If your standard application URL looks like this:
- You can view the German strings by specifying:
- And the Spanish strings by specifying:
Step 14: Run the app on your phone
If your device is set to either the German or Spanish locale, then the app will check the language and locale settings on the device, and load the appropriate strings file.