Introduction
An Android string resource file is an XML file that holds the text an Android app shows: single strings, arrays of strings and quantity strings (plurals). Strings may carry styling markup and formatting arguments.
Structure
The file is XML saved as res/values/filename.xml; the file name is free,
and Android’s examples use strings.xml. Translations go in folders such as
res/values-pl/. The root element is <resources>. It holds
<string name="…"> elements, <string-array> elements
with <item> children, and <plurals> elements whose
items have a quantity of zero, one,
two, few, many or other. Apostrophes
and quotation marks must be escaped, for example with a backslash.
Not described
This page is a first outline.
Known, not yet covered
- Reference: the full escaping and whitespace rules, the styling tags, annotations and format arguments.
- Viewer: the site has no viewer for this format.
Also used for
- Excel XML Spreadsheet 2003 – Excel’s single-file XML workbooks from before the .xlsx package.
- Extensible Markup Language – Nested elements with tags and attributes, written as text.
- JUnit XML test report – XML test results in the common JUnit layout, read by build servers.
- xCal: iCalendar in XML – iCalendar as XML: events, to-dos and time zones as elements.
- xCard: vCard in XML – vCard 4.0 contacts as XML: names, numbers and addresses as elements.
Links
Reference
- String resources – Android’s documentation of string, string array and plural resources