ams (android-missing-strings) is a simple command line reporting tool you can use to know what strings need to be translated in your Android project and to clean left over translation entries that are no longer part of the project.
The output of ams is a text file that is friendly to a non-programmer who can be in charge of managing the translators involved in the project.
It can also be used to delete left over translation entries in other languages that have been deleted from your main string.xml. It cannot however, track if a string has changed in the main file and hasn't been updated in the translations files, for that you will need more advance tools.
1. a git client installed.
2. python 2.7+
- Clone the ams git repository to your computer
git clone http://github.com/gubatron/ams
- Make sure the path to the ams folder you've just cloned is in your $PATH environment variable.
With ams you will be able to create either a comprehensive report of all the language files and their missing strings, or you can create a report that includes only certain languages.
For example, if you wanted to see all the missing strings in every language you'd issue the following command:
ams -o all.out
if we open the all.txt we'll see a report of all the missing strings for each language.
The report tells us our translation coverage percentage, show us the missing strings by printing the XML we'd need to work from, which we can copy and paste to our translation file, and towards the end of each report it will also show you left over elements that may have been removed from the main language file that you can safely delete from your translation file.
If you wanted to obtain a translation report for Spanish, you'd issue the following command:
ams -l es -o es.txt
Cleaning Left Over Translations
If the report showed that there's some left overs in the spanish translation, you could remove the left overs from the spanish translation file by doing
ams -l es --cleanleftovers -o es.txt
If you wanted to clean all the left over strings for all translation files, you should issue the following command:
ams --cleanleftovers -o all_clean.txt
Help and Options
ams - Android Missing Strings reporting tool. Usage: ams [-l xx[,yy,zz...]] [--cleanleftovers] -o <output_file> Options: -h --help Print this help -l --lang <xx> Specify a language or many with comma separated 2-char language codes. e.g: -l cn (creates report for Chinese strings.xml) -l cn,it,fr (creates report for Chinese, Italian and French strings.xml files) If this parameter is ommited, a report with every language file found will be created. -o --oFile Specify the output file name for the report --cleanleftovers Removes left over translations on other language files Copyright (c) 2014-2017 - The Mit License (MIT) Authors: Angel Leon <firstname.lastname@example.org> Katay Santos <email@example.com>