Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3236)

Unified Diff: base/android/java/src/org/chromium/base/LocaleUtils.java

Issue 2406093002: Fix monochrome not booting issue (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/android/java/src/org/chromium/base/LocaleUtils.java
diff --git a/base/android/java/src/org/chromium/base/LocaleUtils.java b/base/android/java/src/org/chromium/base/LocaleUtils.java
index 35d04a9b73b8e337f8469420e4141343810b2ef3..5c26e7a50c28618ad009b7499bd1954b44b4541c 100644
--- a/base/android/java/src/org/chromium/base/LocaleUtils.java
+++ b/base/android/java/src/org/chromium/base/LocaleUtils.java
@@ -19,22 +19,13 @@ public class LocaleUtils {
}
/**
- * @return The string for the given locale, translating Android deprecated language codes
- * into the modern ones used by Chromium.
+ * @return the string for the given locale, translating
+ * Android deprecated language codes into the modern ones
+ * used by Chromium.
*/
public static String getLocale(Locale locale) {
- String language = getLanguage(locale);
- String country = locale.getCountry();
-
- return country.isEmpty() ? language : language + "-" + country;
- }
-
- /**
- * @return The language for the given locale, translating Android deprecated languages codes
- * into modern ones used by Chromium.
- */
- public static String getLanguage(Locale locale) {
String language = locale.getLanguage();
+ String country = locale.getCountry();
// Android uses deprecated lanuages codes for Hebrew and Indonesian but Chromium uses the
// updated codes. Also, Android uses "tl" while Chromium uses "fil" for Tagalog/Filipino.
@@ -47,12 +38,12 @@ public class LocaleUtils {
} else if ("tl".equals(language)) {
language = "fil";
}
- return language;
+ return country.isEmpty() ? language : language + "-" + country;
}
/**
- * @return The default locale, translating Android deprecated language codes into the modern
- * ones used by Chromium.
+ * @return the default locale, translating Android deprecated
+ * language codes into the modern ones used by Chromium.
*/
@CalledByNative
public static String getDefaultLocale() {
@@ -60,7 +51,8 @@ public class LocaleUtils {
}
/**
- * @return The default country code set during install.
+ * Get the default country code set during install.
+ * @return country code.
*/
@CalledByNative
private static String getDefaultCountryCode() {

Powered by Google App Engine
This is Rietveld 408576698