OLD | NEW |
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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" | 9 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 // Note that settings.html contains a <script> tag which imports a script of | 32 // Note that settings.html contains a <script> tag which imports a script of |
33 // the following name. These names must be kept in sync. | 33 // the following name. These names must be kept in sync. |
34 const char kLocalizedStringsFile[] = "strings.js"; | 34 const char kLocalizedStringsFile[] = "strings.js"; |
35 | 35 |
36 void AddCommonStrings(content::WebUIDataSource* html_source) { | 36 void AddCommonStrings(content::WebUIDataSource* html_source) { |
37 html_source->AddLocalizedString("basicPageTitle", IDS_SETTINGS_BASIC); | 37 html_source->AddLocalizedString("basicPageTitle", IDS_SETTINGS_BASIC); |
38 html_source->AddLocalizedString("advancedPageTitle", IDS_SETTINGS_ADVANCED); | 38 html_source->AddLocalizedString("advancedPageTitle", IDS_SETTINGS_ADVANCED); |
39 html_source->AddLocalizedString("addLabel", IDS_ADD); | 39 html_source->AddLocalizedString("addLabel", IDS_ADD); |
40 html_source->AddLocalizedString("learnMore", IDS_LEARN_MORE); | 40 html_source->AddLocalizedString("learnMore", IDS_LEARN_MORE); |
| 41 html_source->AddLocalizedString("cancel", IDS_CANCEL); |
41 } | 42 } |
42 | 43 |
43 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
44 void AddA11yStrings(content::WebUIDataSource* html_source) { | 45 void AddA11yStrings(content::WebUIDataSource* html_source) { |
45 html_source->AddLocalizedString( | 46 html_source->AddLocalizedString( |
46 "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY); | 47 "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY); |
47 html_source->AddLocalizedString( | 48 html_source->AddLocalizedString( |
48 "moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK); | 49 "moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK); |
49 html_source->AddLocalizedString( | 50 html_source->AddLocalizedString( |
50 "optionsInMenuLabel", IDS_SETTINGS_OPTIONS_IN_MENU_LABEL); | 51 "optionsInMenuLabel", IDS_SETTINGS_OPTIONS_IN_MENU_LABEL); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 html_source->AddLocalizedString( | 218 html_source->AddLocalizedString( |
218 "downloadsPageTitle", IDS_SETTINGS_DOWNLOADS); | 219 "downloadsPageTitle", IDS_SETTINGS_DOWNLOADS); |
219 html_source->AddLocalizedString( | 220 html_source->AddLocalizedString( |
220 "downloadLocation", IDS_SETTINGS_DOWNLOAD_LOCATION); | 221 "downloadLocation", IDS_SETTINGS_DOWNLOAD_LOCATION); |
221 html_source->AddLocalizedString( | 222 html_source->AddLocalizedString( |
222 "changeDownloadLocation", IDS_SETTINGS_CHANGE_DOWNLOAD_LOCATION); | 223 "changeDownloadLocation", IDS_SETTINGS_CHANGE_DOWNLOAD_LOCATION); |
223 html_source->AddLocalizedString( | 224 html_source->AddLocalizedString( |
224 "promptForDownload", IDS_SETTINGS_PROMPT_FOR_DOWNLOAD); | 225 "promptForDownload", IDS_SETTINGS_PROMPT_FOR_DOWNLOAD); |
225 } | 226 } |
226 | 227 |
| 228 void AddResetStrings(content::WebUIDataSource* html_source) { |
| 229 html_source->AddLocalizedString( |
| 230 "resetPageTitle", IDS_RESET_PROFILE_SETTINGS_SECTION_TITLE); |
| 231 html_source->AddLocalizedString( |
| 232 "resetPageDescription", IDS_RESET_PROFILE_SETTINGS_DESCRIPTION); |
| 233 html_source->AddLocalizedString( |
| 234 "resetPageExplanation", IDS_RESET_PROFILE_SETTINGS_EXPLANATION); |
| 235 html_source->AddLocalizedString( |
| 236 "resetPageCommit", IDS_RESET_PROFILE_SETTINGS_COMMIT_BUTTON); |
| 237 html_source->AddLocalizedString( |
| 238 "resetPageFeedback", IDS_RESET_PROFILE_SETTINGS_FEEDBACK); |
| 239 html_source->AddString( |
| 240 "resetPageLearnMoreUrl", |
| 241 chrome::kResetProfileSettingsLearnMoreURL); |
| 242 } |
| 243 |
227 void AddDateTimeStrings(content::WebUIDataSource* html_source) { | 244 void AddDateTimeStrings(content::WebUIDataSource* html_source) { |
228 html_source->AddLocalizedString( | 245 html_source->AddLocalizedString( |
229 "dateTimePageTitle", IDS_SETTINGS_DATE_TIME); | 246 "dateTimePageTitle", IDS_SETTINGS_DATE_TIME); |
230 html_source->AddLocalizedString( | 247 html_source->AddLocalizedString( |
231 "timeZone", IDS_SETTINGS_TIME_ZONE); | 248 "timeZone", IDS_SETTINGS_TIME_ZONE); |
232 html_source->AddLocalizedString( | 249 html_source->AddLocalizedString( |
233 "use24HourClock", IDS_SETTINGS_USE_24_HOUR_CLOCK); | 250 "use24HourClock", IDS_SETTINGS_USE_24_HOUR_CLOCK); |
234 html_source->AddLocalizedString( | 251 html_source->AddLocalizedString( |
235 "dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY); | 252 "dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY); |
236 } | 253 } |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 "encryptWithGoogleCredentialsLabel", | 538 "encryptWithGoogleCredentialsLabel", |
522 IDS_SETTINGS_ENCRYPT_WITH_GOOGLE_CREDENTIALS_LABEL); | 539 IDS_SETTINGS_ENCRYPT_WITH_GOOGLE_CREDENTIALS_LABEL); |
523 html_source->AddLocalizedString( | 540 html_source->AddLocalizedString( |
524 "encryptWithSyncPassphraseLabel", | 541 "encryptWithSyncPassphraseLabel", |
525 IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LABEL); | 542 IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LABEL); |
526 html_source->AddLocalizedString( | 543 html_source->AddLocalizedString( |
527 "encryptWithSyncPassphraseLearnMoreLink", | 544 "encryptWithSyncPassphraseLearnMoreLink", |
528 IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LEARN_MORE_LINK); | 545 IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LEARN_MORE_LINK); |
529 html_source->AddLocalizedString("useDefaultSettingsButton", | 546 html_source->AddLocalizedString("useDefaultSettingsButton", |
530 IDS_SETTINGS_USE_DEFAULT_SETTINGS_BUTTON); | 547 IDS_SETTINGS_USE_DEFAULT_SETTINGS_BUTTON); |
| 548 // TODO(dpapad): Remove this string and use IDS_CANCEL (see AddCommonStrings |
| 549 // at the top of this file). |
531 html_source->AddLocalizedString("cancelButton", | 550 html_source->AddLocalizedString("cancelButton", |
532 IDS_SETTINGS_CANCEL_BUTTON); | 551 IDS_SETTINGS_CANCEL_BUTTON); |
533 html_source->AddLocalizedString("okButton", | 552 html_source->AddLocalizedString("okButton", |
534 IDS_SETTINGS_OK_BUTTON); | 553 IDS_SETTINGS_OK_BUTTON); |
535 html_source->AddLocalizedString("passphraseExplanationText", | 554 html_source->AddLocalizedString("passphraseExplanationText", |
536 IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT); | 555 IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT); |
537 html_source->AddLocalizedString("emptyPassphraseError", | 556 html_source->AddLocalizedString("emptyPassphraseError", |
538 IDS_SETTINGS_EMPTY_PASSPHRASE_ERROR); | 557 IDS_SETTINGS_EMPTY_PASSPHRASE_ERROR); |
539 html_source->AddLocalizedString("mismatchedPassphraseError", | 558 html_source->AddLocalizedString("mismatchedPassphraseError", |
540 IDS_SETTINGS_MISMATCHED_PASSPHRASE_ERROR); | 559 IDS_SETTINGS_MISMATCHED_PASSPHRASE_ERROR); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 AddDownloadsStrings(html_source); | 640 AddDownloadsStrings(html_source); |
622 #if defined(OS_CHROMEOS) | 641 #if defined(OS_CHROMEOS) |
623 AddInternetStrings(html_source); | 642 AddInternetStrings(html_source); |
624 #endif | 643 #endif |
625 AddLanguagesStrings(html_source); | 644 AddLanguagesStrings(html_source); |
626 #if defined(OS_CHROMEOS) | 645 #if defined(OS_CHROMEOS) |
627 AddMultiProfilesStrings(html_source, profile); | 646 AddMultiProfilesStrings(html_source, profile); |
628 #endif | 647 #endif |
629 AddOnStartupStrings(html_source); | 648 AddOnStartupStrings(html_source); |
630 AddPrivacyStrings(html_source); | 649 AddPrivacyStrings(html_source); |
| 650 AddResetStrings(html_source); |
631 AddSearchEnginesStrings(html_source); | 651 AddSearchEnginesStrings(html_source); |
632 AddSearchStrings(html_source); | 652 AddSearchStrings(html_source); |
633 #if !defined(OS_CHROMEOS) | 653 #if !defined(OS_CHROMEOS) |
634 AddSigninSettingsStrings(html_source); | 654 AddSigninSettingsStrings(html_source); |
635 #endif | 655 #endif |
636 AddSiteSettingsStrings(html_source); | 656 AddSiteSettingsStrings(html_source); |
637 AddSyncStrings(html_source); | 657 AddSyncStrings(html_source); |
638 AddUsersStrings(html_source); | 658 AddUsersStrings(html_source); |
639 AddWebContentStrings(html_source); | 659 AddWebContentStrings(html_source); |
640 | 660 |
641 policy_indicator::AddLocalizedStrings(html_source); | 661 policy_indicator::AddLocalizedStrings(html_source); |
642 | 662 |
643 html_source->SetJsonPath(kLocalizedStringsFile); | 663 html_source->SetJsonPath(kLocalizedStringsFile); |
644 } | 664 } |
645 | 665 |
646 } // namespace settings | 666 } // namespace settings |
OLD | NEW |