| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 | 8 |
| 9 #include "app/app_paths.h" | 9 #include "app/app_paths.h" |
| 10 #include "app/l10n_util_collator.h" | 10 #include "app/l10n_util_collator.h" |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 // Found a valid break point. | 713 // Found a valid break point. |
| 714 index = char_iterator.getIndex(); | 714 index = char_iterator.getIndex(); |
| 715 } else { | 715 } else { |
| 716 // String has leading whitespace, return the elide string. | 716 // String has leading whitespace, return the elide string. |
| 717 return kElideString; | 717 return kElideString; |
| 718 } | 718 } |
| 719 } | 719 } |
| 720 return string.substr(0, index) + kElideString; | 720 return string.substr(0, index) + kElideString; |
| 721 } | 721 } |
| 722 | 722 |
| 723 #if defined(WCHAR_T_IS_UTF32) | |
| 724 std::wstring ToLower(const std::wstring& string) { | |
| 725 return UTF16ToWide(ToLower(WideToUTF16(string))); | |
| 726 } | |
| 727 #endif // defined(WCHAR_T_IS_UTF32) | |
| 728 | |
| 729 string16 ToLower(const string16& string) { | 723 string16 ToLower(const string16& string) { |
| 730 icu::UnicodeString lower_u_str( | 724 icu::UnicodeString lower_u_str( |
| 731 icu::UnicodeString(string.c_str()).toLower(icu::Locale::getDefault())); | 725 icu::UnicodeString(string.c_str()).toLower(icu::Locale::getDefault())); |
| 732 string16 result; | 726 string16 result; |
| 733 lower_u_str.extract(0, lower_u_str.length(), | 727 lower_u_str.extract(0, lower_u_str.length(), |
| 734 WriteInto(&result, lower_u_str.length() + 1)); | 728 WriteInto(&result, lower_u_str.length() + 1)); |
| 735 return result; | 729 return result; |
| 736 } | 730 } |
| 737 | 731 |
| 738 string16 ToUpper(const string16& string) { | 732 string16 ToUpper(const string16& string) { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) { | 846 for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) { |
| 853 if (!IsLocaleNameTranslated(kAcceptLanguageList[i], display_locale)) | 847 if (!IsLocaleNameTranslated(kAcceptLanguageList[i], display_locale)) |
| 854 // TODO(jungshik) : Put them at the of the list with language codes | 848 // TODO(jungshik) : Put them at the of the list with language codes |
| 855 // enclosed by brackets instead of skipping. | 849 // enclosed by brackets instead of skipping. |
| 856 continue; | 850 continue; |
| 857 locale_codes->push_back(kAcceptLanguageList[i]); | 851 locale_codes->push_back(kAcceptLanguageList[i]); |
| 858 } | 852 } |
| 859 } | 853 } |
| 860 | 854 |
| 861 } // namespace l10n_util | 855 } // namespace l10n_util |
| OLD | NEW |