File description

A string resource provides text strings for your application with optional text styling and formatting. There are three types of resources that can provide your application with strings:

  • String
    - XML resource that provides a single string.
  • String Array
    - XML resource that provides an array of strings.
  • Quantity Strings (Plurals)
    - XML resource that carries different strings for pluralization.

All strings are capable of applying some styling markup and formatting arguments.

Good to know

POEditor does not support the string-array tag.
POEditor uses quotes in string resources. These can be removed on export using the option Do not wrap strings in quotes in the UI, and using the argument options=[{"unquoted": 1}] for API exports.

Documentation

The official Android Developer website: http://developer.android.com/
More about the string resources: http://developer.android.com/guide/topics/resources/string-resource.html

Sample file

View Download
<?xml version="1.0" encoding="utf-8"?>
    <resources>
            <!-- Please don't change the name of the application -->
            <string name="app.name">"TODO List"</string>
            <string name="app.login.text">"Enter your credentials below to login"</string>
            <string name="app.login.message.success">"Login successful !
            Welcome back %s !"</string>
            <string name="app.login.message.error">"Make sure you've entered the correct username and password"</string>
            <string name="app.login.password.forget">"I forgot my password"</string>
            <string name="app.login.password.reset">"Enter your address in the field below. A new password will be sent to your inbox."</string>
            <string name="app.register.text">"Sign up for free! No credit card required!"</string>
            <string name="app.register.message.success">"Thank you for signing up !
            Please check your email address to activate your account."</string>
            <string name="app.register.message.error">"We were unable to sign you up.
            Please correct the marked fields."</string>
            <string name="app.menu.terms">"Terms and conditions"</string>

            <!-- form_label -->
            <string name="app.login.text">"Username"</string>
            <plurals name="app.users.active">
                    <item quantity="one">"Just one user online"</item>
                    <item quantity="other">"There are %d users online"</item>
            </plurals>

            <!-- form_label -->
            <string name="app.login.pass">"Password"</string>
    </resources>

See also: