fix the formatting in the menus file, and convert all displayed text to

use the gettext replacement.
This commit is contained in:
Damien Churchill 2008-09-22 13:08:39 +00:00
commit 9f3b3b32f2
2 changed files with 292 additions and 74 deletions

View file

@ -20,7 +20,34 @@ Deluge.Strings = {
} }
} }
} }
// Torrent Menu Strings //
Deluge.Strings.add('Pause', '$_('Pause')'); Deluge.Strings.add('Pause', '$_('Pause')');
Deluge.Strings.add('Resume', '$_('Resume')'); Deluge.Strings.add('Resume', '$_('Resume')');
Deluge.Strings.add('Options', '$_('Options')'); Deluge.Strings.add('Options', '$_('Options')');
Deluge.Strings.add('D/L Speed Limit', '$_('D/L Speed Limit')');
Deluge.Strings.add('U/L Speed Limit', '$_('U/L Speed Limit')');
Deluge.Strings.add('Unlimited', '$_('Unlimited')');
Deluge.Strings.add('Connection Limit', '$_('Connection Limit')');
Deluge.Strings.add('Upload Slot Limit', '$_('Upload Slot Limit')');
Deluge.Strings.add('Auto Managed', '$_('Auto Managed')');
Deluge.Strings.add('Queue', '$_('Queue')');
Deluge.Strings.add('Top', '$_('Top')');
Deluge.Strings.add('Up', '$_('Up')');
Deluge.Strings.add('Down', '$_('Down')');
Deluge.Strings.add('Bottom', '$_('Bottom')');
Deluge.Strings.add('Update Tracker', '$_('Update Tracker')');
Deluge.Strings.add('Edit Trackers', '$_('Edit Trackers')');
Deluge.Strings.add('Remove Torrent', '$_('Remove Torrent')');
Deluge.Strings.add('From Session', '$_('From Session')');
Deluge.Strings.add('... and delete Torrent file',
'$_('... and delete Torrent file')');
Deluge.Strings.add('... and delete Downloaded files',
'$_('... and delete Downloaded files')');
Deluge.Strings.add('... and delete All files',
'$_('... and delete All files')');
Deluge.Strings.add('Force Recheck', '$_('Force Recheck')');
Deluge.Strings.add('Move Storage', '$_('Move Storage')');
// Add Torrents Window //
Deluge.Strings.add('Torrents Window', '$_('Torrents Window')'); Deluge.Strings.add('Torrents Window', '$_('Torrents Window')');

View file

@ -1,3 +1,11 @@
/*
* Script: deluge-menus.js
* Contains the layout for all the popup menus used within the ajax ui.
*
* Copyright:
* Damien Churchill (c) 2008
*/
Deluge.Menus = { Deluge.Menus = {
Torrents: [ Torrents: [
{ {
@ -20,7 +28,7 @@ Deluge.Menus = {
items: [ items: [
{ {
type: 'submenu', type: 'submenu',
text:'D/L Speed Limit', text: Deluge.Strings.get('D/L Speed Limit'),
icon: '/pixmaps/downloading16.png', icon: '/pixmaps/downloading16.png',
items: [ items: [
{ {
@ -57,54 +65,237 @@ Deluge.Menus = {
type: 'text', type: 'text',
action: 'max_download_speed', action: 'max_download_speed',
value: -1, value: -1,
text:'Unlimited' text: Deluge.Strings.get('Unlimited')
} }
]}, ]
{type:'submenu',text:'U/L Speed Limit',icon:'/pixmaps/seeding16.png',items: [ },
{type:'text',action:'max_upload_speed',value:5,text:'5 KiB/s'}, {
{type:'text',action:'max_upload_speed',value:10,text:'10 KiB/s'}, type: 'submenu',
{type:'text',action:'max_upload_speed',value:30,text:'30 KiB/s'}, text: Deluge.Strings.get('U/L Speed Limit'),
{type:'text',action:'max_upload_speed',value:80,text:'80 KiB/s'}, icon: '/pixmaps/seeding16.png',
{type:'text',action:'max_upload_speed',value:300,text:'300 KiB/s'}, items: [
{type:'text',action:'max_upload_speed',value:-1,text:'Unlimited'} {
]}, type: 'text',
{type:'submenu',text:'Connection Limit',icon:'/static/images/tango/connections.png',items: [ action: 'max_upload_speed',
{type:'text',action:'max_connections',value:50,text:'50'}, value: 5,
{type:'text',action:'max_connections',value:100,text:'100'}, text:'5 KiB/s'
{type:'text',action:'max_connections',value:200,text:'200'}, },
{type:'text',action:'max_connections',value:300,text:'300'}, {
{type:'text',action:'max_connections',value:500,text:'500'}, type: 'text',
{type:'text',action:'max_connections',value:-1,text:'Unlimited'} action: 'max_upload_speed',
]}, value: 10,
{type:'submenu',text:'Upload Slot Limit',icon:'/template/static/icons/16/view-sort-ascending.png',items: [ text: '10 KiB/s'
{type:'text',action:'max_upload_slots',value:0,text:'0'}, },
{type:'text',action:'max_upload_slots',value:1,text:'1'}, {
{type:'text',action:'max_upload_slots',value:2,text:'2'}, type: 'text',
{type:'text',action:'max_upload_slots',value:3,text:'3'}, action: 'max_upload_speed',
{type:'text',action:'max_upload_slots',value:5,text:'5'}, value: 30,
{type:'text',action:'max_upload_slots',value:-1,text:'Unlimited'} text: '30 KiB/s'
]}, },
{type:'toggle',action:'auto_managed',value:false,text:'Auto Managed'} {
]}, type: 'text',
action: 'max_upload_speed',
value: 80,
text: '80 KiB/s'
},
{
type: 'text',
action: 'max_upload_speed',
value: 300,
text: '300 KiB/s'
},
{
type: 'text',
action: 'max_upload_speed',
value: -1,
text: Deluge.Strings.get('Unlimited')
}
]
},
{
type: 'submenu',
text: Deluge.Strings.get('Connection Limit'),
icon: '/static/images/tango/connections.png',
items: [
{
type: 'text',
action: 'max_connections',
value: 50,
text: '50'
},
{
type: 'text',
action: 'max_connections',
value: 100,
text: '100'
},
{
type: 'text',
action: 'max_connections',
value: 200,
text: '200'
},
{
type: 'text',
action: 'max_connections',
value: 300,
text: '300'
},
{
type: 'text',
action: 'max_connections',
value: 500,
text: '500'
},
{
type: 'text',
action: 'max_connections',
value: -1,
text: Deluge.Strings.get('Unlimited')
}
]
},
{
type: 'submenu',
text: Deluge.Strings.get('Upload Slot Limit'),
icon: '/template/static/icons/16/view-sort-ascending.png',
items: [
{
type: 'text',
action: 'max_upload_slots',
value: 0,
text: '0'
},
{
type: 'text',
action: 'max_upload_slots',
value: 1,
text: '1'
},
{
type: 'text',
action: 'max_upload_slots',
value: 2,
text: '2'
},
{
type: 'text',
action: 'max_upload_slots',
value: 3,
text: '3'
},
{
type: 'text',
action: 'max_upload_slots',
value: 5,
text: '5'
},
{
type: 'text',
action: 'max_upload_slots',
value: -1,
text: Deluge.Strings.get('Unlimited')}
]
},
{
type: 'toggle',
action: 'auto_managed',
value: false,
text: Deluge.Strings.get('Auto Managed')
}
]
},
{type:'seperator'}, {type:'seperator'},
{type:'submenu',text:'Queue',icon:'/template/static/icons/16/view-sort-descending.png',items:[ {
{type:'text',action:'top',text:'Top',icon:'/static/images/tango/go-top.png'}, type: 'submenu',
{type:'text',action:'up',text:'Up',icon:'/static/images/tango/queue-up.png'}, text: Deluge.Strings.get('Queue'),
{type:'text',action:'down',text:'Down',icon:'/static/images/tango/queue-down.png'}, icon: '/template/static/icons/16/view-sort-descending.png',
{type:'text',action:'bottom',text:'Bottom',icon:'/static/images/tango/go-bottom.png'} items: [
]}, {
type: 'text',
action: 'top',
text: Deluge.Strings.get('Top'),
icon: '/static/images/tango/go-top.png'
},
{
type: 'text',
action: 'up',
text: Deluge.Strings.get('Up'),
icon: '/static/images/tango/queue-up.png'
},
{
type: 'text',
action: 'down',
text: Deluge.Strings.get('Down'),
icon: '/static/images/tango/queue-down.png'
},
{
type: 'text',
action: 'bottom',
text: Deluge.Strings.get('Bottom'),
icon: '/static/images/tango/go-bottom.png'
}
]
},
{type: 'seperator'}, {type: 'seperator'},
{type:'text',action:'update_tracker',text:'Update Tracker',icon:'/template/static/icons/16/view-refresh.png'}, {
{type:'text',action:'edit_trackers',text:'Edit Trackers',icon:'/template/static/icons/16/gtk-edit.png'}, type: 'text',
action: 'update_tracker',
text: Deluge.Strings.get('Update Tracker'),
icon: '/template/static/icons/16/view-refresh.png'
},
{
type: 'text',
action: 'edit_trackers',
text: Deluge.Strings.get('Edit Trackers'),
icon: '/template/static/icons/16/gtk-edit.png'
},
{type:'seperator'}, {type:'seperator'},
{type:'submenu',action:'remove',value:0,text:'Remove Torrent',icon:'/static/images/tango/list-remove.png', items:[ {
{type:'text',action:'remove',value:0,text:'From Session'}, type: 'submenu',
{type:'text',action:'remove',value:1,text:'... and delete Torrent file'}, action: 'remove',
{type:'text',action:'remove',value:2,text:'... and delete Downloaded files'}, value: 0,
{type:'text',action:'remove',value:3,text:'... and delete All files'} text: Deluge.Strings.get('Remove Torrent'),
]}, icon: '/static/images/tango/list-remove.png',
items: [
{
type: 'text',
action: 'remove',
value: 0,
text: Deluge.Strings.get('From Session')
},
{
type: 'text',
action: 'remove',
value: 1,
text: Deluge.Strings.get('... and delete Torrent file')
},
{
type: 'text',
action: 'remove',
value: 2,
text: Deluge.Strings.get('... and delete Downloaded files')
},
{
type: 'text',
action: 'remove',
value: 3,
text: Deluge.Strings.get('... and delete All files')
}
]
},
{type:'seperator'}, {type:'seperator'},
{type:'text',action:'force_recheck',text:'Force Recheck',icon:'/static/images/tango/edit-redo.png'}, {
{type:'text',action:'move_storage',text:'Move Storage',icon:'/static/images/tango/move.png'} type: 'text',
action: 'force_recheck',
text: Deluge.Strings.get('Force Recheck'),
icon: '/static/images/tango/edit-redo.png'
},
{
type: 'text',
action: 'move_storage',
text: Deluge.Strings.get('Move Storage'),
icon: '/static/images/tango/move.png'
}
] ]
} }