SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Add New Languages to Your Android Application

See how the SAP Translation Hub can be used to quickly add support for a new language to your app.

Overview

🎓 beginner 20 min. SAP BTP Sdk For AndroidBeginnerAndroidMobileOdataSAP Business Technology Platform

You will learn

  • โœ”An overview of how the generated app supports different languages
  • โœ”How to sign up for the SAP Translation Hub
  • โœ”How to use the SAP Translation Hub from within an Android Studio Project
Bruce Meng B Bruce Meng March 31, 2025
Created by November 17, 2022
Contributors

Prerequisites

Prerequisites

Steps

Intro

The SAP Translation Hub is currently not available on SAP Cloud Foundry. So if you didn’t enable SAP Translation Hub service before, you can skip this tutorial.


Step 1 Language Support in the Generated App
โ€”

The wizard generates an Android app that contains translated strings for multiple languages as shown below.

Languages Localized
Languages Localized

The language codes (ar, cs, da, de, en, es, etc.) can be looked up at Codes for the Representation of Names of Languages.

Strings used within the app are read from the appropriate version of the strings_localized or strings.xml file. The strings.xml file contains strings that are provided at design time, such as the screen names from metadata.xml or the app name. Android Studio provides a Translations Editor that you can use to view the values across the localized strings files. Right-click on the strings.xml file and choose Open Translations Editor.

Notice in the screenshot below that the resources that are from the strings.xml file, such as Suppliers, are not translated. These will get translated in Step 3.

Translations Editor
Translations Editor

The following code in the WelcomeStepFragment class, in the onCreateView method, is an example of the code used to read from a strings file.

Kotlin
LaunchScreenSettings.Builder()
                .setHeaderLineLabel(getString(R.string.application_name))

The getString method determines what the current local language is on the device or emulator and then reads from the matching strings file.

You can set the language on an Android device or emulator using Settings > System > Languages & input > Languages. A second language, such as French, can also be added.

Additional Languages
Additional Languages

Select the default language by long pressing on a language and dragging it to the top of the list.

Default Language
Default Language

When the app is restarted, it now shows strings in the preferred language if that language is supported by the app. If the language is not currently supported, the strings will be in English by default.

French Welcome Screen
French Welcome Screen

For additional information, see:

Step 2 Sign Up for the SAP Translation Hub
+
Step 3 Add a new Language to Your Project
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Language Support in the Generated App 2. Sign Up for the SAP Translation Hub 3. Add a new Language to Your Project

Learn more →