| 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/common/url_constants.h" | 8 #include "chrome/common/url_constants.h" |
| 9 #include "chrome/grit/chromium_strings.h" | 9 #include "chrome/grit/chromium_strings.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| 11 #include "chrome/grit/google_chrome_strings.h" | 11 #include "chrome/grit/google_chrome_strings.h" |
| 12 #include "chrome/grit/locale_settings.h" | 12 #include "chrome/grit/locale_settings.h" |
| 13 #include "content/public/browser/web_ui_data_source.h" | 13 #include "content/public/browser/web_ui_data_source.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 | 15 |
| 16 #if defined(OS_CHROMEOS) |
| 17 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" |
| 18 #endif |
| 19 |
| 16 namespace { | 20 namespace { |
| 17 | 21 |
| 18 // Note that md_settings.html contains a <script> tag which imports a script of | 22 // Note that md_settings.html contains a <script> tag which imports a script of |
| 19 // the following name. These names must be kept in sync. | 23 // the following name. These names must be kept in sync. |
| 20 const char kLocalizedStringsFile[] = "strings.js"; | 24 const char kLocalizedStringsFile[] = "strings.js"; |
| 21 | 25 |
| 22 void AddA11yStrings(content::WebUIDataSource* html_source) { | 26 void AddA11yStrings(content::WebUIDataSource* html_source) { |
| 23 html_source->AddLocalizedString( | 27 html_source->AddLocalizedString( |
| 24 "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY); | 28 "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY); |
| 25 html_source->AddLocalizedString( | 29 html_source->AddLocalizedString( |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 html_source->AddLocalizedString( | 147 html_source->AddLocalizedString( |
| 144 "dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY); | 148 "dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY); |
| 145 } | 149 } |
| 146 | 150 |
| 147 #if defined(OS_CHROMEOS) | 151 #if defined(OS_CHROMEOS) |
| 148 void AddInternetStrings(content::WebUIDataSource* html_source) { | 152 void AddInternetStrings(content::WebUIDataSource* html_source) { |
| 149 html_source->AddLocalizedString( | 153 html_source->AddLocalizedString( |
| 150 "internetPageTitle", IDS_SETTINGS_INTERNET); | 154 "internetPageTitle", IDS_SETTINGS_INTERNET); |
| 151 html_source->AddLocalizedString( | 155 html_source->AddLocalizedString( |
| 152 "internetDetailPageTitle", IDS_SETTINGS_INTERNET_DETAIL); | 156 "internetDetailPageTitle", IDS_SETTINGS_INTERNET_DETAIL); |
| 157 |
| 158 // Required by cr_network_list_item.js. TODO(stevenjb): Add to |
| 159 // settings_strings.grdp or provide an alternative translation method. |
| 160 // crbug.com/512214. |
| 161 html_source->AddLocalizedString("networkConnected", |
| 162 IDS_ASH_STATUS_TRAY_NETWORK_CONNECTED); |
| 163 html_source->AddLocalizedString("networkConnecting", |
| 164 IDS_ASH_STATUS_TRAY_NETWORK_CONNECTING); |
| 165 html_source->AddLocalizedString("networkDisabled", |
| 166 IDS_OPTIONS_SETTINGS_NETWORK_DISABLED); |
| 167 html_source->AddLocalizedString("networkNotConnected", |
| 168 IDS_ASH_STATUS_TRAY_NETWORK_NOT_CONNECTED); |
| 169 html_source->AddLocalizedString("OncTypeCellular", IDS_NETWORK_TYPE_CELLULAR); |
| 170 html_source->AddLocalizedString("OncTypeEthernet", IDS_NETWORK_TYPE_ETHERNET); |
| 171 html_source->AddLocalizedString("OncTypeVPN", IDS_NETWORK_TYPE_VPN); |
| 172 html_source->AddLocalizedString("OncTypeWiFi", IDS_NETWORK_TYPE_WIFI); |
| 173 html_source->AddLocalizedString("OncTypeWimax", IDS_NETWORK_TYPE_WIMAX); |
| 153 } | 174 } |
| 154 #endif | 175 #endif |
| 155 | 176 |
| 156 void AddPrivacyStrings(content::WebUIDataSource* html_source) { | 177 void AddPrivacyStrings(content::WebUIDataSource* html_source) { |
| 157 html_source->AddLocalizedString("privacyPageTitle", | 178 html_source->AddLocalizedString("privacyPageTitle", |
| 158 IDS_SETTINGS_PRIVACY); | 179 IDS_SETTINGS_PRIVACY); |
| 159 html_source->AddString("improveBrowsingExperience", | 180 html_source->AddString("improveBrowsingExperience", |
| 160 l10n_util::GetStringFUTF16( | 181 l10n_util::GetStringFUTF16( |
| 161 IDS_SETTINGS_IMPROVE_BROWSING_EXPERIENCE, | 182 IDS_SETTINGS_IMPROVE_BROWSING_EXPERIENCE, |
| 162 base::ASCIIToUTF16(chrome::kPrivacyLearnMoreURL))); | 183 base::ASCIIToUTF16(chrome::kPrivacyLearnMoreURL))); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 AddPrivacyStrings(html_source); | 375 AddPrivacyStrings(html_source); |
| 355 AddSearchStrings(html_source); | 376 AddSearchStrings(html_source); |
| 356 AddSearchEnginesStrings(html_source); | 377 AddSearchEnginesStrings(html_source); |
| 357 AddSiteSettingsStrings(html_source); | 378 AddSiteSettingsStrings(html_source); |
| 358 AddSyncStrings(html_source); | 379 AddSyncStrings(html_source); |
| 359 AddUsersStrings(html_source); | 380 AddUsersStrings(html_source); |
| 360 html_source->SetJsonPath(kLocalizedStringsFile); | 381 html_source->SetJsonPath(kLocalizedStringsFile); |
| 361 } | 382 } |
| 362 | 383 |
| 363 } // namespace settings | 384 } // namespace settings |
| OLD | NEW |