ONOS-6730: Topo Lion
- added show / hide action verbs
- localize some flash messages
- localize "no devices connected"

Change-Id: I84ed1dbc18b7389a4448fd685dc217ccbca6f60a
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/_config/core.view.Topo.lioncfg b/web/gui/src/main/resources/org/onosproject/ui/lion/_config/core.view.Topo.lioncfg
index ef83a35..b53b734 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/_config/core.view.Topo.lioncfg
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/_config/core.view.Topo.lioncfg
@@ -27,7 +27,4 @@
 
 from cc.Ui import click, shift_click, drag, cmd_scroll, cmd_drag
 
-# TODO: clean these up to just those used...
-from cc.Props import icon, title, app_id, version, category, origin, state, role
-from cc.Action import activate, deactivate, uninstall
-from cc.State import total
+from cc.Action import show, hide
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action.properties
index 40d7278..2193a6c 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action.properties
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action.properties
@@ -23,3 +23,5 @@
 uninstall=Uninstall
 activate=Activate
 deactivate=Deactivate
+show=Show
+hide=Hide
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_es.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_es.properties
index f55da1a..573ea92 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_es.properties
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_es.properties
@@ -23,3 +23,5 @@
 uninstall=Desinstalar
 activate=Activar
 deactivate=Desactivar
+show=Show (es)
+hide=Hide (es)
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_it.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_it.properties
index 49dc006..004d37a 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_it.properties
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_it.properties
@@ -23,3 +23,5 @@
 uninstall=Disinstalla
 activate=Attiva
 deactivate=Disattiva
+show=Show (it)
+hide=Hide (it)
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_ko.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_ko.properties
index f748770..b307220 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_ko.properties
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_ko.properties
@@ -23,3 +23,5 @@
 uninstall=삭제
 activate=활성화
 deactivate=비활성화
+show=Show (ko)
+hide=Hide (ko)
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_zh_CN.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_zh_CN.properties
index 4fd4c4d..e2de821 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_zh_CN.properties
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_zh_CN.properties
@@ -23,3 +23,5 @@
 uninstall=卸载
 activate=启用
 deactivate=停用
+show=Show (zh_CN)
+hide=Hide (zh_CN)
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_zh_TW.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_zh_TW.properties
index 153b24d..673453c 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_zh_TW.properties
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/common/Action_zh_TW.properties
@@ -23,4 +23,5 @@
 uninstall=移除
 activate=啟動
 deactivate=停用
-
+show=Show (zh_TW)
+hide=Hide (zh_TW)
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Topo.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Topo.properties
index 4456ccc..745aa6d 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Topo.properties
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Topo.properties
@@ -53,3 +53,9 @@
 qh_gest_drag=Reposition (and pin) device / host
 qh_gest_cmd_scroll=Zoom in / out
 qh_gest_cmd_drag=Pan
+
+# Flash Messages
+fl_background_map=background map
+fl_sprite_layer=sprite layer
+fl_pan_zoom_reset=Pan and zoom reset
+fl_eq_masters=Equalizing master roles
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Topo_it.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Topo_it.properties
index 9d7f63b..8691d81 100644
--- a/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Topo_it.properties
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Topo_it.properties
@@ -48,3 +48,9 @@
 qh_gest_drag=Riposiziona e blocca un'apparecchiatura o un host
 qh_gest_cmd_scroll=Ingradisci più / meno
 qh_gest_cmd_drag=Spostati lateralmente
+
+# Flash Messages
+fl_background_map=background map (it)
+fl_sprite_layer=sprite layer (it)
+fl_pan_zoom_reset=Pan and zoom reset (it)
+fl_eq_masters=Equalizing master roles (it)
diff --git a/web/gui/src/main/webapp/app/view/topo/topo.js b/web/gui/src/main/webapp/app/view/topo/topo.js
index 6c5c8aa..07b29c7 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -193,14 +193,14 @@
 
     function _togSvgLayer(x, G, tag, what) {
         var on = (x === 'keyev') ? !sus.visible(G) : !!x,
-            verb = on ? 'Show' : 'Hide';
+            verb = on ? topoLion('show') : topoLion('hide');
         sus.visible(G, on);
         updatePrefsState(tag, on);
         flash.flash(verb + ' ' + what);
     }
 
     function toggleMap(x) {
-        _togSvgLayer(x, mapG, 'bg', 'background map');
+        _togSvgLayer(x, mapG, 'bg', topoLion('fl_background_map'));
     }
 
     function openMapSelection() {
@@ -208,17 +208,17 @@
     }
 
     function toggleSprites(x) {
-        _togSvgLayer(x, spriteG, 'spr', 'sprite layer');
+        _togSvgLayer(x, spriteG, 'spr', topoLion('fl_sprite_layer'));
     }
 
     function resetZoom() {
         zoomer.reset();
-        flash.flash('Pan and zoom reset');
+        flash.flash(topoLion('fl_pan_zoom_reset'));
     }
 
     function equalizeMasters() {
         wss.sendEvent('equalizeMasters');
-        flash.flash('Equalizing master roles');
+        flash.flash(topoLion('fl_eq_masters'));
     }
 
     function handleEscape() {
@@ -337,7 +337,7 @@
 
         g = noDevsLayer.append('g');
         gs.addGlyph(g, 'bird', 100).attr('class', 'noDevsBird');
-        g.append('text').text('No devices are connected')
+        g.append('text').text(topoLion('no_devices_are_connected'))
             .attr({ x: 120, y: 80 });
 
         box = g.node().getBBox();
@@ -348,6 +348,11 @@
         showNoDevs(true);
     }
 
+    function lionNoDevs() {
+        d3.select('#topo-noDevsLayer g text')
+            .text(topoLion('no_devices_are_connected'));
+    }
+
     function showNoDevs(b) {
         sus.visible(noDevsLayer, b);
     }
@@ -710,6 +715,10 @@
                     topoLion = $scope.lion;
                     $log.debug('Loaded Topo LION Bundle:', topoLion);
 
+                    // insert localized text into already established
+                    // DOM elements...
+                    lionNoDevs();
+
                     // now we have the map projection, we are ready for
                     //  the server to send us device/host data...
                     tes.start();