blob: 56c5db48a143d66dd7e1f4183aa8695ae8d8a3e3 [file] [log] [blame]
Simon Hunt94104e72017-06-13 11:38:55 -07001/*
2 * Copyright 2017-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18/*
Simon Hunt94104e72017-06-13 11:38:55 -070019 ONOS GUI -- Lion -- Localization Utilities
20 */
21(function () {
22 'use strict';
23
24 var $log, fs;
25
Simon Hunt083e6fb2017-06-16 16:51:41 -070026 // returns a lion bundle (function) for the given bundle-key
27 function bundle(bundleKey) {
28 var bundle = {
Simon Hunt94104e72017-06-13 11:38:55 -070029 computer: 'Calcolatore',
30 disk: 'Disco',
31 monitor: 'Schermo',
32 keyboard: 'Tastiera'
33 };
34
Simon Hunt083e6fb2017-06-16 16:51:41 -070035 if (bundleKey === 'core.view.cluster') {
36 bundle = {
Simon Hunte556e942017-06-19 15:35:44 -070037 // grouped to match core.view.cluster.lioncfg
Simon Hunt083e6fb2017-06-16 16:51:41 -070038 title_cluster_nodes: 'Cluster Nodes',
Simon Hunte556e942017-06-19 15:35:44 -070039 k_esc_hint: 'Close the details panel',
40 k_click_hint: 'Select a row to show cluster node details',
41 k_scroll_down_hint: 'See available cluster nodes',
42
43 devices: 'Devices',
Simon Hunt083e6fb2017-06-16 16:51:41 -070044 node_id: 'Node ID',
45 ip_address: 'IP Address',
46 tcp_port: 'TCP Port',
Simon Hunt083e6fb2017-06-16 16:51:41 -070047 uri: 'URI',
Simon Hunte556e942017-06-19 15:35:44 -070048 protocol: 'Protocol',
49
Simon Hunt083e6fb2017-06-16 16:51:41 -070050 type: 'Type',
51 chassis_id: 'Chassis ID',
52 vendor: 'Vendor',
53 hw_version: 'H/W Version',
54 sw_version: 'S/W Version',
Simon Hunt083e6fb2017-06-16 16:51:41 -070055 serial_number: 'Serial #',
Simon Hunte556e942017-06-19 15:35:44 -070056
57 total: 'Total',
58 active: 'Active',
59 started: 'Started',
60 last_updated: 'Last Updated',
61
62 click: 'click',
63 scroll_down: 'scroll down'
Simon Hunt083e6fb2017-06-16 16:51:41 -070064 };
65 }
66
67 // TODO: Use message handler mech. to get bundle from server
68 $log.warn('Using fake bundle', bundle);
69
70 return function (key) {
71 return bundle[key] || '%' + key + '%';
72 };
Simon Hunt94104e72017-06-13 11:38:55 -070073 }
74
75 angular.module('onosUtil')
76 .factory('LionService', ['$log', 'FnService',
77
78 function (_$log_, _fs_) {
79 $log = _$log_;
80 fs = _fs_;
81
82 return {
83 bundle: bundle
84 };
85 }]);
86}());