Home > android, tools > Finding missing translations in an Android application

Finding missing translations in an Android application

An app that is developed primarily in one or two languages, and supports more, needs to be updated from time to time.

To do this, missing string translations need to be identified.

The Lint tool from the Android SDK can do this, but I’ve found its output format to be difficult to work with.

Lint groups missing translations by string identifier, like this:

res/values/strings_widget.xml:7: Error: "widget_loading" is not translated in cs, es, fr, it, ja, ko, nb, nl, pt-rBR, sv, vi [MissingTranslation]
    <string name="widget_loading">Loading…</string>
    ^
res/values/strings_widget.xml:8: Error: "label_account_and_folder" is not translated in cs, es, fr, it, ja, ko, nb, nl, pt-rBR, sv, vi [MissingTranslation]
    <string name="label_account_and_folder">Account and folder:</string>
    ^

I believe it’s more useful to group missing translations by language code, so that they can be collected and sent to the translator for a particular language all at once.

With this in mind, I’ve written a simple script that does this. Its output look like this:

	Checking language 2, de
	***** Found 44 missing translations for language de

	<!-- res/values/strings_account_list.xml -->

	<string name=account_list_menu_uilock_now>Lock now</string>

	<!-- res/values/strings_account_options.xml -->

	<string name=account_options_folder_sync_type_spam>Sync as spam</string>
	<string name=account_options_prefs_preload_inlines_mobile>Embedded images, mobile</string>
	<string name=account_options_prefs_preload_inlines_wifi>Embedded images, WiFi</string>
	<string name=account_options_prefs_signature_auto>Add signature automatically</string>
	... more strings here

	Checking language 1, uk

	***** Found 47 missing translations for language uk
	... all missing translations for Ukrainian are printed here

The script is written in Python, and is available here: https://gist.github.com/3038713

Advertisements
Categories: android, tools
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s