ONOS-6730: Topo View i18n for:
- device and host label op flash messages
- hosts visible/hidden, offline devices visible/hidden
- bad links, reset node locations
- packet/optical/all layers shown
- port highlighting
- instance show/hide panel, devices
Change-Id: I0f1cfb43ba3e03a806c716394f42ba064ba99bd7
diff --git a/web/gui/src/main/webapp/app/view/topo/topoInst.js b/web/gui/src/main/webapp/app/view/topo/topoInst.js
index 9544d4e..4e89822 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoInst.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoInst.js
@@ -45,6 +45,11 @@
oiShowMaster,
oiBox;
+ // function to be replaced by the localization bundle function
+ var topoLion = function (x) {
+ return '#tinst#' + x + '#';
+ };
+
function addInstance(data) {
var id = data.id;
@@ -165,7 +170,7 @@
.data(onosOrder, function (d) { return d.id; });
function nSw(n) {
- return 'Devices: ' + n;
+ return topoLion('devices') + ': ' + n;
}
// operate on existing onos instances if necessary
@@ -307,11 +312,16 @@
hideInsts();
}
}
- verb = on ? 'Show' : 'Hide';
- flash.flash(verb + ' instances panel');
+ verb = on ? topoLion('show') : topoLion('hide');
+ flash.flash(verb + ' ' + topoLion('fl_panel_instances'));
return on;
}
+ // invoked after the localization bundle has been received from the server
+ function setLionBundle(bundle) {
+ topoLion = bundle;
+ }
+
// ==========================
angular.module('ovTopo')
@@ -343,6 +353,7 @@
hide: hideInsts,
toggle: toggleInsts,
showMaster: function () { return oiShowMaster; },
+ setLionBundle: setLionBundle,
};
}]);
}());