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

Unified Diff: chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc

Issue 2627023006: WebUI: Remove i18n from cr_elements/network (Closed)
Patch Set: Allow <if> in settings_ui.html Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc
diff --git a/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc b/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e61fb85015268e0867f124e1b2a8ffce26464739
--- /dev/null
+++ b/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h"
+
+#include "build/build_config.h"
+#include "chrome/grit/generated_resources.h"
+#include "content/public/browser/web_ui_data_source.h"
+
+namespace chromeos {
+namespace network_element {
+
+void AddLocalizedStrings(content::WebUIDataSource* html_source) {
+ struct {
+ const char* name;
+ int id;
+ } localized_strings[] = {
+ {"OncTypeCellular", IDS_NETWORK_TYPE_CELLULAR},
+ {"OncTypeEthernet", IDS_NETWORK_TYPE_ETHERNET},
+ {"OncTypeVPN", IDS_NETWORK_TYPE_VPN},
+ {"OncTypeWiFi", IDS_NETWORK_TYPE_WIFI},
+ {"OncTypeWiMAX", IDS_NETWORK_TYPE_WIMAX},
+ {"networkDisabled", IDS_NETWORK_LIST_DISABLED},
+ {"networkListItemConnected", IDS_NETWORK_LIST_CONNECTED},
+ {"networkListItemConnecting", IDS_NETWORK_LIST_CONNECTING},
+ {"networkListItemNotConnected", IDS_NETWORK_LIST_NOT_CONNECTED},
+ {"vpnNameTemplate", IDS_NETWORK_LIST_THIRD_PARTY_VPN_NAME_TEMPLATE},
+ };
+ for (const auto& entry : localized_strings)
+ html_source->AddLocalizedString(entry.name, entry.id);
+}
+
+} // namespace network_element
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698