Android

Last modified: November 19, 2022Author: Jakub Pomykała

Learn how to localize your Android app with SimpleLocalize using translations in strings.xml files. This guide will help you to get started with SimpleLocalize and translation editor in a few minutes.

Table of contents

Before you start

Before you start, you need to have a SimpleLocalize account. If you don't have one yet, you can sign up for free. Create a new project and add get your API Key.

Install SimpleLocalize CLI

SimpleLocalize CLI is a command line tool that helps you to integrate localization into your development workflow. It can be used to upload and download translations from SimpleLocalize.

# macOs / Linux / Windows (WSL)
curl -s https://get.simplelocalize.io/2.1/install | bash

# Windows (PowerShell)
. { iwr -useb https://get.simplelocalize.io/2.1/install-windows } | iex;

Upload strings.xml files

In this step, you will upload your strings.xml files to SimpleLocalize. Thanks to the command-line tool, you can upload multiple files at once from any directory.

$ simplelocalize upload \
        --apiKey YOUR_API_KEY \
        --uploadFormat android \
        --uploadPath ./resources/values-{lang}/strings.xml

Extract translation keys (optional)

If you don't have translation keys in your strings.xml files, you can use the extract command to generate them automatically. CLI can find translation key usages in .java and .kt files. Translation keys will be automatically uploaded to the translation editor.

$ simplelocalize extract \
        --apiKey YOUR_API_KEY \
        --projectType google/android \
        --searchDir ./src

Translate your Android app

Now you can translate your Android application strings using the translation editor and save changes.

translate project

If you want to translate your app in multiple languages fast, you can add new languages in the Languages tab, and use auto-translation feature to speed up the process.

auto-translate project

Download translated strings.xml files

Once you finish the translation, you can download the translated strings.xml files using the download command. CLI will download the files to the resources/values-{lang}/strings.xml files, where {lang} is the language code set in Languages tab.

$ simplelocalize download \
        --apiKey YOUR_API_KEY \
        --downloadFormat android \
        --downloadPath ./resources/values-{lang}/strings.xml

Resources