Using Android 13 “per app” language with Titanium SDK

Note: For this tutorial you will need Android 13 and a Titanium SDK that is targeting Android 13 (e.g. this pull request)

Introduction

Google added a new “per app” language feature in Android 13 (more details). With this feature you can change the app language to be different to your device language – so you can run your app in English while your phone is set to German.

The normal/current way is to implement a language switcher in your app. With this feature you can make the setting in a single place for all your apps: Settings > System > Languages & Input > App Languages or Settings > Apps > (select an app) > Language.

Titanium settings

Open your “tiapp.xml” and add the following part your your <application> node:

<application ... android:localeConfig="@xml/locales_config" ... />

Now create a new XML file in /app/platform/android/res/xml/ called locales_config.xml.

Inside that file you have to add the languages you support. In this example it is German and English.

<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
   <locale android:name="de"/>
   <locale android:name="en"/>
</locale-config>

A sample XML file with multiple languages is available at https://developer.android.com/guide/topics/resources/app-languages#sample-config.

After that you can find your app in the language settings and can switch between the languages

Like the content?

If you like the tutorials, plug-ins or want to see more please consider becoming a Github sponsor.

Content