ONOS-6733 l18n for Flows
Change-Id: Ifb8ecc8fe4a03d2b7d7bef556eb7d9b9d8283a30
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java b/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
index e384677..9b7472b 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
@@ -120,6 +120,7 @@
"core.view.App",
"core.view.Cluster",
"core.view.Topo",
+ "core.view.Flow",
// TODO: More to come...
};
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/_config/core.view.Flow.lioncfg b/web/gui/src/main/resources/org/onosproject/ui/lion/_config/core.view.Flow.lioncfg
new file mode 100644
index 0000000..b863100
--- /dev/null
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/_config/core.view.Flow.lioncfg
@@ -0,0 +1,26 @@
+#
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+bundle core.view.Flow
+
+alias cv core.view
+alias cc core.common
+
+from cv.Flow import *
+
+from cc.State import total
+from cc.Props import state
diff --git a/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Flow.properties b/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Flow.properties
new file mode 100644
index 0000000..92871c3
--- /dev/null
+++ b/web/gui/src/main/resources/org/onosproject/ui/lion/core/view/Flow.properties
@@ -0,0 +1,47 @@
+#
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+# Text that appears in the navigation panel
+nav_item_flow=Flows
+
+# View title
+title_flows= Flows for Device
+
+flowId=Flow ID
+
+
+bytes=Bytes
+packets=Packets
+duration=Duration
+priority=Flow Priority
+tableName=Table Name
+selector=Selector
+treatment=Treatment
+appName=App Name
+appId=App ID
+groupId=Group ID
+idleTimeout=Idle Timeout
+hardTimeout=Hard Timeout
+permanent=Permanent
+
+tt_ctl_show_device=Show device table
+tt_ctl_show_port=Show port view for this device
+tt_ctl_show_group=Show group view for this device
+tt_ctl_show_meter=Show meter view for selected device
+tt_ctl_show_pipeconf=Show pipeconf view for selected device
+tt_ctl_switcth_brief=Switch to brief view
+tt_ctl_switcth_detailed=Switch to detailed view
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();