Android string resources
Translate Android XML string resources directly from the base res/values directory. autoglot understands strings, plurals, and string arrays and generates the locale-specific values directories Android builds automatically.
- Extensions
- .xml files inside res/values
- Output model
- One values-<locale> directory per target language
Base resource
xml
<!-- app/src/main/res/values/strings.xml -->
<resources>
<string name="welcome">Welcome, %1$s</string>
<plurals name="item_count">
<item quantity="one">%d item</item>
<item quantity="other">%d items</item>
</plurals>
</resources>German resource
xml
<!-- app/src/main/res/values-de/strings.xml -->
<resources>
<string name="welcome">Willkommen, %1$s</string>
<plurals name="item_count">
<item quantity="one">%d Element</item>
<item quantity="other">%d Elemente</item>
</plurals>
</resources>What autoglot preserves
- <string>, <plurals>, and <string-array> resources
- Resource names, attributes, namespaces, and ordering
- printf and positional placeholders such as %1$s and %d
- Android-compatible quote, newline, and resource-reference escaping
Set the GitHub action paths input to the base res/values directory. autoglot ignores non-string XML resources and writes Android locale qualifiers such as values-de, values-pt-rBR, and values-b+zh+Hans.