ONOS-6730: Topo View i18n:
- Completed remainder of topology view modules.
- fixed some ESLint issues.
Change-Id: I9cf474198cc4d30be629a2b05cbe19a3bbb43811
diff --git a/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js b/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js
index 687fdab..143aa30 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js
@@ -26,6 +26,11 @@
// injected refs
var $log, tov, tts;
+ // function to be replaced by the localization bundle function
+ var topoLion = function (x) {
+ return '#ttrafov#' + x + '#';
+ };
+
// NOTE: no internal state here -- see TopoTrafficService for that
// NOTE: providing button disabling requires too big a refactoring of
@@ -36,7 +41,7 @@
var overlay = {
overlayId: 'traffic',
glyphId: 'm_allTraffic',
- tooltip: 'Traffic Overlay',
+ tooltip: function () { return topoLion('ov_tt_traffic'); },
// NOTE: Traffic glyphs already installed as part of the base ONOS set.
@@ -54,13 +59,13 @@
buttons: {
showDeviceFlows: {
gid: 'm_flows',
- tt: 'Show Device Flows',
+ tt: function () { return topoLion('tr_btn_show_device_flows'); },
cb: function (data) { tts.showDeviceLinkFlows(); },
},
showRelatedTraffic: {
gid: 'm_relatedIntents',
- tt: 'Show Related Traffic',
+ tt: function () { return topoLion('tr_btn_show_related_traffic'); },
cb: function (data) { tts.showRelatedIntents(); },
},
},
@@ -70,38 +75,38 @@
keyBindings: {
0: {
cb: function () { tts.cancelTraffic(true); },
- tt: 'Cancel traffic monitoring',
+ tt: function () { return topoLion('tr_btn_cancel_monitoring'); },
gid: 'm_xMark',
},
A: {
cb: function () { tts.showAllTraffic(); },
- tt: 'Monitor all traffic',
+ tt: function () { return topoLion('tr_btn_monitor_all'); },
gid: 'm_allTraffic',
},
F: {
cb: function () { tts.showDeviceLinkFlows(); },
- tt: 'Show device link flows',
+ tt: function () { return topoLion('tr_btn_show_dev_link_flows'); },
gid: 'm_flows',
},
V: {
cb: function () { tts.showRelatedIntents(); },
- tt: 'Show all related intents',
+ tt: function () { return topoLion('tr_btn_show_all_rel_intents'); },
gid: 'm_relatedIntents',
},
leftArrow: {
cb: function () { tts.showPrevIntent(); },
- tt: 'Show previous related intent',
+ tt: function () { return topoLion('tr_btn_show_prev_rel_intent'); },
gid: 'm_prev',
},
rightArrow: {
cb: function () { tts.showNextIntent(); },
- tt: 'Show next related intent',
+ tt: function () { return topoLion('tr_btn_show_next_rel_intent'); },
gid: 'm_next',
},
W: {
cb: function () { tts.showSelectedIntentTraffic(); },
- tt: 'Monitor traffic of selected intent',
+ tt: function () { return topoLion('tr_btn_monitor_sel_intent'); },
gid: 'm_intentTraffic',
},
@@ -147,6 +152,11 @@
$log.debug('^^ trafficOverlay.showintent() ^^', info);
tts.selectIntent(info);
},
+ // localization bundle injection hook
+ injectLion: function (bundle) {
+ topoLion = bundle;
+ tts.setLionBundle(bundle);
+ },
},
};