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

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

Issue 10310029: Reapply "Changes according to review comments" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use StartsWith Created 8 years, 8 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
« no previous file with comments | « no previous file | base/android/locale_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/org/chromium/base/LocaleUtils.java
diff --git a/base/android/java/org/chromium/base/LocaleUtils.java b/base/android/java/org/chromium/base/LocaleUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..6bca1f70bd4b348533eebc844002a7c0ea78b908
--- /dev/null
+++ b/base/android/java/org/chromium/base/LocaleUtils.java
@@ -0,0 +1,26 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base;
+
+import java.util.Locale;
+
+/**
+ * This class provides the locale related methods for the native library.
+ */
+class LocaleUtils {
+
+ private LocaleUtils() { /* cannot be instantiated */ }
+
+ /**
+ * @return the default locale.
+ */
+ @CalledByNative
+ public static String getDefaultLocale() {
+ Locale locale = Locale.getDefault();
+ String language = locale.getLanguage();
+ String country = locale.getCountry();
+ return country.isEmpty() ? language : language + "-" + country;
+ }
+}
« no previous file with comments | « no previous file | base/android/locale_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698