| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/i18n/rtl.h" | 5 #include "base/i18n/rtl.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "third_party/icu/public/common/unicode/locid.h" | 12 #include "third_party/icu/source/common/unicode/locid.h" |
| 13 #include "third_party/icu/public/common/unicode/uchar.h" | 13 #include "third_party/icu/source/common/unicode/uchar.h" |
| 14 #include "third_party/icu/public/common/unicode/uscript.h" | 14 #include "third_party/icu/source/common/unicode/uscript.h" |
| 15 #include "third_party/icu/public/i18n/unicode/coll.h" | 15 #include "third_party/icu/source/i18n/unicode/coll.h" |
| 16 | 16 |
| 17 #if defined(TOOLKIT_GTK) | 17 #if defined(TOOLKIT_GTK) |
| 18 #include <gtk/gtk.h> | 18 #include <gtk/gtk.h> |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // Extract language, country and variant, but ignore keywords. For example, | 23 // Extract language, country and variant, but ignore keywords. For example, |
| 24 // en-US, ca@valencia, ca-ES@valencia. | 24 // en-US, ca@valencia, ca-ES@valencia. |
| 25 std::string GetLocaleString(const icu::Locale& locale) { | 25 std::string GetLocaleString(const icu::Locale& locale) { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 begin == kRightToLeftOverride) | 374 begin == kRightToLeftOverride) |
| 375 ++begin_index; | 375 ++begin_index; |
| 376 size_t end_index = text.length() - 1; | 376 size_t end_index = text.length() - 1; |
| 377 if (text[end_index] == kPopDirectionalFormatting) | 377 if (text[end_index] == kPopDirectionalFormatting) |
| 378 --end_index; | 378 --end_index; |
| 379 return text.substr(begin_index, end_index - begin_index + 1); | 379 return text.substr(begin_index, end_index - begin_index + 1); |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace i18n | 382 } // namespace i18n |
| 383 } // namespace base | 383 } // namespace base |
| OLD | NEW |