History log of /frameworks/base/libs/androidfw/LocaleData.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a192a8ced65ceea8bfe44f0eac6a394cbf80d936 11-Jan-2017 Roozbeh Pournader <roozbeh@google.com> Treat Latin American locales specially

Due to legacy reasons, Android translations of European Spanish were
kept under 'es', while Latin American Spanish translations were kept
under 'es-US'. The combination of this, and the new locale
preference rules in Nougat, resulted in 'es' winning over 'es-US' for
all Latin American locales, since 'es' was a direct ancestor, while
'es-US' was just a fallback.

The changes in Nougat had assumed that app developers would put Latin
American Spanish translations under 'es-419', but that could create a
backward-compatibility problem under older Android versions that did
not support three-digit region codes properly.

This CL keeps the Nougat logic and its locale parent tree, but
special-cases es-US and es-MX to be treated as equivalents of es-419
in cases where they are present and es-419 is not.

Bug: 31545805
Bug: 34126460
Test: unit tests are included
Change-Id: Iab26f41294587ee044685a5a6560520c7cbb06f7
/frameworks/base/libs/androidfw/LocaleData.cpp
27953c349fa1c46698f57ae5f26339560c21adac 01-Feb-2016 Roozbeh Pournader <roozbeh@google.com> Make default resources a better match for en-US requests

When locale fallback landed, resources which specified an 'English'
locale started to be considered a better match for en-US, even though
traditionally, apps tend to ship US English resources under their
default locale.

This fixes that, and makes en-US requests match default locales.

Bug: 26756573
Bug: 26789680
Bug: 26803868
Change-Id: I460c276bfc6ddba0439dcdf87497a0aece0fa05d
/frameworks/base/libs/androidfw/LocaleData.cpp
b927c559e1ef8530b08712507f320502627db298 15-Jan-2016 Roozbeh Pournader <roozbeh@google.com> Implement smarter locale resource selection

* Add support for determining script from language and region.
* Add support for determining special parents of locales.
* Add support for smart comparison of locales with only a difference
in region, using the locale parentage tree.
* Fix LocaleData.matchScore() to not fallback to old locale matching
behavior if we can't determine a script.
* Allow four-character variant codes. (Previously, only five- to
eight-character variant codes were allowed.)

Bug: 7296673
Bug: 26589793
Change-Id: Ibde0a48c0564ff383b41068095a5cbacfe7b94bc
/frameworks/base/libs/androidfw/LocaleData.cpp