Android strings.xml to CSV
Hand your app's res/values/strings.xml to a translator as a spreadsheet: one row per string, array item or plural form, the text decoded from Android's escaping into what the user actually sees, and the XML comment above each resource kept as context. CSV to strings.xml turns the filled-in sheet into values-fr/strings.xml.
strings.xml to CSV
Every <string>, every <item> of a <string-array> and every quantity of a <plurals> becomes a row. Other resources that can share the file — dimensions, colours, integers — are left out and counted in the status line.
How to use it
- Drop
res/values/strings.xml(the default, untranslated file) on the left pane. - Download the CSV. The
translationcolumn is empty, ready to fill in. - When it comes back, build the translated file with CSV to strings.xml, giving it this same
strings.xmlas the template.
The columns
- name — the resource name.
- type —
string,string-arrayorplurals. - index — the item's position in a string-array, counting from 0, or the plural quantity:
zero,one,two,few,manyorother. - source — the text as the app displays it.
- translation — empty, for the translator.
- comment — the XML comment directly above the resource, if there is one. Android's localisation guide recommends describing the context of each string; this is where that description reaches the translator.
Escaping, decoded
Android reads a string twice: once as XML, then again with its own rules. Android's documentation lists the second set — \' and \" for quotes, \n and \t, \uXXXX for any character, \@ and \? — and explains that runs of whitespace collapse to a single space unless they are inside double quotes. A translator should not have to know any of that, so the source column holds the decoded text: Don\'t becomes Don't, \n becomes a real line break, and a value wrapped in quotes to keep its spaces loses the quotes but keeps the spaces. CDATA sections are read as plain text. The reverse tool escapes everything again.
One check comes free: a string with an apostrophe that is neither escaped nor inside double quotes is named in the status line. Android's documentation says apostrophes must be escaped — with \' or by enclosing the whole string in double quotes — so those strings need fixing in the source file too.
Tags inside strings
Styling tags (<b>, <i>, <u>…) and <xliff:g> placeholders stay in the text as markup: Visit us at <xliff:g id="url">example.com</xliff:g>. Android's guide uses <xliff:g> to mark parts of a string that must not be translated — a format argument, a URL, a product name — so the translator sees exactly what to leave alone. In those cells the surrounding text is XML-escaped (& for &), because the cell is markup.
FAQ
Why are translatable="false" strings left out?
They are marked as not for translation — API keys, URLs, brand names. Tick include translatable="false" to export them anyway, with a translatable column saying which they are.
My language needs plural forms English does not have.
Add rows. For Polish, copy the one row of a plural and change the index to few and many; CSV to strings.xml adds the extra quantities to the <plurals> element in the standard order.
Does it read values-xx folders too?
Any strings.xml works — the default one or a translated one. To review an existing translation, export it and the default file separately and line the sheets up by name and index.
Related tools
- CSV to strings.xml — build the translated resource file from the sheet
- XLIFF to CSV — the same job for XLIFF files
- XML Validator — find where a resource file stops being well-formed
- XML escape / unescape — the XML half of the escaping
Privacy
100% client-side. The file is converted in your browser; nothing is uploaded. See the privacy policy.