{"slug":"android-strings-translate","name":"Android Strings Translate: strings.xml That Still Builds","version":"1.0.0","updated_at":"2026-10-09T03:31:06.710Z","use_when":"Translates an Android string resource file (res/values/strings.xml) into another language and returns the whole XML file, so the Android build and the app accept it. Only the text between the tags changes. Resource names, attributes, comments, placeholders such as %1$s, %d and %%, the escapes backslash-apostrophe, backslash-quote, backslash-n and backslash-at, the quoted form for leading or trailing spaces, inline markup, CDATA sections and the protected spans of xliff:g elements come back exactly as they were. Strings marked translatable=\"false\" are left out. Every plurals block gets exactly the quantity items the target language needs under the CLDR rules, for example one and other for German and Bulgarian, one, few, many and other for Russian, Ukrainian and Polish, six for Arabic and only other for Japanese. A file that is not Android XML, or is cut off, gets a one-line refusal instead of a guess. Use to translate Android strings.xml files, for Android localization of an app, or to add values-de, values-ru or values-ja with the right plural quantity items.","not_for":"Choosing terminology for you, translating iOS Localizable.strings, gettext, JSON or XLIFF files (other skills cover those formats), adding a new language folder to your project, merging with a newer source file, or checking your layouts for text that grows. It translates one resource file per request and does not rename, split or merge files.","languages":["any"],"tags":["translation","android","strings-xml","localization","plural-forms","i18n"],"category":"translation","category_url":"https://aiskills402.com/categories/translation","keywords":["translate Android strings.xml","Android localization","plural quantity items"],"faq":[{"q":"Which parts of the XML does it touch?","a":"Only the words between the tags. Resource names, attributes, comments, the declaration, the namespace on the root element, inline markup, CDATA sections and every placeholder are returned unchanged, so the app still finds each string and a diff against the old file shows translated text alone. Strings marked translatable false are left out, as Android lint expects. Save the result in the values folder of the target language, such as values-pl. Order and indentation follow your default file, which keeps review simple."},{"q":"How many plural items does one plurals block get?","a":"Exactly the quantities the target language has under the CLDR rules: one and other for German and Bulgarian, one, few, many and other for Russian, Ukrainian and Polish, six for Arabic and only other for Japanese. The English pair is replaced, not copied. The number placeholder stays in every item that covers more than one number, for example the Russian form for one, which also serves twenty-one. Missing quantities are a lint error and a wrong noun in the app."},{"q":"What about apostrophes, quotes and percent signs?","a":"Android reads strings through its own escape rules. Every apostrophe you get back is escaped with a backslash, which matters for Italian and Ukrainian where ordinary words contain one. Quotes inside values, backslash n, a leading backslash at sign, leading or trailing spaces kept inside double quotes, a doubled percent sign and formatted false strings all survive. Several placeholders are numbered when the word order changes."},{"q":"Files that are not Android XML, and the gain for Claude Sonnet?","a":"On Android files, no, hence one cent. Both Claude models translated twenty-two of them into eight languages with the file and again bare, checked by XML structure; plain Sonnet got all of them right, and Haiku rose from 18 to 21. The difference is the refusal: an iOS strings file, a gettext catalog, JSON or a file cut off mid-element gets one CANNOT TRANSLATE line. Without the file Sonnet converted an iOS file to Android XML and returned a cut-off file cut off, as our request did not ask it to stop."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <!-- Counter in the file picker. -->\n    <string name=\"action_save\">Save changes</string>\n    <plurals name=\"files_selected\">\n        <item quantity=\"one\">%d file selected</item>\n        <item quantity=\"other\">%d files selected</item>\n    </plurals>\n    <plurals name=\"reports_sent\">\n        <item quantity=\"one\">%d report sent</item>…","output_excerpt":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <!-- Counter in the file picker. -->\n    <string name=\"action_save\">Сохранить изменения</string>\n    <plurals name=\"files_selected\">\n        <item quantity=\"one\">Выбран %d файл</item>\n        <item quantity=\"few\">Выбрано %d файла</item>\n        <item quantity=\"many\">Выбрано %d файлов</item>…"}],"page_url":"https://aiskills402.com/skills/android-strings-translate","markdown_url":"https://aiskills402.com/skills/android-strings-translate.md","image_url":"https://cdn.aiskills402.com/og/skills/android-strings-translate/efd636d9.png","related_url":"https://api.aiskills402.com/v1/skills/android-strings-translate/related","purchases_count":null,"tested":{"date":"2026-10-09","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"Right on all 24 files, checked by code on the XML structure: plural items per language (four for Russian and Polish, six for Arabic, one for Japanese), apostrophes escaped in Italian and Ukrainian, quotes, percent signs and whitespace escapes, xliff spans and CDATA kept, translatable=\"false\" strings left out, an ampersand kept escaped, numbered placeholders where the word order changes, comments kept byte for byte, and a CANNOT TRANSLATE line for an iOS strings file and for a file cut off mid-element."},"weak":{"model":"claude-haiku-5-5 (Claude Code alias \"haiku\")","verdict":"Right on 23 of 24, checked by code, but in a Japanese string whose word order changes it kept the unnumbered %s and %d in the new order, which swaps the two arguments."},"note":"Twenty-four files written by us, translated into Bulgarian, Russian, Ukrainian, Polish, German, Italian, Japanese and Arabic: 22 Android string files (plurals, escapes, xliff spans, CDATA, string arrays, comments, untranslatable strings, a big mixed file and plain controls) and 2 that are not Android XML or are cut off. Each answer is parsed as XML and checked by structure, not by wording. Checks changed after the run, for both sides, each after a right answer was refused: the language marks for German and Polish now accept ordinary words without diacritics, R&D may be translated (the case tests the escaped ampersand), and in the comparison a translated comment is not counted against either side, since the request does not ask to keep comments. One run per model and file.","baseline":{"date":"2026-10-09","rows":[{"label":"Android files translated right (22)","better":"higher","strong":{"with":{"n":22,"of":22},"without":{"n":22,"of":22}},"weak":{"with":{"n":21,"of":22},"without":{"n":18,"of":22}}},{"label":"Not Android XML or cut off, refused (2)","better":"higher","strong":{"with":{"n":2,"of":2},"without":{"n":0,"of":2}},"weak":{"with":{"n":2,"of":2},"without":{"n":0,"of":2}}}],"note":"Same request on both sides: translate this strings.xml, answer with the XML only. Sonnet without the skill already translated every Android file right. It never refuses, because the request does not ask it to: an iOS strings file came back converted to Android XML, and a file cut off mid-element came back cut off the same way. The price rests on the first row. Haiku without the skill missed four there: a Japanese plural block with the English pair copied, unescaped apostrophes in Ukrainian and Italian, and arguments swapped in a reordered Japanese string."},"report_url":null},"price_usd":"0.01","price_micro":10000,"size_bytes":11906,"sha256":"f0e78d79fa4ec96a444150d6eba05674fd968fde4c029593478f39dfb90b33b8","outline":["The answer","What you translate","What you keep exactly","Escapes that Android needs","Placeholders and word order","Plurals","Words","What you refuse","Work in this order","Short example"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/android-strings-translate/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0x8e37022edcf0f21cf3c9f93fee9d4d32519f36f4","facilitator":"cdp"},"seo_title":"Android strings.xml Translation That Builds","seo_description":"A SKILL.md that translates Android string resources: escapes, placeholders, xliff spans and the right plural quantities per language kept intact. $0.01 once.","versions":[{"version":"1.0.0","date":"2026-10-09","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-08\n\nFirst release (draft, not yet measured): translates an Android strings.xml and returns the whole file with only the text changed. Resource names, attributes, comments, placeholders, escapes, quoted whitespace, inline markup, CDATA and xliff:g spans are kept; translatable false strings are left out; every plurals block gets the CLDR quantities of the target language; unfit input gets a CANNOT TRANSLATE line. 24 cases (18 traps, 6 controls) checked by the xml check. Price $0.02 proposed; to be set by the measured gain.\n\n## 1.0.1 — 2026-10-09 (finalised after the model test)\n\n- Measured on 24 files (without -> with the skill). 22 Android files: Sonnet 22 -> 22, Haiku 18 -> 21. 2 not Android or cut off, refused: Sonnet 0 -> 2, Haiku 0 -> 2; the shared request does not ask to refuse, so the price rests on the first group.\n- Checks changed for both sides after right answers were refused: German and Polish language marks accept plain words; R&D may be translated; a translated comment is not counted in the comparison. The \"lost R&D\" control mutant was dropped (no such rule in the skill).\n- Price: $0.01 (no Sonnet gain on Android files).\n"}]}