visit
Have you decided to make your Android app multilingual? I guess that even if you haven't yet, you know about
strings.xml
and values-XX
folders. Localizing your app should be easier than handling XML files. And it can be!Here is a simple guide on avoiding handling translated XML files in a few simple steps. And as a bonus, you can get your app translated to up to 80 languages for free by sharing translations with other apps.
A few minutes you spend with this article will save you hours or maybe days in the future.
Okay, there's already a localization solution baked into Android, so there's no reason to go against it. Use
strings.xml
in the values
folder for the source language. Btw, I strongly recommend using English.Just keep doing what's standard and what's recommended by Android Studio, and for what Android Studio can give us insights and useful warnings. However, completely forget about those
values-de-rDE
or values-b+zh+Hans+TW
folders. You don't need them at all!It's as simple as adding a few lines to your root's
build.gradle
(adding a repository and a build plugin):And a few lines at the end of your app's
build.gradle
(configuring and applying a build plugin):It's a matter of about 30 seconds if you know what you do :-). And btw, the ;-)../gradlew uploadStrings
Or from Android Studio using the Gradle view:
However, I strongly recommend doing so, you can invite your loyal users to Localazy to help you with translating your app to their native languages.
And there's more you are about to get. The Localazy Gradle plugin automatically integrates the with your app. And this small library keeps translations in your app up-to-date, and it can even download new languages. You no longer need to re-submit your app to Play Store just because you need to fix translations or add new languages.
And all of this with no single change to the source code of your app! Everything is done automatically during the build process.
You can disable this feature if you want so, but I recommend using it as it also optimizes the translation and review process, so you spend your time with the most important translations first. Btw, the comes with a bunch of nice features, so you can, for example, create a language selector that is always up to date.Previously published at