Chromium Code Reviews| 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..60fc9557e1288f26ff042d6b3d32fd07b1f7e9a1 |
| --- /dev/null |
| +++ b/base/android/java/org/chromium/base/LocaleUtils.java |
| @@ -0,0 +1,24 @@ |
| +// 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(); |
| + return locale.getLanguage() + "-" + locale.getCountry(); |
|
Mark Mentovai
2012/04/25 20:00:20
Is this always right? Will there never be a case w
Xianzhu
2012/04/25 22:31:46
I think it should handle locales without country.
Mark Mentovai
2012/04/25 22:38:51
Xianzhu wrote:
Xianzhu
2012/04/25 22:53:15
Sorry I forgot to mention I would make the change
|
| + } |
| +} |