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

Side by Side Diff: chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc

Issue 1703703002: MD Settings: Manage search engines, localizing/adding strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@manage_search_engines_ui1
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide r.h" 5 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide r.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 21 matching lines...) Expand all
32 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" 32 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h"
33 #endif 33 #endif
34 34
35 namespace { 35 namespace {
36 36
37 // Note that settings.html contains a <script> tag which imports a script of 37 // Note that settings.html contains a <script> tag which imports a script of
38 // the following name. These names must be kept in sync. 38 // the following name. These names must be kept in sync.
39 const char kLocalizedStringsFile[] = "strings.js"; 39 const char kLocalizedStringsFile[] = "strings.js";
40 40
41 void AddCommonStrings(content::WebUIDataSource* html_source) { 41 void AddCommonStrings(content::WebUIDataSource* html_source) {
42 html_source->AddLocalizedString("add", IDS_ADD);
43 html_source->AddLocalizedString("cancel", IDS_CANCEL);
44 html_source->AddLocalizedString("learnMore", IDS_LEARN_MORE);
45 html_source->AddLocalizedString("ok", IDS_OK);
46 html_source->AddLocalizedString("save", IDS_SAVE);
47
48 html_source->AddLocalizedString("advancedPageTitle", IDS_SETTINGS_ADVANCED);
42 html_source->AddLocalizedString("basicPageTitle", IDS_SETTINGS_BASIC); 49 html_source->AddLocalizedString("basicPageTitle", IDS_SETTINGS_BASIC);
43 html_source->AddLocalizedString("advancedPageTitle", IDS_SETTINGS_ADVANCED);
44 html_source->AddLocalizedString("addLabel", IDS_ADD);
45 html_source->AddLocalizedString("learnMore", IDS_LEARN_MORE);
46 html_source->AddLocalizedString("cancel", IDS_CANCEL);
47 html_source->AddLocalizedString("ok", IDS_OK);
48 html_source->AddLocalizedString("settings", IDS_SETTINGS_SETTINGS); 50 html_source->AddLocalizedString("settings", IDS_SETTINGS_SETTINGS);
49 } 51 }
50 52
51 #if defined(OS_CHROMEOS) 53 #if defined(OS_CHROMEOS)
52 void AddA11yStrings(content::WebUIDataSource* html_source) { 54 void AddA11yStrings(content::WebUIDataSource* html_source) {
53 html_source->AddLocalizedString( 55 html_source->AddLocalizedString(
54 "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY); 56 "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY);
55 html_source->AddLocalizedString( 57 html_source->AddLocalizedString(
56 "moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK); 58 "moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK);
57 html_source->AddLocalizedString( 59 html_source->AddLocalizedString(
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 IDS_SETTINGS_CLEAR_DATA); 642 IDS_SETTINGS_CLEAR_DATA);
641 html_source->AddLocalizedString("titleAndCount", 643 html_source->AddLocalizedString("titleAndCount",
642 IDS_SETTINGS_TITLE_AND_COUNT); 644 IDS_SETTINGS_TITLE_AND_COUNT);
643 } 645 }
644 646
645 void AddSearchStrings(content::WebUIDataSource* html_source) { 647 void AddSearchStrings(content::WebUIDataSource* html_source) {
646 html_source->AddLocalizedString("searchPageTitle", 648 html_source->AddLocalizedString("searchPageTitle",
647 IDS_SETTINGS_SEARCH); 649 IDS_SETTINGS_SEARCH);
648 html_source->AddLocalizedString("searchExplanation", 650 html_source->AddLocalizedString("searchExplanation",
649 IDS_SETTINGS_SEARCH_EXPLANATION); 651 IDS_SETTINGS_SEARCH_EXPLANATION);
650 html_source->AddLocalizedString("searchManageButtonLabel", 652 html_source->AddLocalizedString(
651 IDS_SETTINGS_SEARCH_MANAGE_BUTTON_LABEL); 653 "searchEnginesManage",
654 IDS_SETTINGS_SEARCH_MANAGE_MANAGE_SEARCH_ENGINES);
652 html_source->AddLocalizedString("searchOkGoogleLabel", 655 html_source->AddLocalizedString("searchOkGoogleLabel",
653 IDS_SETTINGS_SEARCH_OK_GOOGLE_LABEL); 656 IDS_SETTINGS_SEARCH_OK_GOOGLE_LABEL);
654 html_source->AddLocalizedString( 657 html_source->AddLocalizedString(
655 "searchOkGoogleLearnMoreLink", 658 "searchOkGoogleLearnMoreLink",
656 IDS_SETTINGS_SEARCH_OK_GOOGLE_LEARN_MORE_LINK); 659 IDS_SETTINGS_SEARCH_OK_GOOGLE_LEARN_MORE_LINK);
657 html_source->AddLocalizedString( 660 html_source->AddLocalizedString(
658 "searchOkGoogleDescriptionLabel", 661 "searchOkGoogleDescriptionLabel",
659 IDS_SETTINGS_SEARCH_OK_GOOGLE_DESCRIPTION_LABEL); 662 IDS_SETTINGS_SEARCH_OK_GOOGLE_DESCRIPTION_LABEL);
660 } 663 }
661 664
662 void AddSearchEnginesStrings(content::WebUIDataSource* html_source) { 665 void AddSearchEnginesStrings(content::WebUIDataSource* html_source) {
663 html_source->AddLocalizedString("searchEnginesPageTitle", 666 html_source->AddLocalizedString("searchEnginesPageTitle",
664 IDS_SETTINGS_SEARCH_ENGINES); 667 IDS_SETTINGS_SEARCH_ENGINES);
665 html_source->AddLocalizedString( 668 html_source->AddLocalizedString(
666 "searchEnginesAddSearchEngineLabel", 669 "searchEnginesAddASearchEngine",
667 IDS_SETTINGS_SEARCH_ENGINES_ADD_SEARCH_ENGINE_LABEL); 670 IDS_SETTINGS_SEARCH_ENGINES_ADD_A_SEARCH_ENGINE);
668 html_source->AddLocalizedString("searchEnginesLabel",
669 IDS_SETTINGS_SEARCH_ENGINES_LABEL);
670 html_source->AddLocalizedString( 671 html_source->AddLocalizedString(
671 "searchEnginesOtherLabel", 672 "searchEnginesAddSearchEngine",
672 IDS_SETTINGS_SEARCH_ENGINES_OTHER_ENGINES_LABEL); 673 IDS_SETTINGS_SEARCH_ENGINES_ADD_SEARCH_ENGINE);
673 html_source->AddLocalizedString( 674 html_source->AddLocalizedString(
674 "searchEnginesSearchEngineLabel", 675 "searchEnginesEditSearchEngine",
675 IDS_SETTINGS_SEARCH_ENGINES_SEARCH_ENGINE_LABEL); 676 IDS_SETTINGS_SEARCH_ENGINES_EDIT_SEARCH_ENGINE);
676 html_source->AddLocalizedString("searchEnginesKeywordLabel",
677 IDS_SETTINGS_SEARCH_ENGINES_KEYWORD_LABEL);
678 html_source->AddLocalizedString("searchEnginesQueryURLLabel",
679 IDS_SETTINGS_SEARCH_ENGINES_QUERY_URL_LABEL);
680 html_source->AddLocalizedString( 677 html_source->AddLocalizedString(
681 "searchEnginesAdd", IDS_SETTINGS_SEARCH_ENGINES_ADD); 678 "searchEnginesNotValid",
679 IDS_SETTINGS_SEARCH_ENGINES_NOT_VALID);
680 html_source->AddLocalizedString("searchEngines",
681 IDS_SETTINGS_SEARCH_ENGINES);
682 html_source->AddLocalizedString(
683 "searchEnginesOther",
684 IDS_SETTINGS_SEARCH_ENGINES_OTHER_ENGINES);
685 html_source->AddLocalizedString(
686 "searchEnginesSearchEngine",
687 IDS_SETTINGS_SEARCH_ENGINES_SEARCH_ENGINE);
688 html_source->AddLocalizedString("searchEnginesKeyword",
689 IDS_SETTINGS_SEARCH_ENGINES_KEYWORD);
690 html_source->AddLocalizedString("searchEnginesQueryURL",
691 IDS_SETTINGS_SEARCH_ENGINES_QUERY_URL);
692 html_source->AddLocalizedString(
693 "searchEnginesQueryURLExplanation",
694 IDS_SETTINGS_SEARCH_ENGINES_QUERY_URL_EXPLANATION);
682 html_source->AddLocalizedString( 695 html_source->AddLocalizedString(
683 "searchEnginesMakeDefault", IDS_SETTINGS_SEARCH_ENGINES_MAKE_DEFAULT); 696 "searchEnginesMakeDefault", IDS_SETTINGS_SEARCH_ENGINES_MAKE_DEFAULT);
684 html_source->AddLocalizedString( 697 html_source->AddLocalizedString(
685 "searchEnginesEdit", IDS_SETTINGS_SEARCH_ENGINES_EDIT); 698 "searchEnginesEdit", IDS_SETTINGS_SEARCH_ENGINES_EDIT);
686 html_source->AddLocalizedString( 699 html_source->AddLocalizedString(
687 "searchEnginesRemoveFromList", 700 "searchEnginesRemoveFromList",
688 IDS_SETTINGS_SEARCH_ENGINES_REMOVE_FROM_LIST); 701 IDS_SETTINGS_SEARCH_ENGINES_REMOVE_FROM_LIST);
689 } 702 }
690 703
691 void AddSiteSettingsStrings(content::WebUIDataSource* html_source) { 704 void AddSiteSettingsStrings(content::WebUIDataSource* html_source) {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 AddSiteSettingsStrings(html_source); 914 AddSiteSettingsStrings(html_source);
902 AddUsersStrings(html_source); 915 AddUsersStrings(html_source);
903 AddWebContentStrings(html_source); 916 AddWebContentStrings(html_source);
904 917
905 policy_indicator::AddLocalizedStrings(html_source); 918 policy_indicator::AddLocalizedStrings(html_source);
906 919
907 html_source->SetJsonPath(kLocalizedStringsFile); 920 html_source->SetJsonPath(kLocalizedStringsFile);
908 } 921 }
909 922
910 } // namespace settings 923 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698