Translate Android .xml files

WebTranslateIt supports Android .xml files, used for localizing Google Android applications.

Android .xml file example

Here’s an example of Android .xml file. WebTranslateIt supports class string, string-array and plurals structures. XML comments are imported as developer comments.

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="loginPrefs">LOGINPREFS</string>
  <!-- The name used to login on the site -->
  <string name="user_key">user</string>
  <string name="password_key">password</string>
  <string name="photoKey">photo</string>
  <string name="videoKey">video</string>
  <string name="string1">a &lt;a href="http://example.com">link&lt;/a> (HTML escaped).</string>
  <string name="string2">a <a href="http://example.com">link</a> (HTML not escaped).</string>
  <string-array name="planets_array">
    <item>Mercury</item>
    <item>Venus</item>
    <item>Earth</item>
    <item>Mars</item>
  </string-array>
  <plurals name="numberOfSongsAvailable">
    <item quantity="one">Znaleziono jedną piosenkę.</item>
    <item quantity="few">Znaleziono %d piosenki.</item>
    <item quantity="other">Znaleziono %d piosenek.</item>
  </plurals>
</resources>

Empty strings

Empty strings aren’t exported at all on target language files (although they are exported in the master language file and kept in database). Exporting empty strings would prevent Android’s language fallback mechanism from working.

In an Android app, if a string is left empty in a target language, the device won’t display anything. On the other hand, if the string isn’t in the file at all, the device will fallback to the English text, which is better than no text at all for the end user.

More Information