ONOS-6733 l18n for Flows

Change-Id: Ifb8ecc8fe4a03d2b7d7bef556eb7d9b9d8283a30
diff --git a/web/gui/src/main/webapp/app/view/flow/flow.html b/web/gui/src/main/webapp/app/view/flow/flow.html
index a6fed1a..1d89d12 100644
--- a/web/gui/src/main/webapp/app/view/flow/flow.html
+++ b/web/gui/src/main/webapp/app/view/flow/flow.html
@@ -2,8 +2,8 @@
 <div id="ov-flow">
     <div class="tabular-header">
         <h2>
-            Flows for Device {{devId || "(No device selected)"}}
-            ({{tableData.length}} total)
+           {{lion('title_flows')}}{{devId || "(No device selected)"}}
+            ({{tableData.length}} {{lion('total')}})
         </h2>
 
         <div class="ctrl-btns">
@@ -81,15 +81,15 @@
             <table>
                 <tr>
                     <!--<td colId="id" col-width="180px" sortable>Flow ID </td>-->
-                    <td colId="state" col-width="100px" sortable>State </td>
+                    <td colId="state" col-width="100px" sortable>{{lion('state')}}</td>
                     <!--<td class="right" colId="bytes" col-width="90px" sortable> Bytes </td>-->
-                    <td class="right" colId="packets" col-width="90px" sortable> Packets </td>
-                    <td class="right" colId="duration" col-width="90px" sortable> Duration </td>
-                    <td colId="priority" col-width="80px" sortable> Priority </td>
-                    <td colId="tableName" col-width="120px" sortable> Table Name </td>
-                    <td colId="selector" sortable> Selector </td>
-                    <td colId="treatment" sortable> Treatment </td>
-                    <td colId="appName" sortable> App Name </td>
+                    <td class="right" colId="packets" col-width="90px" sortable>{{lion('packets')}}</td>
+                    <td class="right" colId="duration" col-width="90px" sortable>{{lion('duration')}}</td>
+                    <td colId="priority" col-width="80px" sortable>{{lion('priority')}}</td>
+                    <td colId="tableName" col-width="120px" sortable>{{lion('tableName')}}</td>
+                    <td colId="selector" sortable>{{lion('selector')}}  </td>
+                    <td colId="treatment" sortable>{{lion('treatment')}}  </td>
+                    <td colId="appName" sortable>{{lion('appName')}}  </td>
                 </tr>
             </table>
         </div>
diff --git a/web/gui/src/main/webapp/app/view/flow/flow.js b/web/gui/src/main/webapp/app/view/flow/flow.js
index 4392d42..0f41b14 100644
--- a/web/gui/src/main/webapp/app/view/flow/flow.js
+++ b/web/gui/src/main/webapp/app/view/flow/flow.js
@@ -22,7 +22,7 @@
     'use strict';
 
     // injected references
-    var $log, $scope, $location, fs, tbs, ns, mast, ps, wss, is;
+    var $log, $scope, $location, fs, tbs, ns, mast, ps, wss, is, ls;
 
     // internal state
     var detailsPanel,
@@ -60,26 +60,28 @@
             'idleTimeout',
             'hardTimeout',
             'permanent',
-        ],
-        friendlyProps = [
-            'Flow ID',
-            'State',
-
-            'Bytes',
-            'Packets',
-            'Duration',
-
-            'Flow Priority',
-            'Table Name',
-            'App Name',
-            'App ID',
-
-            'Group ID',
-            'Idle Timeout',
-            'Hard Timeout',
-            'Permanent',
         ];
 
+// deferred localization strings
+    var warnDeactivate,
+        warnOwnRisk,
+        friendlyProps,
+        lion;
+
+    function doLion() {
+        lion = ls.bundle('core.view.Flow');
+
+        warnDeactivate = lion('dlg_warn_deactivate');
+        warnOwnRisk = lion('dlg_warn_own_risk');
+
+        friendlyProps = [
+            lion('flowId'), lion('state'), lion('bytes'), lion('packets'),
+            lion('duration'), lion('priority'),lion('tableName'),lion('appName'),lion('appId'),
+            lion('groupId'),lion('idleTimeout'),lion('hardTimeout'),lion('permanent')
+        ];
+    }
+
+
     function closePanel() {
         if (detailsPanel.isVisible()) {
             $scope.selId = null;
@@ -130,16 +132,6 @@
         addCell('value', value);
     }
 
-    // deferred fetching of user-visible strings, so that lion context is set
-    function getLionProps() {
-        // TODO: Localization... (see cluster.js for the pattern)
-        // var l = $scope.lion;
-        // return [
-        //     l('flow_id'),
-        //     ...
-        // ];
-        return friendlyProps;
-    }
 
     function getLionClearDeferred() {
         // TODO: Localization...
@@ -221,10 +213,10 @@
             ['$log', '$scope', '$location',
                 'FnService', 'TableBuilderService', 'NavService',
                 'MastService', 'PanelService', 'KeyService', 'IconService',
-                'WebSocketService',
+                'WebSocketService','LionService',
 
                 function (_$log_, _$scope_, _$location_, _fs_, _tbs_, _ns_,
-                          _mast_, _ps_, _ks_, _is_, _wss_) {
+                          _mast_, _ps_, _ks_, _is_, _wss_, _ls_) {
                     var params,
                         handlers = {};
 
@@ -238,13 +230,19 @@
                     wss = _wss_;
                     mast = _mast_;
                     ps = _ps_;
-                    $scope.deviceTip = 'Show device table';
-                    $scope.portTip = 'Show port view for this device';
-                    $scope.groupTip = 'Show group view for this device';
-                    $scope.meterTip = 'Show meter view for selected device';
-                    $scope.pipeconfTip = 'Show pipeconf view for selected device';
-                    $scope.briefTip = 'Switch to brief view';
-                    $scope.detailTip = 'Switch to detailed view';
+                    ls = _ls_;
+
+                    doLion();
+
+                    $scope.lion = lion;
+
+                    $scope.deviceTip = lion('tt_ctl_show_device');
+                    $scope.portTip = lion('tt_ctl_show_port');
+                    $scope.groupTip = lion('tt_ctl_show_group');
+                    $scope.meterTip = lion('tt_ctl_show_meter');
+                    $scope.pipeconfTip = lion('tt_ctl_show_pipeconf');
+                    $scope.briefTip = lion('tt_ctl_switcth_brief');
+                    $scope.detailTip = lion('tt_ctl_switcth_detailed');
 
                     $scope.brief = true;
                     params = $location.search();