-
yirui authored
Locale.toString() is not a interchangeable representation. Locale.toLanguageTag should be used for obtaining a value in IETF BCP47 language tag representation. However, toLanguageTag does not work on Android M and before. Thereofore, we use a self-implementation for converting Locale object to BCP47 compliant format string in that situation. Similarly, Locale.forLanguageTag should be used for constructing Locale object from BCP47 String representation of locales. However, this is not available on Android L and before. Thus, we introduce self-implementation for backward compatibility. This CL also includes: - Renaming getDefaultLocale to getDefaultLocaleString. This leads to function name changes in related files. - Adding methods for switching language code between Chrome and Android. - Adding methods for returning a locale with updated language code for Chrome or Android. BUG=593515 Review-Url: https://codereview.chromium.org/2406203002 Cr-Commit-Position: refs/heads/master@{#428281}
9174164b