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" |
11 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/i18n/file_util_icu.h" | 14 #include "base/i18n/file_util_icu.h" |
15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
18 #include "base/string16.h" | 18 #include "base/string16.h" |
19 #include "base/string_piece.h" | 19 #include "base/string_number_conversions.h" |
20 #include "base/string_util.h" | |
21 #include "base/sys_string_conversions.h" | 20 #include "base/sys_string_conversions.h" |
22 #include "build/build_config.h" | 21 #include "build/build_config.h" |
23 #include "gfx/canvas.h" | 22 #include "gfx/canvas.h" |
24 #include "unicode/rbbi.h" | 23 #include "unicode/rbbi.h" |
25 | 24 |
26 #if defined(OS_MACOSX) | 25 #if defined(OS_MACOSX) |
27 #include "app/l10n_util_mac.h" | 26 #include "app/l10n_util_mac.h" |
28 #endif | 27 #endif |
29 | 28 |
30 // TODO(playmobil): remove this undef once SkPostConfig.h is fixed. | 29 // TODO(playmobil): remove this undef once SkPostConfig.h is fixed. |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 } | 640 } |
642 | 641 |
643 string16 GetStringFUTF16(int message_id, | 642 string16 GetStringFUTF16(int message_id, |
644 const string16& a, | 643 const string16& a, |
645 const string16& b, | 644 const string16& b, |
646 std::vector<size_t>* offsets) { | 645 std::vector<size_t>* offsets) { |
647 return GetStringF(message_id, a, b, string16(), string16(), offsets); | 646 return GetStringF(message_id, a, b, string16(), string16(), offsets); |
648 } | 647 } |
649 | 648 |
650 std::wstring GetStringF(int message_id, int a) { | 649 std::wstring GetStringF(int message_id, int a) { |
651 return GetStringF(message_id, IntToWString(a)); | 650 return GetStringF(message_id, UTF8ToWide(base::IntToString(a))); |
652 } | 651 } |
653 | 652 |
654 std::wstring GetStringF(int message_id, int64 a) { | 653 std::wstring GetStringF(int message_id, int64 a) { |
655 return GetStringF(message_id, Int64ToWString(a)); | 654 return GetStringF(message_id, UTF8ToWide(base::Int64ToString(a))); |
656 } | 655 } |
657 | 656 |
658 std::wstring TruncateString(const std::wstring& string, size_t length) { | 657 std::wstring TruncateString(const std::wstring& string, size_t length) { |
659 if (string.size() <= length) | 658 if (string.size() <= length) |
660 // String fits, return it. | 659 // String fits, return it. |
661 return string; | 660 return string; |
662 | 661 |
663 if (length == 0) { | 662 if (length == 0) { |
664 // No room for the ellide string, return an empty string. | 663 // No room for the ellide string, return an empty string. |
665 return std::wstring(L""); | 664 return std::wstring(L""); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) { | 851 for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) { |
853 if (!IsLocaleNameTranslated(kAcceptLanguageList[i], display_locale)) | 852 if (!IsLocaleNameTranslated(kAcceptLanguageList[i], display_locale)) |
854 // TODO(jungshik) : Put them at the of the list with language codes | 853 // TODO(jungshik) : Put them at the of the list with language codes |
855 // enclosed by brackets instead of skipping. | 854 // enclosed by brackets instead of skipping. |
856 continue; | 855 continue; |
857 locale_codes->push_back(kAcceptLanguageList[i]); | 856 locale_codes->push_back(kAcceptLanguageList[i]); |
858 } | 857 } |
859 } | 858 } |
860 | 859 |
861 } // namespace l10n_util | 860 } // namespace l10n_util |
OLD | NEW |