Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
webui js: prepare for internationalization
  • Loading branch information
perexg committed Jun 18, 2015
1 parent 44b6d2d commit 36f0721
Show file tree
Hide file tree
Showing 21 changed files with 512 additions and 642 deletions.
2 changes: 1 addition & 1 deletion Makefile.webui
Expand Up @@ -69,6 +69,7 @@ CSS += static/app/ext.css
# extjs extensions
#

JAVASCRIPT += $(ROOTPATH)/app/i18n.js
JAVASCRIPT += $(ROOTPATH)/app/extensions.js
JAVASCRIPT += $(ROOTPATH)/livegrid/livegrid-all.js
JAVASCRIPT += $(ROOTPATH)/lovcombo/lovcombo-all.js
Expand All @@ -93,7 +94,6 @@ JAVASCRIPT += $(EXTJSPATH)/examples/ux/gridfilters/menu/RangeMenu.js
JAVASCRIPT += $(ROOTPATH)/app/namespace.js
JAVASCRIPT += $(ROOTPATH)/smoothie.js
JAVASCRIPT += $(ROOTPATH)/app/comet.js
JAVASCRIPT += $(ROOTPATH)/app/tableeditor.js
JAVASCRIPT += $(ROOTPATH)/app/cteditor.js
JAVASCRIPT += $(ROOTPATH)/app/acleditor.js

Expand Down
12 changes: 6 additions & 6 deletions src/webui/static/app/acleditor.js
Expand Up @@ -22,8 +22,8 @@ tvheadend.acleditor = function(panel, index)

tvheadend.idnode_grid(panel, {
url: 'api/access/entry',
titleS: 'Access Entry',
titleP: 'Access Entries',
titleS: _('Access Entry'),
titleP: _('Access Entries'),
iconCls: 'group',
columns: {
enabled: { width: 120 },
Expand Down Expand Up @@ -61,7 +61,7 @@ tvheadend.acleditor = function(panel, index)
move: true,
list: list,
help: function() {
new tvheadend.help('Access Control Entries', 'config_access.html');
new tvheadend.help(_('Access Control Entries'), 'config_access.html');
}
});
};
Expand All @@ -76,8 +76,8 @@ tvheadend.passwdeditor = function(panel, index)

tvheadend.idnode_grid(panel, {
url: 'api/passwd/entry',
titleS: 'Password',
titleP: 'Passwords',
titleS: _('Password'),
titleP: _('Passwords'),
iconCls: 'pass',
columns: {
enabled: { width: 120 },
Expand All @@ -101,7 +101,7 @@ tvheadend.passwdeditor = function(panel, index)
move: true,
list: list,
help: function() {
new tvheadend.help('Password Control Entries', 'config_passwords.html');
new tvheadend.help(_('Password Control Entries'), 'config_passwords.html');
}
});
};
12 changes: 6 additions & 6 deletions src/webui/static/app/caclient.js
Expand Up @@ -30,9 +30,9 @@ tvheadend.caclient = function(panel, index) {
url: 'api/caclient',
clazz: 'caclient',
comet: 'caclient',
titleS: 'CA',
titleP: 'CAs',
titleC: 'Client Name',
titleS: _('CA'),
titleP: _('CAs'),
titleC: _('Client Name'),
iconCls: 'key',
key: 'uuid',
val: 'title',
Expand All @@ -42,9 +42,9 @@ tvheadend.caclient = function(panel, index) {
edit: { params: { list: list } },
add: {
url: 'api/caclient',
titleS: 'Conditional Access Client',
titleS: _('Conditional Access Client'),
select: {
label: 'Type',
label: _('Type'),
store: tvheadend.caclient_builders,
displayField: 'caption',
valueField: 'class',
Expand All @@ -59,7 +59,7 @@ tvheadend.caclient = function(panel, index) {
lcol: [actions],
plugins: [actions],
help: function() {
new tvheadend.help('Conditional Access Client', 'config_caclient.html');
new tvheadend.help(_('Conditional Access Client'), 'config_caclient.html');
}
});

Expand Down
34 changes: 17 additions & 17 deletions src/webui/static/app/chconf.js
Expand Up @@ -3,7 +3,7 @@
*/
insertChannelTagsClearOption = function( scope, records, options ){
var placeholder = Ext.data.Record.create(['key', 'val']);
scope.insert(0,new placeholder({key: '-1', val: '(Clear filter)'}));
scope.insert(0,new placeholder({key: '-1', val: _('(Clear filter)')}));
};

tvheadend.channelTags = tvheadend.idnode_get_enum({
Expand All @@ -28,7 +28,7 @@ tvheadend.channelrec = new Ext.data.Record.create(

insertChannelClearOption = function( scope, records, options ){
var placeholder = Ext.data.Record.create(['key', 'val']);
scope.insert(0,new placeholder({key: '-1', val: '(Clear filter)'}));
scope.insert(0,new placeholder({key: '-1', val: _('(Clear filter)')}));
};

tvheadend.channels = tvheadend.idnode_get_enum({
Expand Down Expand Up @@ -140,9 +140,9 @@ tvheadend.channel_tab = function(panel, index)
name: 'map',
builder: function() {
return new Ext.Toolbar.Button({
tooltip: 'Map services to channels',
tooltip: _('Map services to channels'),
iconCls: 'clone',
text: 'Map Services',
text: _('Map Services'),
disabled: false
});
},
Expand All @@ -153,9 +153,9 @@ tvheadend.channel_tab = function(panel, index)
name: 'lowno',
builder: function() {
return new Ext.Toolbar.Button({
tooltip: 'Assign lowest free channel number',
tooltip: _('Assign lowest free channel number'),
iconCls: 'bullet_add',
text: 'Assign Number',
text: _('Assign Number'),
disabled: false
});
},
Expand All @@ -166,9 +166,9 @@ tvheadend.channel_tab = function(panel, index)
name: 'noup',
builder: function() {
return new Ext.Toolbar.Button({
tooltip: 'Move channel one number up',
tooltip: _('Move channel one number up'),
iconCls: 'arrow_up',
text: 'Number Up',
text: _('Number Up'),
disabled: false
});
},
Expand All @@ -192,9 +192,9 @@ tvheadend.channel_tab = function(panel, index)
name: 'swap',
builder: function() {
return new Ext.Toolbar.Button({
tooltip: 'Swap the two selected channels numbers',
tooltip: _('Swap the two selected channels numbers'),
iconCls: 'arrow_switch',
text: 'Swap Numbers',
text: _('Swap Numbers'),
disabled: false
});
},
Expand All @@ -205,9 +205,9 @@ tvheadend.channel_tab = function(panel, index)
name: 'iconreset',
builder: function() {
return new Ext.Toolbar.Button({
tooltip: 'Reset (clear) the selected icon URLs',
tooltip: _('Reset (clear) the selected icon URLs'),
iconCls: 'resetIcon',
text: 'Reset Icon',
text: _('Reset Icon'),
disabled: false
});
},
Expand All @@ -218,12 +218,12 @@ tvheadend.channel_tab = function(panel, index)
url: 'api/channel',
all: 1,
comet: 'channel',
titleS: 'Channel',
titleP: 'Channels',
iconCls: 'channels',
titleS: _('Channel'),
titleP: _('Channels'),
iconCls: 'channels',
tabIndex: index,
help: function() {
new tvheadend.help('Channels', 'config_channels.html');
new tvheadend.help(_('Channels'), 'config_channels.html');
},
add: {
url: 'api/channel',
Expand All @@ -241,7 +241,7 @@ tvheadend.channel_tab = function(panel, index)
title += r.data['number'] + ' : ';
title += r.data['name'];
return "<a href='play/stream/channel/" + r.id +
"?title=" + encodeURIComponent(title) + "'>Play</a>";
"?title=" + encodeURIComponent(title) + "'>" + _('Play') + "</a>";
}
}
],
Expand Down
8 changes: 4 additions & 4 deletions src/webui/static/app/comet.js
Expand Up @@ -25,17 +25,17 @@ tvheadend.cometPoller = function() {
parse_comet_response(result.responseText);

if (failures > 1) {
tvheadend.log('Reconnected to Tvheadend',
tvheadend.log(_('Reconnected to Tvheadend'),
'font-weight: bold; color: #080');
}
failures = 0;
},
failure: function(result, request) {
cometRequest.delay(failures ? 1000 : 1);
if (failures === 1) {
tvheadend.log('There seems to be a problem with the '
tvheadend.log(_('There seems to be a problem with the '
+ 'live update feed from Tvheadend. '
+ 'Trying to reconnect...',
+ 'Trying to reconnect...'),
'font-weight: bold; color: #f00');
}
failures++;
Expand All @@ -51,7 +51,7 @@ tvheadend.cometPoller = function() {
try {
tvheadend.comet.fireEvent(m.notificationClass, m);
} catch (e) {
tvheadend.log('comet failure [e=' + e.message + ']');
tvheadend.log(_('comet failure') + ' [e=' + e.message + ']');
}
}
cometRequest.delay(100);
Expand Down

0 comments on commit 36f0721

Please sign in to comment.