Use the Localization Files Editor to create localized versions of text string arrays used in your
applications.
-
Launch the Localization Files Editor using one of the following methods:
- Double-click res/values/strings.xml (or any of the localized strings.xml files in your project).
- Right-click res/values/strings.xml (or any of the localized strings.xml files in your project) and select . From the Editor Selection dialog, select
Localization Files Editor and click OK.
The Localization Files Editor appears, showing the base (or default) strings file and any localized
strings files. If it does not exist, the default strings file (values/strings.xml) will be
created. Within the editor each column (other than the Key column) represents a unique
locale. Each row represents a single text string, identified by a key (string array entries are identified by
a key that follows the pattern key_nnn where key is the actual key used to identify the array,
and nnn is a numeric suffix used only within the Android Localization Files editor to uniquely identify
that entry within the array). A cell contains the version of the row's string localized for the column's
locale. In Android, if a given cell is blank, at runtime the operating system picks the column that best
matches the current locale (and has a value for the row), falling back on the default string value for that
key if necessary (the column labeled values contains these default string values). See
the Android documentation for a complete description of the algorithm the operating system uses to determine
the resource file that best matches the device's current locale.
-
If desired, hide columns to simplify the editing process.
To hide a column, right-click anywhere within the Localization Files Editor table, select Show
Columns, and then select the column to be hidden. (Repeat this step to show a previously hidden
column.)
-
Edit or enter text strings into the table cells as appropriate. Note that by looking across a given row you
can see which locales have unique translations and which rely on the default string value. By looking down a
given column you can see which strings are localized for that column's locale, and which rely on the default
string value. Also note that you can enter multi-line string values by pressing the Return key between lines.
- To add additional entries to the array:
- Right-click within the Android Localization Files editor table and select Add
Key.
- From Add new select Array.
- Ensure that Add to array is selected, then choose the array to which the
entries are to be added from the list to the right. Finally, specify the number of entries to be added.
- Click OK.
- To delete a string array, select each of the rows that makes up the array (click in the first row, and
then while holding the shift key click in the last row to select a range), then right-click the selected
rows and select Remove Key.
-
Select to save your
changes.