Sunteți pe pagina 1din 3

Android Developers

Localize the UI with Translations


Editor
If your application supports multiple
languages, you need to properly manage
your translated string resources. Android
Studio provides the Translations Editor to
make viewing and managing your
translated resources easier.

In this document
About the Translations Editor
Running the Translations
Editor
Managing String Resources
Ordering Translation Services

About the Translations


Editor

See also

Translated resources are stored in multiple

Supporting Different
Languages

XML les in multiple directories in your

Localizing with Resources

project. Manually nding and editing resource

Providing Resources

les across many translations can be difcult.


Because of this, your application might have
missing translations that go unnoticed until
after your application has been built and distributed to users.
The Translations Editor lets you view and update all your string resources in one
convenient place. The editor gives you a single view of all of your translated
resources, making it easy to change or add translations, and even nd missing
translations.

Figure 1. Manage locales and strings in the Translations Editor.

Running the Translations Editor


Follow these steps to start the Translations Editor:
1. In the Project window on the left side of Android Studio, select Android from the
dropdown list.
2. Open the res folder, and then open the values folder.
3. If a strings.xml folder is present, open this folder.
4. Right-click the strings.xml le (not folder) and select Open Translations
Editor.
You can also access the Translations Editor by opening a strings.xml le for
editing and clicking the Open editor link, or clicking the globe icon

in the

Design layout view and choosing Edit Translations.

Managing String Resources


The Translations Editor provides a view of all your string resources and current
locale translations. The name of each resource is listed in the Key column, along
with a default value for the key, a checkbox to mark the key as untranslatable, and
values for each locale translation.

Edit translations by double-clicking on the translation and editing the value directly
in the list view, or selecting the translation and editing the Translation eld value at
the bottom of the editor. The default value can be edited by double-clicking on the
default value or selecting the default value and updating the Default Value eld.
If a resource is missing a translation and isn't marked untranslatable, the key name
is displayed in red. If you hover over a red resource, Android Studio displays details
about the missing translations.

Adding a new string resource


Add a new resource by clicking the add icon

. Android Studio prompts you for a

key name, default value, and resource folder that contains the strings.xml le
where the new resource is added.

Adding additional locales


Add additional locales by pressing the globe icon

and selecting the locale you

want to add. The Translations Editor adds the new locale column and creates the
translation strings XML le in the appropriate project directory.
The Translations Editor has BCP 47 (https://tools.ietf.org/html/bcp47)

support, and

combines language and region codes into a single selection for targeted
localizations.

Ordering Translation Services


Clicking the Order a translation link opens a page in your browser where you can
upload string resource XML les and order translation services. App translation
services are available from Google Play and other vendors. For more information
about Google Play App Translation Services, see the Google Play App Translation
Service (http://android-developers.blogspot.com/2013/11/app-translation-service-now-available.html)
announcement.

S-ar putea să vă placă și