After we launched Reaching Soon in Marathi and Hindi, we were overwhelmed by feedback we received - in these languages! Being able to use Reaching Soon in their own language, seemed to touch a chord with our users.
- For starters, it makes the app friendlier and much more pleasant to use
- And then, it invokes a sense of being understood
I want to share how we did it, so that more developers can bring out their lovely apps in "our" languages!
Points to Remember
- Retain the beauty of language
Typically in an app, the English messages are very terse. When translating to another language, one must keep it crisp, without losing the beauty of the language. To ensure this, get your translations vetted by a native speaker of the language.
- Use colloquial language where possible
It is better to use colloquial rather than chaste language. If the English words themselves are widely used and understood, use them instead of translating. E.g. App, Metro, Bus, etc - it is better to use these English words, perhaps in the script of that language.
- User-Interface is language sensitive
Some languages are more verbose than English, or may require a larger font to be rendered properly. This could throw your app's UI out of alignment. Make sure you translate appropriately, and design the UI to address this.
- Use String formatter - %d, %s, etc
Different languages have different gramar rules for handling subject and predicate. When constructing Strings in your app, it's very convenient to simply add the component strings. However, resist that urge, and use String.format instead. This enables you to easily address the language grammar in the appropriate strings.xml file.
E.g. instead of using:
String s = name + getString(R.string.joined);use
String s = String.format(getString(R.string.joined),name);where joined is defined in strings.xml as
%s has joined the trip
- Android Studio Translations editor
Very convenient to use. Shows all your strings together, and lets you change any of them. You can keep track of all translations at the same place.
However, writing in Indian languages is very difficult.
- Google spreadsheet - for writing in various scripts
Google spreadsheets together with Google Input Tools, is the most practical way of writing in languages with various scripts. It also becomes convenient to collaborate with native speakers for translations.
You can easily copy the original strings from the Translations editor to a spreadsheet.
- Linux script - import translations from spreadsheets to strings.xml
I could not find any simple method to import the translations from Google Spreadsheets back into strings.xml format. So I wrote a Bash script for Linux called tsv2xml. You can find it on GitHub - https://github.com/gaurangrk/tsv2xml
The linux script can be easily adapted for DOS and MAC. If anyone wants to contribute such an adaptation, please let me know, and I will happily add it here.