TRANSLATION.md
September 18, 2023 · View on GitHub
This document provides guidelines for localizing the new Android application.
What to translate
String resources are contained in two separate files:
important_strings.xml: a "short" file that contains the most important resources, like instructions, guidelines, or error messages.strings.xml: contains all the less important resources.
How to add a new language
- Fork and clone this project (How-to)
- Create a new branch, for example
translate_mylanguagecode, where mymylanguagecodecould befrorit. - Create a new folder for this language, named
values-mylanguagecode, inphoenix-android/src/main/res. For example, for french you would create avalues-frfolder. - Copy the
phoenix-android/src/main/res/values/important_strings.xmlandphoenix-android/src/main/res/values/strings.xmlfiles into this new folder. - You can now start the translation work proper.
- Then submit a pull request to start the review.
Note that Android Studio offers a Translation Editor to make this somewhat easier.
Guidelines
Focusing on what's important
As mentioned above, there are 2 files that need translation. important_strings.xml should be treated as a priority. It contains high added value resources that explain how the wallet works, or provide critical information. We try to keep this file as small as possible to make the translation work efficient.
The strings.xml file is much larger, and contain technical stuff, or strings that can be understood in context even if not translated. It can be translated later on.
Dynamic content
Some content is dynamic: a part of it will contain a dynamic value, such as an amount, that will be injected by the application at runtime. In that case, these strings will contain a special data formatted like this: %1$s.
Example:
<string name="some_dynamic_content">Dynamic content with amount %1$s requested by %2$s.</string>
Here you have 2 dynamic values: %1$s and %2$s. These values must not be modified, and the translation must make sure that the order is consistent. Translated in french, we would have:
<string name="some_dynamic_content">Contenu dynamique avec montant %1$s demandé par %2$s.</string>
Special characters
Some characters such as the quote ' character must be escaped using the \ character.
Example:
<string name="escape_this">Don\'t forget to escape quotes</string>
Html content
Some strings contain html styling markups, like <b> for bold text, or <u> for underlining text.
Example:
<string name="bold_message">You should <b>ask the payee to specify an amount</b> in the payment request.</string>
This warning message emphasizes the ask the payee to specify an amount part in bold font. The translation should respect this intent if possible.
Additional guidelines
See here.