diff --git a/docs/html/preview/features/multilingual-support.jd b/docs/html/preview/features/multilingual-support.jd index e2082b6c79a5b..aadc9409a1234 100644 --- a/docs/html/preview/features/multilingual-support.jd +++ b/docs/html/preview/features/multilingual-support.jd @@ -16,24 +16,24 @@ page.title=Language and Locale

Android N Developer Preview provides enhanced support for multilingual users, -allowing them to select multiple locales in settings. The N Developer Preview +allowing them to select multiple locales in settings. The Preview provides this capability by greatly expanding the number of locales supported and changing the way the system resolves resources. The new method of resolving resources is more robust and designed to be compatible with existing APKs, but you should take extra care to spot any unexpected behavior. For example, you should test to make sure that your app defaults to the expected language. Also, -if it supports multiple languages, you should ensure that this support works as -intended. Last, you should try to ensure that your app gracefully handles +if your app supports multiple languages, you should ensure that this support works as +intended. Finally, you should try to ensure that your app gracefully handles languages that you didn't explicitly design it to support.

This document starts by explaining the resource resolution strategy prior to -the N Developer Preview. Next, it describes the N Developer Preview's improved +the Preview. Next, it describes the Preview's improved resource-resolution strategy. Last, it explains how to take advantage of the expanded number of locales to support more multilingual users.

Challenges in Resolving Language Resources

-

Prior to the Android N Developer Preview, Android could not always successfully +

Prior to this Preview, Android could not always successfully match app and system locales. For example, suppose that your app's default language is US English, but that it also has Spanish strings localized in {@code es_ES} resource files.

@@ -64,14 +64,14 @@ language that the app didn't support at all, like French. fr_CH default (en)
-de_DE
-es_ES
-fr_FR
-it_IT
+de_DE
+es_ES
+fr_FR
+it_IT
-Try fr_CH => Fail
-Try fr => Fail
+Try fr_CH => Fail
+Try fr => Fail
Use default (en) @@ -79,13 +79,13 @@ Use default (en) -

In this example, the system displays English strings without +

In this example, the system displays English strings without knowing whether the user can understand English. This behavior is pretty common -today. The Android N Developer Preview should substantially reduce the frequency +today. The Preview should substantially reduce the frequency of outcomes like this one.

Improvements to Resource-Resolution Strategy

-

The Android N Developer Preview brings more robust resource resolution, and +

The Preview brings more robust resource resolution, and finds better fallbacks automatically. However, to speed up resolution and improve maintainability, you should store resources in the most common parent dialect. For example, if you were storing Spanish resources in the {@code es-US} directory @@ -98,8 +98,9 @@ reliability of resource resolution.

Resource resolution examples

-

With the N Developer Preview, the case described in Table 1 is resolved +

With this Preview, the case described in Table 1 is resolved differently:

+

Table 2. An improved resolution strategy for when there is no exact locale match.

@@ -111,20 +112,20 @@ exact locale match.

    -
  1. fr_CH
  2. +
  3. fr_CH
-default (en)
-de_DE
-es_ES
-fr_FR
-it_IT
+default (en)
+de_DE
+es_ES
+fr_FR
+it_IT
-Try fr_CH => Fail
-Try fr => Fail
-Try children of fr => fr_FR
+Try fr_CH => Fail
+Try fr => Fail
+Try children of fr => fr_FR
Use fr_FR @@ -153,23 +154,23 @@ user's second-preferred locale setting.

    -
  1. fr_CH
  2. -
  3. it_CH
  4. +
  5. fr_CH
  6. +
  7. it_CH
-default (en)
-de_DE
-es_ES
-it_IT
+default (en)
+de_DE
+es_ES
+it_IT
-Try fr_CH => Fail
-Try fr => Fail
-Try children of fr => Fail
-Try it_CH => Fail
-Try it => Fail
-Try children of it => it_IT
+Try fr_CH => Fail
+Try fr => Fail
+Try children of fr => Fail
+Try it_CH => Fail
+Try it => Fail
+Try children of it => it_IT
Use it_IT @@ -183,7 +184,7 @@ support French.

Designing your App to Support Additional Locales

LocaleList API

-

The Android N Developer Preview adds a new API {@code LocaleList.GetDefault()} +

The Preview adds a new API {@code LocaleList.GetDefault()} that lets apps directly query the list of languages a user has specified. This API allows you to create more sophisticated app behavior and better-optimized display of content. For example, Search