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

Side by Side Diff: app/l10n_util.cc

Issue 2602003: Refactored the translate infobars. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Synced Created 10 years, 6 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 unified diff | Download patch
« no previous file with comments | « app/l10n_util.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/app_switches.h" 10 #include "app/app_switches.h"
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 } 641 }
642 642
643 std::wstring GetStringF(int message_id, 643 std::wstring GetStringF(int message_id,
644 const std::wstring& a, 644 const std::wstring& a,
645 const std::wstring& b, 645 const std::wstring& b,
646 std::vector<size_t>* offsets) { 646 std::vector<size_t>* offsets) {
647 return UTF16ToWide(GetStringF(message_id, WideToUTF16(a), WideToUTF16(b), 647 return UTF16ToWide(GetStringF(message_id, WideToUTF16(a), WideToUTF16(b),
648 string16(), string16(), offsets)); 648 string16(), string16(), offsets));
649 } 649 }
650 650
651 string16 GetStringFUTF16(int message_id, const string16& a, size_t* offset) {
652 DCHECK(offset);
653 std::vector<size_t> offsets;
654 string16 result = GetStringFUTF16(message_id, a, string16(), &offsets);
655 DCHECK(offsets.size() == 1);
656 *offset = offsets[0];
657 return result;
658 }
659
651 string16 GetStringFUTF16(int message_id, 660 string16 GetStringFUTF16(int message_id,
652 const string16& a, 661 const string16& a,
653 const string16& b, 662 const string16& b,
654 std::vector<size_t>* offsets) { 663 std::vector<size_t>* offsets) {
655 return GetStringF(message_id, a, b, string16(), string16(), offsets); 664 return GetStringF(message_id, a, b, string16(), string16(), offsets);
656 } 665 }
657 666
658 std::wstring GetStringF(int message_id, int a) { 667 std::wstring GetStringF(int message_id, int a) {
659 return GetStringF(message_id, IntToWString(a)); 668 return GetStringF(message_id, IntToWString(a));
660 } 669 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) { 869 for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) {
861 if (!IsLocaleNameTranslated(kAcceptLanguageList[i], display_locale)) 870 if (!IsLocaleNameTranslated(kAcceptLanguageList[i], display_locale))
862 // TODO(jungshik) : Put them at the of the list with language codes 871 // TODO(jungshik) : Put them at the of the list with language codes
863 // enclosed by brackets instead of skipping. 872 // enclosed by brackets instead of skipping.
864 continue; 873 continue;
865 locale_codes->push_back(kAcceptLanguageList[i]); 874 locale_codes->push_back(kAcceptLanguageList[i]);
866 } 875 }
867 } 876 }
868 877
869 } // namespace l10n_util 878 } // namespace l10n_util
OLDNEW
« no previous file with comments | « app/l10n_util.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698