add more gettext markers

This commit is contained in:
Dietmar Maurer 2012-02-24 14:39:01 +01:00
parent e084c7747a
commit 6b21ab95f6
15 changed files with 119 additions and 120 deletions

View File

@ -6,9 +6,9 @@ Ext.define('PVE.form.CompressionSelector', {
var me = this;
me.data = [
['', 'none'],
['lzo', 'LZO (fast)'],
['gzip', 'GZIP (good)']
['', gettext('none')],
['lzo', 'LZO (' + gettext('fast') + ')'],
['gzip', 'GZIP (' + gettext('good') + ')']
];
me.callParent();

View File

@ -64,7 +64,7 @@ Ext.define('PVE.grid.BackupView', {
var storagesel = Ext.create('PVE.form.StorageSelector', {
nodename: nodename,
fieldLabel: 'Storage',
fieldLabel: gettext('Storage'),
labelAlign: 'right',
storageContent: 'backup',
allowBlank: false,
@ -78,7 +78,7 @@ Ext.define('PVE.grid.BackupView', {
var sm = Ext.create('Ext.selection.RowModel', {});
var backup_btn = Ext.create('Ext.button.Button', {
text: 'Backup now',
text: gettext('Backup now'),
handler: function() {
var win = Ext.create('PVE.window.Backup', {
nodename: nodename,
@ -91,7 +91,7 @@ Ext.define('PVE.grid.BackupView', {
});
var restore_btn = Ext.create('PVE.button.Button', {
text: 'Restore',
text: gettext('Restore'),
disabled: true,
selModel: sm,
enableFn: function(rec) {
@ -113,12 +113,15 @@ Ext.define('PVE.grid.BackupView', {
});
var delete_btn = Ext.create('PVE.button.Button', {
text: 'Delete',
text: gettext('Remove'),
disabled: true,
selModel: sm,
confirmMsg: function(rec) {
return 'Are you sure you want to delete "' + rec.data.volid + '"? ' +
'This will permanently erase all data.';
var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
"'" + rec.data.volid + "'");
msg += " " + gettext('This will permanently erase all image data.');
return msg;
},
enableFn: function(rec) {
return !!rec;
@ -150,19 +153,19 @@ Ext.define('PVE.grid.BackupView', {
tbar: [ backup_btn, restore_btn, delete_btn, '->', storagesel ],
columns: [
{
header: 'Name',
header: gettext('Name'),
flex: 1,
sortable: true,
renderer: PVE.Utils.render_storage_content,
dataIndex: 'volid'
},
{
header: 'Format',
header: gettext('Format'),
width: 100,
dataIndex: 'format'
},
{
header: 'Size',
header: gettext('Size'),
width: 100,
renderer: PVE.Utils.format_size,
dataIndex: 'size'

View File

@ -181,7 +181,7 @@ Ext.define('PVE.qemu.BootOrderEdit', {
me.items = [ ipanel ];
me.subject = 'Boot order';
me.subject = gettext('Boot order');
me.callParent();

View File

@ -108,7 +108,7 @@ Ext.define('PVE.qemu.CDInputPanel', {
me.cdstoragesel = Ext.create('PVE.form.StorageSelector', {
name: 'cdstorage',
nodename: me.nodename,
fieldLabel: 'Storage',
fieldLabel: gettext('Storage'),
labelAlign: 'right',
storageContent: 'iso',
allowBlank: false,
@ -166,8 +166,7 @@ Ext.define('PVE.qemu.CDEdit', {
});
Ext.applyIf(me, {
title: me.create ? 'Add CD/DVD Drive' :
'Change CD/DVD settings (' + me.confid + ')',
subject: 'CD/DVD Drive',
items: [ ipanel ]
});

View File

@ -5,13 +5,13 @@ Ext.define('PVE.qemu.DisplayEdit', {
var me = this;
Ext.apply(me, {
title: "Edit display settings",
subject: gettext('Display'),
width: 350,
items: {
xtype: 'DisplaySelector',
name: 'vga',
value: '',
fieldLabel: 'Graphic card'
fieldLabel: gettext('Graphic card')
}
});

View File

@ -109,7 +109,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
if (me.unused) {
me.unusedDisks = Ext.create('PVE.form.KVComboBox', {
name: 'unusedId',
fieldLabel: 'Disk image',
fieldLabel: gettext('Disk image'),
matchFieldWidth: false,
listConfig: {
width: 350
@ -123,7 +123,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
name: 'hdimage',
nodename: me.nodename,
storageContent: 'images',
fieldLabel: 'Disk image',
fieldLabel: gettext('Disk image'),
disabled: true,
hidden: true,
allowBlank: false
@ -134,14 +134,14 @@ Ext.define('PVE.qemu.HDInputPanel', {
minValue: 1,
maxValue: 128*1024,
value: '32',
fieldLabel: 'Disk size (GB)',
fieldLabel: gettext('Disk size') + ' (GB)',
allowBlank: false
});
me.hdstoragesel = Ext.create('PVE.form.StorageSelector', {
name: 'hdstorage',
nodename: me.nodename,
fieldLabel: 'Storage',
fieldLabel: gettext('Storage'),
storageContent: 'images',
autoSelect: me.insideWizard,
allowBlank: false,
@ -169,8 +169,8 @@ Ext.define('PVE.qemu.HDInputPanel', {
} else {
me.column1.push({
xtype: 'displayfield',
fieldLabel: 'Image',
labelWidth: 50,
fieldLabel: gettext('Disk image'),
labelWidth: 50,
name: 'hdimage'
});
}
@ -179,7 +179,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
me.column2.push({
xtype: 'PVE.form.DiskFormatSelector',
name: 'diskformat',
fieldLabel: 'Image format',
fieldLabel: gettext('Format'),
value: 'raw',
allowBlank: false
});
@ -195,7 +195,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
if (!me.insideWizard) {
me.column2.push({
xtype: 'pvecheckbox',
fieldLabel: 'No backup',
fieldLabel: gettext('No backup'),
name: 'nobackup'
});
}
@ -207,6 +207,8 @@ Ext.define('PVE.qemu.HDInputPanel', {
Ext.define('PVE.qemu.HDEdit', {
extend: 'PVE.window.Edit',
isAdd: true,
initComponent : function() {
var me = this;
@ -226,13 +228,13 @@ Ext.define('PVE.qemu.HDEdit', {
create: me.create
});
var title;
var subject;
if (unused) {
me.title = 'Add (previously unused) Harddisk';
me.subject = gettext('Unused Disk');
} else if (me.create) {
me.title = 'Add Harddisk';
me.subject = gettext('Hard Disk');
} else {
me.title = 'Edit Harddisk settings (' + me.confid + ')';
me.subject = gettext('Hard Disk') + ' (' + me.confid + ')';
}
me.items = [ ipanel ];

View File

@ -14,7 +14,7 @@ Ext.define('PVE.qemu.HardwareView', {
if (rowdef.tdCls == 'pve-itype-icon-storage') {
if (record.data.value.match(/media=cdrom/)) {
metaData.tdCls = 'pve-itype-icon-cdrom';
return rowdef.header.replace(/Hard Disk/, 'CD/DVD');
return rowdef.cdheader;
}
}
}
@ -37,7 +37,7 @@ Ext.define('PVE.qemu.HardwareView', {
var rows = {
memory: {
header: 'Memory',
header: gettext('Memory'),
editor: 'PVE.qemu.MemoryEdit',
never_delete: true,
tdCls: 'pve-itype-icon-memory',
@ -46,7 +46,7 @@ Ext.define('PVE.qemu.HardwareView', {
}
},
sockets: {
header: 'Processors',
header: gettext('Processors'),
never_delete: true,
editor: 'PVE.qemu.ProcessorEdit',
tdCls: 'pve-itype-icon-processor',
@ -67,7 +67,7 @@ Ext.define('PVE.qemu.HardwareView', {
}
},
keyboard: {
header: 'Keyboard',
header: gettext('Keyboard Layout'),
never_delete: true,
editor: 'PVE.qemu.KeyboardEdit',
tdCls: 'pve-itype-icon-keyboard',
@ -75,7 +75,7 @@ Ext.define('PVE.qemu.HardwareView', {
renderer: PVE.Utils.render_kvm_language
},
vga: {
header: 'Display',
header: gettext('Display'),
editor: 'PVE.qemu.DisplayEdit',
never_delete: true,
tdCls: 'pve-itype-icon-display',
@ -96,7 +96,8 @@ Ext.define('PVE.qemu.HardwareView', {
group: 1,
tdCls: 'pve-itype-icon-storage',
editor: 'PVE.qemu.HDEdit',
header: 'Hard Disk ' + '(' + confid +')'
header: gettext('Hard Disk') + ' (' + confid +')',
cdheader: gettext('CD/DVD Drive') + ' (' + confid +')'
};
}
for (i = 0; i < 16; i++) {
@ -105,7 +106,8 @@ Ext.define('PVE.qemu.HardwareView', {
group: 1,
tdCls: 'pve-itype-icon-storage',
editor: 'PVE.qemu.HDEdit',
header: 'Hard Disk ' + '(' + confid +')'
header: gettext('Hard Disk') + ' (' + confid +')',
cdheader: gettext('CD/DVD Drive') + ' (' + confid +')'
};
}
for (i = 0; i < 16; i++) {
@ -114,7 +116,8 @@ Ext.define('PVE.qemu.HardwareView', {
group: 1,
tdCls: 'pve-itype-icon-storage',
editor: 'PVE.qemu.HDEdit',
header: 'Hard Disk ' + '(' + confid +')'
header: gettext('Hard Disk') + ' (' + confid +')',
cdheader: gettext('CD/DVD Drive') + ' (' + confid +')'
};
}
for (i = 0; i < 32; i++) {
@ -123,7 +126,7 @@ Ext.define('PVE.qemu.HardwareView', {
group: 2,
tdCls: 'pve-itype-icon-network',
editor: 'PVE.qemu.NetworkEdit',
header: 'Network Adapter '+ '(' + confid +')'
header: gettext('Network Device') + ' (' + confid +')'
};
}
for (i = 0; i < 8; i++) {
@ -131,7 +134,7 @@ Ext.define('PVE.qemu.HardwareView', {
group: 3,
tdCls: 'pve-itype-icon-storage',
editor: 'PVE.qemu.HDEdit',
header: 'Unused Disk'
header: gettext('Unused Disk') + ' ' + i
};
}
@ -151,8 +154,9 @@ Ext.define('PVE.qemu.HardwareView', {
var baseurl = 'nodes/' + nodename + '/qemu/' + vmid + '/config';
var sm = Ext.create('Ext.selection.RowModel', {});
var run_editor = function() {
var sm = me.getSelectionModel();
var rec = sm.getSelection()[0];
if (!rec) {
return;
@ -180,80 +184,70 @@ Ext.define('PVE.qemu.HardwareView', {
win.on('destroy', reload);
};
var edit_btn = new Ext.Button({
text: 'Edit',
var edit_btn = new PVE.button.Button({
text: gettext('Edit'),
selModel: sm,
disabled: true,
enableFn: function(rec) {
if (!rec) {
return false;
}
var rowdef = rows[rec.data.key];
return !!rowdef.editor;
},
handler: run_editor
});
var remove_btn = new Ext.Button({
text: 'Remove',
var remove_btn = new PVE.button.Button({
text: gettext('Remove'),
selModel: sm,
disabled: true,
handler: function(){
var sm = me.getSelectionModel();
var rec = sm.getSelection()[0];
if (!rec) {
return;
}
var msg = 'Are you sure you want to remove: ' +
me.renderKey(rec.data.key, {}, rec);
confirmMsg: function(rec) {
var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
"'" + me.renderKey(rec.data.key, {}, rec) + "'");
if (rec.data.key.match(/^unused\d+$/)) {
msg = 'Are you sure you want to remove image "' +
rec.data.value + '"? This will permanently erase ' +
'all image data.';
msg += " " + gettext('This will permanently erase all image data.');
}
Ext.Msg.confirm('Deletion Confirmation', msg, function(btn) {
if (btn !== 'yes') {
return;
return msg;
},
enableFn: function(rec) {
if (!rec) {
return false;
}
var rowdef = rows[rec.data.key];
return rowdef.never_delete !== true;
},
handler: function(b, e, rec) {
PVE.Utils.API2Request({
url: '/api2/extjs/' + baseurl,
waitMsgTarget: me,
method: 'PUT',
params: {
'delete': rec.data.key
},
callback: function() {
reload();
},
failure: function (response, opts) {
Ext.Msg.alert('Error',response.htmlStatus);
}
PVE.Utils.API2Request({
url: '/api2/extjs/' + baseurl,
waitMsgTarget: me,
method: 'PUT',
params: {
'delete': rec.data.key
},
callback: function() {
reload();
},
failure: function (response, opts) {
Ext.Msg.alert('Error',response.htmlStatus);
}
});
});
}
});
var set_button_status = function() {
var sm = me.getSelectionModel();
var rec = sm.getSelection()[0];
if (!rec) {
remove_btn.disable();
edit_btn.disable();
return;
}
var rowdef = rows[rec.data.key];
edit_btn.setDisabled(!rowdef.editor);
remove_btn.setDisabled(rowdef.never_delete === true);
};
Ext.applyIf(me, {
url: '/api2/json/' + baseurl,
selModel: sm,
cwidth1: 170,
tbar: [
{
text: 'Add',
text: gettext('Add'),
menu: new Ext.menu.Menu({
items: [
{
text: 'Hard Disk',
text: gettext('Hard Disk'),
iconCls: 'pve-itype-icon-storage',
handler: function() {
var win = Ext.create('PVE.qemu.HDEdit', {
@ -265,7 +259,7 @@ Ext.define('PVE.qemu.HardwareView', {
}
},
{
text: 'CD/DVD Drive',
text: gettext('CD/DVD Drive'),
iconCls: 'pve-itype-icon-cdrom',
handler: function() {
var win = Ext.create('PVE.qemu.CDEdit', {
@ -277,7 +271,7 @@ Ext.define('PVE.qemu.HardwareView', {
}
},
{
text: 'Network Device',
text: gettext('Network Device'),
iconCls: 'pve-itype-icon-network',
handler: function() {
var win = Ext.create('PVE.qemu.NetworkEdit', {
@ -298,8 +292,7 @@ Ext.define('PVE.qemu.HardwareView', {
sorterFn: sorterFn,
listeners: {
show: reload,
itemdblclick: run_editor,
selectionchange: set_button_status
itemdblclick: run_editor
}
});

View File

@ -5,12 +5,12 @@ Ext.define('PVE.qemu.KeyboardEdit', {
var me = this;
Ext.applyIf(me, {
title: "Edit keyboard settings",
subject: gettext('Keyboard Layout'),
items: {
xtype: 'VNCKeyboardSelector',
name: 'keyboard',
value: '',
fieldLabel: 'Keyboard Layout'
fieldLabel: gettext('Keyboard Layout')
}
});

View File

@ -14,7 +14,7 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
maxValue: 128*1024,
value: '512',
step: 32,
fieldLabel: 'Memory (MB)',
fieldLabel: gettext('Memory') + ' (MB)',
allowBlank: false
};
@ -35,7 +35,8 @@ Ext.define('PVE.qemu.MemoryEdit', {
var me = this;
Ext.apply(me, {
title: "Edit memory settings",
subject: gettext('Memory'),
fieldDefaults: { labelWidth: 120 },
items: Ext.create('PVE.qemu.MemoryInputPanel')
});

View File

@ -109,7 +109,7 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
{
xtype: 'PVE.form.NetworkCardSelector',
name: 'model',
fieldLabel: 'Network card',
fieldLabel: 'Model',
value: 'rtl8139',
allowBlank: false
},
@ -140,6 +140,8 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
Ext.define('PVE.qemu.NetworkEdit', {
extend: 'PVE.window.Edit',
isAdd: true,
initComponent : function() {
/*jslint confusion: true */
@ -158,8 +160,7 @@ Ext.define('PVE.qemu.NetworkEdit', {
});
Ext.applyIf(me, {
title: me.create ? "Add network device" :
"Edit network device settings",
subject: gettext('Network Device'),
items: ipanel
});

View File

@ -61,7 +61,7 @@ Ext.define('PVE.qemu.Options', {
visible: false
},
boot: {
header: 'Boot order',
header: gettext('Boot order'),
defaultValue: 'cdn',
editor: 'PVE.qemu.BootOrderEdit',
renderer: function(order) {

View File

@ -68,7 +68,7 @@ Ext.define('PVE.qemu.ProcessorEdit', {
var me = this;
Ext.apply(me, {
title: "Edit processor settings",
subject: gettext('Processors'),
items: Ext.create('PVE.qemu.ProcessorInputPanel')
});

View File

@ -130,7 +130,7 @@ Ext.define('PVE.storage.TemplateDownload', {
});
Ext.applyIf(me, {
title: gettext('Template download'),
title: gettext('Templates'),
layout: 'fit',
width: 600,
height: 400,

View File

@ -22,7 +22,7 @@ Ext.define('PVE.window.Backup', {
nodename: me.nodename,
name: 'storage',
value: me.storage,
fieldLabel: 'Storage',
fieldLabel: gettext('Storage'),
storageContent: 'backup',
allowBlank: false
});
@ -38,7 +38,7 @@ Ext.define('PVE.window.Backup', {
storagesel,
{
xtype: 'pveBackupModeSelector',
fieldLabel: 'Mode',
fieldLabel: gettext('Mode'),
value: 'snapshot',
name: 'mode'
},
@ -46,7 +46,7 @@ Ext.define('PVE.window.Backup', {
xtype: 'pveCompressionSelector',
name: 'compress',
value: 'lzo',
fieldLabel: 'Compress'
fieldLabel: gettext('Compression')
}
]
});
@ -54,7 +54,7 @@ Ext.define('PVE.window.Backup', {
var form = me.formPanel.getForm();
var submitBtn = Ext.create('Ext.Button', {
text: 'Backup',
text: gettext('Backup'),
handler: function(){
var storage = storagesel.getValue();
var values = form.getValues();
@ -87,9 +87,9 @@ Ext.define('PVE.window.Backup', {
}
});
var title = (me.vmtype === 'openvz') ?
"Backup CT " + me.vmid :
"Backup VM " + me.vmid;
var title = gettext('Backup') + " " +
((me.vmtype === 'openvz') ? "CT" : "VM") +
" " + me.vmid;
Ext.apply(me, {
title: title,

View File

@ -22,7 +22,7 @@ Ext.define('PVE.window.Restore', {
nodename: me.nodename,
name: 'storage',
value: '',
fieldLabel: 'Storage',
fieldLabel: gettext('Storage'),
storageContent: (me.vmtype === 'openvz') ? 'rootdir' : 'images',
allowBlank: true
});
@ -38,7 +38,7 @@ Ext.define('PVE.window.Restore', {
{
xtype: 'displayfield',
value: me.volidText || me.volid,
fieldLabel: 'Source'
fieldLabel: gettext('Source')
},
storagesel,
{
@ -74,7 +74,7 @@ Ext.define('PVE.window.Restore', {
};
var submitBtn = Ext.create('Ext.Button', {
text: 'Restore',
text: gettext('Restore'),
handler: function(){
var storage = storagesel.getValue();
var values = form.getValues();
@ -98,8 +98,8 @@ Ext.define('PVE.window.Restore', {
}
if (me.vmid) {
var msg = 'Are you sure you want to restore this VM"? ' +
'This will permanently erase current VM data.';
var msg = gettext('Are you sure you want to restore this VM?') + ' ' +
gettext('This will permanently erase current VM data.');
Ext.Msg.confirm('Confirmation', msg, function(btn) {
if (btn !== 'yes') {
return;