Lingo.dev + .xml (Android)

Lingo.dev CLI translates Android XML resource files while preserving native structure, attributes, and Android-specific conventions. The CLI integrates seamlessly with existing Android build processes, maintains resource linking systems, works with Gradle and Android Studio, and follows platform localization standards without requiring format conversions.

Quick Setup

Point to your Android resource files using locale-based folder patterns:

{
  "locale": {
    "source": "en",
    "targets": ["es", "fr", "de", "ja"]
  },
  "buckets": {
    "android": {
      "include": ["res/values-[locale]/strings.xml"]
    }
  }
}

Reminder: [locale] is a placeholder that should remain in the config literally, as it's replaced with the actual locale during CLI run.

Handle Default Resources

Android requires a default values/ folder. Create a symbolic link for compatibility:

cd res
ln -s values-en values

This satisfies Android's requirements while enabling proper locale handling.

Translate Resources

npx lingo.dev@latest i18n

Processes all Android resource types while preserving XML formatting, attributes, and special Android syntax.

Complete Android Resource Support

String Arrays

<string-array name="planets">
    <item>Mercury</item>
    <item>Venus</item>
    <item>Earth</item>
</string-array>

Plurals with Quantities

<plurals name="songs_found">
    <item quantity="one">%d song found</item>
    <item quantity="other">%d songs found</item>
</plurals>

Format Preservations

  • HTML Markup: <b>, <i>, <u> tags maintained
  • Format Specifiers: %1$s, %2$d placeholders preserved
  • CDATA Sections: <![CDATA[]]> content handled correctly
  • String References: @string/app_name links maintained
  • Special Characters: \@, \?, \# escaping preserved

Advanced Configuration

Multiple Resource Files

"android": {
  "include": [
    "res/values-[locale]/strings.xml",
    "res/values-[locale]/plurals.xml"
  ]
}

Skip Non-Translatable Strings

Respects translatable="false" attributes automatically.