| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 html_source->AddLocalizedString( | 216 html_source->AddLocalizedString( |
| 216 "downloadsPageTitle", IDS_SETTINGS_DOWNLOADS); | 217 "downloadsPageTitle", IDS_SETTINGS_DOWNLOADS); |
| 217 html_source->AddLocalizedString( | 218 html_source->AddLocalizedString( |
| 218 "downloadLocation", IDS_SETTINGS_DOWNLOAD_LOCATION); | 219 "downloadLocation", IDS_SETTINGS_DOWNLOAD_LOCATION); |
| 219 html_source->AddLocalizedString( | 220 html_source->AddLocalizedString( |
| 220 "changeDownloadLocation", IDS_SETTINGS_CHANGE_DOWNLOAD_LOCATION); | 221 "changeDownloadLocation", IDS_SETTINGS_CHANGE_DOWNLOAD_LOCATION); |
| 221 html_source->AddLocalizedString( | 222 html_source->AddLocalizedString( |
| 222 "promptForDownload", IDS_SETTINGS_PROMPT_FOR_DOWNLOAD); | 223 "promptForDownload", IDS_SETTINGS_PROMPT_FOR_DOWNLOAD); |
| 223 } | 224 } |
| 224 | 225 |
| 226 void AddResetStrings(content::WebUIDataSource* html_source) { |
| 227 html_source->AddLocalizedString( |
| 228 "resetPageTitle", IDS_RESET_PROFILE_SETTINGS_SECTION_TITLE); |
| 229 html_source->AddLocalizedString( |
| 230 "resetPageDescription", IDS_RESET_PROFILE_SETTINGS_DESCRIPTION); |
| 231 html_source->AddLocalizedString( |
| 232 "resetPageExplanation", IDS_RESET_PROFILE_SETTINGS_EXPLANATION); |
| 233 html_source->AddLocalizedString( |
| 234 "resetPageCommit", IDS_RESET_PROFILE_SETTINGS_COMMIT_BUTTON); |
| 235 html_source->AddLocalizedString( |
| 236 "resetPageFeedback", IDS_RESET_PROFILE_SETTINGS_FEEDBACK); |
| 237 html_source->AddString( |
| 238 "resetPageLearnMoreUrl", |
| 239 chrome::kResetProfileSettingsLearnMoreURL); |
| 240 } |
| 241 |
| 225 void AddDateTimeStrings(content::WebUIDataSource* html_source) { | 242 void AddDateTimeStrings(content::WebUIDataSource* html_source) { |
| 226 html_source->AddLocalizedString( | 243 html_source->AddLocalizedString( |
| 227 "dateTimePageTitle", IDS_SETTINGS_DATE_TIME); | 244 "dateTimePageTitle", IDS_SETTINGS_DATE_TIME); |
| 228 html_source->AddLocalizedString( | 245 html_source->AddLocalizedString( |
| 229 "timeZone", IDS_SETTINGS_TIME_ZONE); | 246 "timeZone", IDS_SETTINGS_TIME_ZONE); |
| 230 html_source->AddLocalizedString( | 247 html_source->AddLocalizedString( |
| 231 "use24HourClock", IDS_SETTINGS_USE_24_HOUR_CLOCK); | 248 "use24HourClock", IDS_SETTINGS_USE_24_HOUR_CLOCK); |
| 232 html_source->AddLocalizedString( | 249 html_source->AddLocalizedString( |
| 233 "dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY); | 250 "dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY); |
| 234 } | 251 } |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 "encryptWithGoogleCredentialsLabel", | 524 "encryptWithGoogleCredentialsLabel", |
| 508 IDS_SETTINGS_ENCRYPT_WITH_GOOGLE_CREDENTIALS_LABEL); | 525 IDS_SETTINGS_ENCRYPT_WITH_GOOGLE_CREDENTIALS_LABEL); |
| 509 html_source->AddLocalizedString( | 526 html_source->AddLocalizedString( |
| 510 "encryptWithSyncPassphraseLabel", | 527 "encryptWithSyncPassphraseLabel", |
| 511 IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LABEL); | 528 IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LABEL); |
| 512 html_source->AddLocalizedString( | 529 html_source->AddLocalizedString( |
| 513 "encryptWithSyncPassphraseLearnMoreLink", | 530 "encryptWithSyncPassphraseLearnMoreLink", |
| 514 IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LEARN_MORE_LINK); | 531 IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LEARN_MORE_LINK); |
| 515 html_source->AddLocalizedString("useDefaultSettingsButton", | 532 html_source->AddLocalizedString("useDefaultSettingsButton", |
| 516 IDS_SETTINGS_USE_DEFAULT_SETTINGS_BUTTON); | 533 IDS_SETTINGS_USE_DEFAULT_SETTINGS_BUTTON); |
| 534 // TODO(dpapad): Remove this string and use IDS_CANCEL (see AddCommonStrings |
| 535 // at the top of this file). |
| 517 html_source->AddLocalizedString("cancelButton", | 536 html_source->AddLocalizedString("cancelButton", |
| 518 IDS_SETTINGS_CANCEL_BUTTON); | 537 IDS_SETTINGS_CANCEL_BUTTON); |
| 519 html_source->AddLocalizedString("okButton", | 538 html_source->AddLocalizedString("okButton", |
| 520 IDS_SETTINGS_OK_BUTTON); | 539 IDS_SETTINGS_OK_BUTTON); |
| 521 html_source->AddLocalizedString("passphraseExplanationText", | 540 html_source->AddLocalizedString("passphraseExplanationText", |
| 522 IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT); | 541 IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT); |
| 523 html_source->AddLocalizedString("emptyPassphraseError", | 542 html_source->AddLocalizedString("emptyPassphraseError", |
| 524 IDS_SETTINGS_EMPTY_PASSPHRASE_ERROR); | 543 IDS_SETTINGS_EMPTY_PASSPHRASE_ERROR); |
| 525 html_source->AddLocalizedString("mismatchedPassphraseError", | 544 html_source->AddLocalizedString("mismatchedPassphraseError", |
| 526 IDS_SETTINGS_MISMATCHED_PASSPHRASE_ERROR); | 545 IDS_SETTINGS_MISMATCHED_PASSPHRASE_ERROR); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 AddDownloadsStrings(html_source); | 626 AddDownloadsStrings(html_source); |
| 608 #if defined(OS_CHROMEOS) | 627 #if defined(OS_CHROMEOS) |
| 609 AddInternetStrings(html_source); | 628 AddInternetStrings(html_source); |
| 610 #endif | 629 #endif |
| 611 AddLanguagesStrings(html_source); | 630 AddLanguagesStrings(html_source); |
| 612 #if defined(OS_CHROMEOS) | 631 #if defined(OS_CHROMEOS) |
| 613 AddMultiProfilesStrings(html_source, profile); | 632 AddMultiProfilesStrings(html_source, profile); |
| 614 #endif | 633 #endif |
| 615 AddOnStartupStrings(html_source); | 634 AddOnStartupStrings(html_source); |
| 616 AddPrivacyStrings(html_source); | 635 AddPrivacyStrings(html_source); |
| 636 AddResetStrings(html_source); |
| 617 AddSearchEnginesStrings(html_source); | 637 AddSearchEnginesStrings(html_source); |
| 618 AddSearchStrings(html_source); | 638 AddSearchStrings(html_source); |
| 619 #if !defined(OS_CHROMEOS) | 639 #if !defined(OS_CHROMEOS) |
| 620 AddSigninSettingsStrings(html_source); | 640 AddSigninSettingsStrings(html_source); |
| 621 #endif | 641 #endif |
| 622 AddSiteSettingsStrings(html_source); | 642 AddSiteSettingsStrings(html_source); |
| 623 AddSyncStrings(html_source); | 643 AddSyncStrings(html_source); |
| 624 AddUsersStrings(html_source); | 644 AddUsersStrings(html_source); |
| 625 AddWebContentStrings(html_source); | 645 AddWebContentStrings(html_source); |
| 626 | 646 |
| 627 policy_indicator::AddLocalizedStrings(html_source); | 647 policy_indicator::AddLocalizedStrings(html_source); |
| 628 | 648 |
| 629 html_source->SetJsonPath(kLocalizedStringsFile); | 649 html_source->SetJsonPath(kLocalizedStringsFile); |
| 630 } | 650 } |
| 631 | 651 |
| 632 } // namespace settings | 652 } // namespace settings |
| OLD | NEW |