| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/number_formatting.h" |
| 11 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 12 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" | 16 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" |
| 15 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 16 #include "chrome/grit/chromium_strings.h" | 18 #include "chrome/grit/chromium_strings.h" |
| 17 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
| 18 #include "chrome/grit/google_chrome_strings.h" | 20 #include "chrome/grit/google_chrome_strings.h" |
| 19 #include "chrome/grit/locale_settings.h" | 21 #include "chrome/grit/locale_settings.h" |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 arraysize(localized_strings)); | 737 arraysize(localized_strings)); |
| 736 } | 738 } |
| 737 | 739 |
| 738 void AddPeopleStrings(content::WebUIDataSource* html_source) { | 740 void AddPeopleStrings(content::WebUIDataSource* html_source) { |
| 739 LocalizedString localized_strings[] = { | 741 LocalizedString localized_strings[] = { |
| 740 {"peoplePageTitle", IDS_SETTINGS_PEOPLE}, | 742 {"peoplePageTitle", IDS_SETTINGS_PEOPLE}, |
| 741 {"manageOtherPeople", IDS_SETTINGS_PEOPLE_MANAGE_OTHER_PEOPLE}, | 743 {"manageOtherPeople", IDS_SETTINGS_PEOPLE_MANAGE_OTHER_PEOPLE}, |
| 742 {"manageSupervisedUsers", IDS_SETTINGS_PEOPLE_MANAGE_SUPERVISED_USERS}, | 744 {"manageSupervisedUsers", IDS_SETTINGS_PEOPLE_MANAGE_SUPERVISED_USERS}, |
| 743 #if defined(OS_CHROMEOS) | 745 #if defined(OS_CHROMEOS) |
| 744 {"enableScreenlock", IDS_SETTINGS_PEOPLE_ENABLE_SCREENLOCK}, | 746 {"enableScreenlock", IDS_SETTINGS_PEOPLE_ENABLE_SCREENLOCK}, |
| 747 {"pinKeyboardPlaceholderPin", IDS_PIN_KEYBOARD_HINT_TEXT_PIN}, |
| 748 {"pinKeyboardPlaceholderPinPassword", |
| 749 IDS_PIN_KEYBOARD_HINT_TEXT_PIN_PASSWORD}, |
| 750 {"pinKeyboardClear", IDS_PIN_KEYBOARD_CLEAR}, |
| 745 {"quickUnlockTitle", IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_TITLE}, | 751 {"quickUnlockTitle", IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_TITLE}, |
| 746 {"quickUnlockConfirmLogin", IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIRM_LOGIN}, | 752 {"quickUnlockConfirmLogin", IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CONFIRM_LOGIN}, |
| 747 {"quickUnlockPasswordLabel", | 753 {"quickUnlockPasswordLabel", |
| 748 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_PASSWORD_LABEL}, | 754 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_PASSWORD_LABEL}, |
| 749 {"quickUnlockInvalidPassword", | 755 {"quickUnlockInvalidPassword", |
| 750 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_INVALID_PASSWORD}, | 756 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_INVALID_PASSWORD}, |
| 751 {"quickUnlockChooseUnlockMethod", | 757 {"quickUnlockChooseUnlockMethod", |
| 752 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CHOOSE_UNLOCK_METHOD}, | 758 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_CHOOSE_UNLOCK_METHOD}, |
| 753 {"quickUnlockUnlockMethodPassword", | 759 {"quickUnlockUnlockMethodPassword", |
| 754 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_UNLOCK_METHOD_PASSWORD}, | 760 IDS_SETTINGS_PEOPLE_QUICK_UNLOCK_UNLOCK_METHOD_PASSWORD}, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 IDS_SETTINGS_PASSPHRASE_CONFIRMATION_PLACEHOLDER}, | 846 IDS_SETTINGS_PASSPHRASE_CONFIRMATION_PLACEHOLDER}, |
| 841 {"submitPassphraseButton", IDS_SETTINGS_SUBMIT_PASSPHRASE}, | 847 {"submitPassphraseButton", IDS_SETTINGS_SUBMIT_PASSPHRASE}, |
| 842 {"personalizeGoogleServicesTitle", | 848 {"personalizeGoogleServicesTitle", |
| 843 IDS_SETTINGS_PERSONALIZE_GOOGLE_SERVICES_TITLE}, | 849 IDS_SETTINGS_PERSONALIZE_GOOGLE_SERVICES_TITLE}, |
| 844 {"personalizeGoogleServicesText", | 850 {"personalizeGoogleServicesText", |
| 845 IDS_SETTINGS_PERSONALIZE_GOOGLE_SERVICES_TEXT}, | 851 IDS_SETTINGS_PERSONALIZE_GOOGLE_SERVICES_TEXT}, |
| 846 }; | 852 }; |
| 847 AddLocalizedStringsBulk(html_source, localized_strings, | 853 AddLocalizedStringsBulk(html_source, localized_strings, |
| 848 arraysize(localized_strings)); | 854 arraysize(localized_strings)); |
| 849 | 855 |
| 856 // Format numbers to be used on the pin keyboard. |
| 857 for (int j = 0; j <= 9; j++) { |
| 858 html_source->AddString("pinKeyboard" + base::IntToString(j), |
| 859 base::FormatNumber(int64_t{j})); |
| 860 } |
| 861 |
| 850 html_source->AddString("autofillHelpURL", autofill::kHelpURL); | 862 html_source->AddString("autofillHelpURL", autofill::kHelpURL); |
| 851 html_source->AddString("supervisedUsersUrl", | 863 html_source->AddString("supervisedUsersUrl", |
| 852 chrome::kLegacySupervisedUserManagementURL); | 864 chrome::kLegacySupervisedUserManagementURL); |
| 853 std::string sync_dashboard_url = | 865 std::string sync_dashboard_url = |
| 854 google_util::AppendGoogleLocaleParam( | 866 google_util::AppendGoogleLocaleParam( |
| 855 GURL(chrome::kSyncGoogleDashboardURL), | 867 GURL(chrome::kSyncGoogleDashboardURL), |
| 856 g_browser_process->GetApplicationLocale()) | 868 g_browser_process->GetApplicationLocale()) |
| 857 .spec(); | 869 .spec(); |
| 858 html_source->AddString("syncDashboardUrl", sync_dashboard_url); | 870 html_source->AddString("syncDashboardUrl", sync_dashboard_url); |
| 859 html_source->AddString( | 871 html_source->AddString( |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 #endif | 1209 #endif |
| 1198 AddUsersStrings(html_source); | 1210 AddUsersStrings(html_source); |
| 1199 AddWebContentStrings(html_source); | 1211 AddWebContentStrings(html_source); |
| 1200 | 1212 |
| 1201 policy_indicator::AddLocalizedStrings(html_source); | 1213 policy_indicator::AddLocalizedStrings(html_source); |
| 1202 | 1214 |
| 1203 html_source->SetJsonPath(kLocalizedStringsFile); | 1215 html_source->SetJsonPath(kLocalizedStringsFile); |
| 1204 } | 1216 } |
| 1205 | 1217 |
| 1206 } // namespace settings | 1218 } // namespace settings |
| OLD | NEW |