Login Account

Android XML Resources

Android XML Resources are used for localisation in Android apps. For more information, check the Android documentation.

Getting Started Guide

This page documents all features and options for localising Android XML Resources with doloc.

For getting started, please check our dedicated Android guide.

Features

  • Plurals/quantity strings
  • String arrays
  • Your formatting (including comments) is preserved

Usage

curl https://api.doloc.io?sourceLang=en&targetLang=fr -H "Authorization: Bearer $API_TOKEN" -F source="@res/values/strings.xml" -F target="@res/values-fr/strings.xml" -o res/values-fr/strings.xml 

You’d need to provide the source texts as the first file and the target texts as the second file!

It is advised to use the sourceLang and targetLang options to specify the language of the source and target texts.

Options

Options are passed as query parameters in the URL.

The option untranslated can use any DNF combination of the described values. Here only a comma separated list of values for an OR combination is meaningful.

For details check the options documentation.

name values default description
sourceLang any IETF BCP 47 language tag such as en-US, de-DE, etc. inferred from filename - e.g. strings.en-us.xml infers en-us. Fallback to en This specifies the language of the source texts.
targetLang any IETF BCP 47 language tag such as en-US, de-DE, etc. inferred from filename - e.g. strings.en-us.xml infers en-us. This specifies the language of the target texts.
untranslated combination of missing, empty, equal. missing Translate all units that match this configuration. missing: not contained in target file. empty: has empty value in target file. equal: has the same value in source and target file.
includeTranslatableFalse true, false false If true, resources with attribute translatable="false" are translated and included as context - otherwise they are completely ignored. (see https://developer.android.com/studio/write/translations-editor#untranslatable)

Limitations

  • XML comments for descriptions are currently not processed.

Please reach out, if you need support for these or other formats! 🚀