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.
Installation
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.10/install | bash
# Windows (PowerShell)
. { iwr -useb https://get.simplelocalize.io/2.10/install-windows } | iex;
# npm
npm install @simplelocalize/cli
Upload source translations
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-strings \
--uploadPath ./resources/values-{lang}/strings.xmlYou may also want to upload only one file for a specific language. To do that, you can use the --languageKey option with
the language key from the Languages tab.
$ simplelocalize upload \
--apiKey YOUR_API_KEY \
--languageKey en \
--uploadFormat android-strings \
--uploadPath ./values/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 ./srcTranslate your Android app
Now you can translate your Android application strings using the translation editor and save changes.
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.
Download translations
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-strings \
--downloadPath ./resources/values-{lang}/strings.xml