mark translateable strings with gettext

This commit is contained in:
Dietmar Maurer 2011-11-22 09:18:56 +01:00
parent 6b96e83ec9
commit a2dca26b09
19 changed files with 176 additions and 167 deletions

View File

@ -30,39 +30,39 @@ Ext.apply(Ext.form.field.VTypes, {
IPAddress: function(v) {
return (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/).test(v);
},
IPAddressText: 'Must be a numeric IP address',
IPAddressText: gettext('Example') + ': 192.168.1.1',
IPAddressMask: /[\d\.]/i,
MacAddress: function(v) {
return (/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/).test(v);
},
MacAddressMask: /[a-fA-F0-9:]/,
MacAddressText: 'Must be a valid MAC address (example: "01:23:45:67:89:ab")',
MacAddressText: gettext('Example') + ': 01:23:45:67:89:ab',
BridgeName: function(v) {
return (/^vmbr\d{1,4}$/).test(v);
},
BridgeNameText: 'Allowable bridge names: vmbr<b>N</b>, where 0 <= <b>N</b> <= 9999',
BridgeNameText: gettext('Format') + ': vmbr<b>N</b>, where 0 <= <b>N</b> <= 9999',
BondName: function(v) {
return (/^bond\d{1,4}$/).test(v);
},
BondNameText: 'Allowable bond names: bond<b>N</b>, where 0 <= <b>N</b> <= 9999',
BondNameText: gettext('Format') + ': bond<b>N</b>, where 0 <= <b>N</b> <= 9999',
QemuStartDate: function(v) {
return (/^(now|\d{4}-\d{1,2}-\d{1,2}(T\d{1,2}:\d{1,2}:\d{1,2})?)$/).test(v);
},
QemuStartDateText: 'Valid format for date are: "now" or "2006-06-17T16:01:21" or "2006-06-17"',
QemuStartDateText: gettext('Format') + ': "now" or "2006-06-17T16:01:21" or "2006-06-17"',
StorageId: function(v) {
return (/^[a-z][a-z0-9\-\_\.]*[a-z0-9]$/i).test(v);
},
StorageIdText: "ID contains illegal characters (allowed characters: 'a-z', '0-9', '-', '_' and '.')",
StorageIdText: gettext("Allowed characters") + ": 'a-z', '0-9', '-', '_', '.'",
HttpProxy: function(v) {
return (/^http:\/\/.*$/).test(v);
},
HttpProxyText: "Must confirm to schema 'http://.*' (example: 'http://username:password@host:port/')"
HttpProxyText: gettext('Example') + ": http://username:password&#64;host:port/"
});
// we dont want that a displayfield set the form dirty flag!
@ -244,10 +244,10 @@ Ext.define('PVE.Utils', { statics: {
},
extractRequestError: function(result, verbose) {
var msg = 'Successful';
var msg = gettext('Successful');
if (!result.success) {
msg = "Unknown error";
msg = gettext("Unknown error");
if (result.message) {
msg = result.message;
if (result.status) {
@ -270,10 +270,10 @@ Ext.define('PVE.Utils', { statics: {
var msg;
switch (action.failureType) {
case Ext.form.action.Action.CLIENT_INVALID:
msg = 'Form fields may not be submitted with invalid values';
msg = gettext('Form fields may not be submitted with invalid values');
break;
case Ext.form.action.Action.CONNECT_FAILURE:
msg = 'Connect failure';
msg = gettext('Connection error');
var resp = action.response;
if (resp.status && resp.statusText) {
msg += " " + resp.status + ": " + resp.statusText;
@ -291,7 +291,7 @@ Ext.define('PVE.Utils', { statics: {
API2Request: function(reqOpts) {
var newopts = Ext.apply({
waitMsg: 'Please wait...'
waitMsg: gettext('Please wait...')
}, reqOpts);
if (!newopts.url.match(/^\/api2/)) {
@ -324,13 +324,13 @@ Ext.define('PVE.Utils', { statics: {
try {
response.result = Ext.decode(response.responseText);
} catch(e) {}
var msg = "Connection error - server offline?";
var msg = gettext('Connection error') + ' - server offline?';
if (response.aborted) {
msg = 'Transaction aborted.';
msg = gettext('Connection error') + ' - aborted.';
} else if (response.timedout) {
msg = 'Communication failure: Timeout.';
msg = gettext('Connection error') + ' - Timeout.';
} else if (response.status && response.statusText) {
msg = 'Connection error ' + response.status + ': ' + response.statusText;
msg = gettext('Connection error') + ' ' + response.status + ': ' + response.statusText;
}
response.htmlStatus = msg;
Ext.callback(callbackFn, options.scope, [options, false, response]);
@ -541,19 +541,23 @@ Ext.define('PVE.Utils', { statics: {
}
},
yesText: gettext('Yes'),
noText: gettext('No'),
defaultText: gettext('Default'),
format_boolean_with_default: function(value) {
if (Ext.isDefined(value) && value !== '') {
return value ? 'Yes' : 'No';
return value ? PVE.Utils.yesText : PVE.Utils.noText;
}
return 'Default';
return PVE.Utils.defaultText;
},
format_boolean: function(value) {
return value ? 'Yes' : 'No';
return value ? PVE.Utils.yesText : PVE.Utils.noText;
},
format_neg_boolean: function(value) {
return !value ? 'Yes' : 'No';
return !value ? PVE.Utils.yesText : PVE.Utils.noText;
},
format_content_types: function(value) {

View File

@ -228,16 +228,16 @@ Ext.define('PVE.KVMConsole', {
var tbar = [
{
text: 'Start',
text: gettext('Start'),
handler: function() {
vm_command("start", {}, 1);
}
},
{
text: 'Stop',
text: gettext('Stop'),
handler: function() {
var msg = "Do you really want to stop the VM?";
Ext.Msg.confirm('Confirm', msg, function(btn) {
var msg = Ext.String.format(gettext("Do you really want to stop VM {0}?"), me.vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
@ -251,10 +251,10 @@ Ext.define('PVE.KVMConsole', {
vmid: me.vmid
},
{
text: 'Reset',
text: gettext('Reset'),
handler: function() {
var msg = "Do you really want to reset the VM?";
Ext.Msg.confirm('Confirm', msg, function(btn) {
var msg = Ext.String.format(gettext("Do you really want to reset VM {0}?"), me.vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
@ -263,10 +263,10 @@ Ext.define('PVE.KVMConsole', {
}
},
{
text: 'Shutdown',
text: gettext('Shutdown'),
handler: function() {
var msg = "Do you really want to shutdown the VM?";
Ext.Msg.confirm('Confirm', msg, function(btn) {
var msg = Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), me.vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
@ -275,10 +275,10 @@ Ext.define('PVE.KVMConsole', {
}
},
{
text: 'Suspend',
text: gettext('Suspend'),
handler: function() {
var msg = "Do you really want to suspend the VM?";
Ext.Msg.confirm('Confirm', msg, function(btn) {
var msg = Ext.String.format(gettext("Do you really want to suspend VM {0}?"), me.vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
@ -287,27 +287,27 @@ Ext.define('PVE.KVMConsole', {
}
},
{
text: 'Resume',
text: gettext('Resume'),
handler: function() {
vm_command("resume");
}
},
'->',
{
text: 'Refresh',
text: gettext('Refresh'),
handler: function() {
var applet = Ext.getDom(me.appletID);
applet.sendRefreshRequest();
}
},
{
text: 'Reload',
text: gettext('Reload'),
handler: function () {
me.reloadApplet();
}
},
{
text: 'Console',
text: gettext('Console'),
handler: function() {
var url = Ext.urlEncode({
console: 'kvm',
@ -364,16 +364,16 @@ Ext.define('PVE.OpenVZConsole', {
var tbar = [
{
text: 'Start',
text: gettext('Start'),
handler: function() {
vm_command("start", {}, 1);
}
},
{
text: 'Stop',
text: gettext('Stop'),
handler: function() {
var msg = "Do you really want to stop the VM?";
Ext.Msg.confirm('Confirm', msg, function(btn) {
var msg = Ext.String.format(gettext("Do you really want to stop VM {0}?"), me.vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
@ -382,10 +382,10 @@ Ext.define('PVE.OpenVZConsole', {
}
},
{
text: 'Shutdown',
text: gettext('Shutdown'),
handler: function() {
var msg = "Do you really want to shutdown the VM?";
Ext.Msg.confirm('Confirm', msg, function(btn) {
var msg = Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), me.vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
@ -395,20 +395,20 @@ Ext.define('PVE.OpenVZConsole', {
},
'->',
{
text: 'Refresh',
text: gettext('Refresh'),
handler: function() {
var applet = Ext.getDom(me.appletID);
applet.sendRefreshRequest();
}
},
{
text: 'Reload',
text: gettext('Reload'),
handler: function () {
me.reloadApplet();
}
},
{
text: 'Console',
text: gettext('Console'),
handler: function() {
var url = Ext.urlEncode({
console: 'openvz',
@ -445,18 +445,18 @@ Ext.define('PVE.Shell', {
var tbar = [
'->',
{
text: 'Refresh',
text: gettext('Refresh'),
handler: function() {
var applet = Ext.getDom(me.appletID);
applet.sendRefreshRequest();
}
},
{
text: 'Reload',
text: gettext('Reload'),
handler: function () { me.reloadApplet(); }
},
{
text: 'Shell',
text: gettext('Shell'),
handler: function() {
var url = Ext.urlEncode({
console: 'shell',

View File

@ -208,7 +208,8 @@ Ext.define('PVE.StdWorkspace', {
var ui = me.query('#userinfo')[0];
if (PVE.UserName) {
ui.update('<div class="x-unselectable" style="white-space:nowrap;">You are logged in as "' + PVE.UserName + '"</div>');
var msg = Ext.String.format(gettext("You are logged in as {0}"), "'" + PVE.UserName + "'");
ui.update('<div class="x-unselectable" style="white-space:nowrap;">' + msg + '</div>');
} else {
ui.update('');
}
@ -304,7 +305,7 @@ Ext.define('PVE.StdWorkspace', {
margins: '3 5 0 0',
xtype: 'button',
baseCls: 'x-btn',
text: "Logout",
text: gettext("Logout"),
handler: function() {
PVE.data.ResourceStore.stopUpdate();
me.showLogin();
@ -318,7 +319,7 @@ Ext.define('PVE.StdWorkspace', {
margins: '3 5 0 0',
xtype: 'button',
baseCls: 'x-btn',
text: "Create VM",
text: gettext("Create VM"),
handler: function() {
var wiz = Ext.create('PVE.qemu.CreateWizard', {});
wiz.show();
@ -329,7 +330,7 @@ Ext.define('PVE.StdWorkspace', {
margins: '3 5 0 0',
xtype: 'button',
baseCls: 'x-btn',
text: "Create CT",
text: gettext("Create CT"),
handler: function() {
var wiz = Ext.create('PVE.openvz.CreateWizard', {});
wiz.show();

View File

@ -37,7 +37,7 @@ Ext.define('PVE.button.Button', {
if (Ext.isFunction(me.confirmMsg)) {
msg = me.confirmMsg(rec);
}
Ext.Msg.confirm('Confirmation', msg, function(btn) {
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}

View File

@ -6,47 +6,47 @@ Ext.define('PVE.dc.Config', {
var me = this;
Ext.apply(me, {
title: "Datacenter",
title: gettext("Datacenter"),
hstateid: 'dctab',
items: [
{
xtype: 'pveDcOptionView',
title: 'Options',
title: gettext('Options'),
itemId: 'options'
},
{
xtype: 'pveStorageView',
title: 'Storage',
title: gettext('Storage'),
itemId: 'storage'
},
{
xtype: 'pveDcBackupView',
title: 'Backup',
title: gettext('Backup'),
itemId: 'backup'
},
{
xtype: 'pveUserView',
title: 'Users',
title: gettext('Users'),
itemId: 'users'
},
{
xtype: 'pveGroupView',
title: 'Groups',
title: gettext('Groups'),
itemId: 'groups'
},
{
xtype: 'pveACLView',
title: 'Permissions',
title: gettext('Permissions'),
itemId: 'permissions'
},
{
xtype: 'pveRoleView',
title: 'Roles',
title: gettext('Roles'),
itemId: 'roles'
},
{
xtype: 'pveAuthView',
title: 'Authentication',
title: gettext('Authentication'),
itemId: 'domains'
}
]

View File

@ -39,7 +39,7 @@ Ext.define('PVE.dc.Log', {
sortableColumns: false,
columns: [
{
header: "Start Time",
header: gettext("Time"),
dataIndex: 'time',
width: 100,
renderer: function(value) {
@ -47,12 +47,12 @@ Ext.define('PVE.dc.Log', {
}
},
{
header: "Node",
header: gettext("Node"),
dataIndex: 'node',
width: 100
},
{
header: "Tag",
header: gettext("Service"),
dataIndex: 'tag',
width: 100
},
@ -62,18 +62,18 @@ Ext.define('PVE.dc.Log', {
width: 100
},
{
header: "User",
header: gettext("User name"),
dataIndex: 'user',
width: 150
},
{
header: "Severity",
header: gettext("Severity"),
dataIndex: 'pri',
renderer: PVE.Utils.render_serverity,
width: 100
},
{
header: "Message",
header: gettext("Message"),
dataIndex: 'msg',
flex: 1
}

View File

@ -58,7 +58,7 @@ Ext.define('PVE.dc.Tasks', {
sortableColumns: false,
columns: [
{
header: "Start Time",
header: gettext("Start Time"),
dataIndex: 'starttime',
width: 100,
renderer: function(value) {
@ -66,7 +66,7 @@ Ext.define('PVE.dc.Tasks', {
}
},
{
header: "End Time",
header: gettext("End Time"),
dataIndex: 'endtime',
width: 100,
renderer: function(value, metaData, record) {
@ -78,23 +78,23 @@ Ext.define('PVE.dc.Tasks', {
}
},
{
header: "Node",
header: gettext("Node"),
dataIndex: 'node',
width: 100
},
{
header: "User",
header: gettext("User name"),
dataIndex: 'user',
width: 150
},
{
header: "Description",
header: gettext("Description"),
dataIndex: 'upid',
flex: 1,
renderer: PVE.Utils.render_upid
},
{
header: "Status",
header: gettext("Status"),
dataIndex: 'status',
width: 200,
renderer: function(value, metaData, record) {

View File

@ -8,15 +8,15 @@ Ext.define('PVE.form.ViewSelector', {
var default_views = {
server: {
text: 'Server View',
text: gettext('Server View'),
groups: ['node']
},
folder: {
text: 'Folder View',
text: gettext('Folder View'),
groups: ['type']
},
storage: {
text: 'Storage View',
text: gettext('Storage View'),
groups: ['node'],
filterfn: function(node) {
return node.data.type === 'storage';

View File

@ -174,11 +174,11 @@ Ext.define('PVE.grid.ResourceGrid', {
};
Ext.apply(me, {
title: 'Search',
title: gettext('Search'),
store: store,
tbar: [
'->',
'Search:', ' ',
gettext('Search') + ':', ' ',
{
xtype: 'textfield',
width: 200,

View File

@ -12,14 +12,13 @@ use PVE::REST;
sub send_output {
my ($r, $data) = @_;
my $encdata = encode('UTF-8', $data);
$r->no_cache (1);
my $x = length ($encdata);
my $x = length ($data);
$r->content_type ("text/html;charset=UTF-8");
$r->headers_out->set ("Content-length", "$x");
$r->headers_out->set ("Pragma", "no-cache");
$r->print ($encdata);
$r->print ($data);
}
# NOTE: Requests to this page are not authenticated

View File

@ -27,24 +27,24 @@ Ext.define('PVE.node.Config', {
});
};
var rebootBtn = Ext.create('PVE.button.Button', {
text: 'Reboot',
confirmMsg: "Do you really want to reboot node '" + nodename + "'?",
var restartBtn = Ext.create('PVE.button.Button', {
text: gettext('Restart'),
confirmMsg: Ext.String.format(gettext("Do you really want to restart node {0}?"), nodename),
handler: function() {
node_command('reboot');
}
});
var shutdownBtn = Ext.create('PVE.button.Button', {
text: 'Shutdown',
confirmMsg: "Do you really want to shutdown node '" + nodename + "'?",
text: gettext('Shutdown'),
confirmMsg: Ext.String.format(gettext("Do you really want to shutdown node {0}?"), nodename),
handler: function() {
node_command('shutdown');
}
});
var shellBtn = Ext.create('Ext.Button', {
text: 'Shell',
text: gettext('Shell'),
handler: function() {
var url = Ext.urlEncode({
console: 'shell',
@ -57,23 +57,23 @@ Ext.define('PVE.node.Config', {
});
Ext.apply(me, {
title: "Node '" + nodename + "'",
title: gettext('Node') + " '" + nodename + "'",
hstateid: 'nodetab',
defaults: { statusStore: me.statusStore },
tbar: [ rebootBtn, shutdownBtn, shellBtn ],
tbar: [ restartBtn, shutdownBtn, shellBtn ],
items: [
{
title: 'Summary',
title: gettext('Summary'),
itemId: 'summary',
xtype: 'pveNodeSummary'
},
{
title: 'Services',
title: gettext('Services'),
itemId: 'services',
xtype: 'pveNodeServiceView'
},
{
title: 'Network',
title: gettext('Network'),
itemId: 'network',
xtype: 'pveNodeNetworkView'
},
@ -83,7 +83,7 @@ Ext.define('PVE.node.Config', {
xtype: 'pveNodeDNSView'
},
{
title: 'Time',
title: gettext('Time'),
itemId: 'time',
xtype: 'pveNodeTimeView'
},
@ -112,7 +112,7 @@ Ext.define('PVE.node.Config', {
var uptimerec = s.data.get('uptime');
var uptime = uptimerec ? uptimerec.data.value : false;
rebootBtn.setDisabled(!uptime);
restartBtn.setDisabled(!uptime);
shutdownBtn.setDisabled(!uptime);
shellBtn.setDisabled(!uptime);
});

View File

@ -54,7 +54,7 @@ Ext.define('PVE.node.Tasks', {
};
var view_btn = new Ext.Button({
text: 'View',
text: gettext('View'),
disabled: true,
handler: run_task_viewer
});
@ -79,7 +79,7 @@ Ext.define('PVE.node.Tasks', {
}
},
tbar: [
view_btn, '->', 'User:', ' ',
view_btn, '->', gettext('User name') +':', ' ',
{
xtype: 'textfield',
width: 200,
@ -91,7 +91,7 @@ Ext.define('PVE.node.Tasks', {
reload_task.delay(500);
}
}
}, ' ', 'Only Errors:', ' ',
}, ' ', gettext('Only Errors') + ':', ' ',
{
xtype: 'checkbox',
hideLabel: true,
@ -107,34 +107,40 @@ Ext.define('PVE.node.Tasks', {
sortableColumns: false,
columns: [
{
header: "Start Time", dataIndex: 'starttime',
header: gettext("Start Time"),
dataIndex: 'starttime',
width: 100,
renderer: function(value) {
return Ext.Date.format(value, "M d H:i:s");
}
},
{
header: "End Time", dataIndex: 'endtime',
header: gettext("End Time"),
dataIndex: 'endtime',
width: 100,
renderer: function(value, metaData, record) {
return Ext.Date.format(value,"M d H:i:s");
}
},
{
header: "Node", dataIndex: 'node',
header: gettext("Node"),
dataIndex: 'node',
width: 100
},
{
header: "User", dataIndex: 'user',
header: gettext("User name"),
dataIndex: 'user',
width: 150
},
{
header: "Description", dataIndex: 'upid',
header: gettext("Description"),
dataIndex: 'upid',
flex: 1,
renderer: PVE.Utils.render_upid
},
{
header: "Status", dataIndex: 'status',
header: gettext("Status"),
dataIndex: 'status',
width: 200,
renderer: function(value, metaData, record) {
if (value == 'OK') {

View File

@ -27,18 +27,18 @@ Ext.define('PVE.openvz.CmdMenu', {
me.items = [
{
text: 'Start',
text: gettext('Start'),
icon: '/pve2/images/start.png',
handler: function() {
vm_command('start');
}
},
{
text: 'Shutdown',
text: gettext('Shutdown'),
icon: '/pve2/images/stop.png',
handler: function() {
var msg = "Do you really want to shutdown the VM?";
Ext.Msg.confirm('Confirmation', msg, function(btn) {
var msg = Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), me.vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
@ -48,7 +48,7 @@ Ext.define('PVE.openvz.CmdMenu', {
}
},
{
text: 'Console',
text: gettext('Console'),
icon: '/pve2/images/display.png',
handler: function() {
PVE.Utils.openConoleWindow('openvz', me.vmid, me.nodename);

View File

@ -33,30 +33,30 @@ Ext.define('PVE.openvz.Config', {
};
var startBtn = Ext.create('Ext.Button', {
text: 'Start',
text: gettext('Start'),
handler: function() {
vm_command('start');
}
});
var stopBtn = Ext.create('PVE.button.Button', {
text: 'Stop',
confirmMsg: "Do you really want to stop the VM?",
text: gettext('Stop'),
confirmMsg: Ext.String.format(gettext("Do you really want to stop VM {0}?"), vmid),
handler: function() {
vm_command("stop", { fast: 1 });
}
});
var shutdownBtn = Ext.create('PVE.button.Button', {
text: 'Shutdown',
confirmMsg: "Do you really want to shutdown the VM?",
text: gettext('Shutdown'),
confirmMsg: Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), vmid),
handler: function() {
vm_command('stop');
}
});
var migrateBtn = Ext.create('Ext.Button', {
text: 'Migrate',
text: gettext('Migrate'),
handler: function() {
var win = Ext.create('PVE.window.Migrate', {
vmtype: 'openvz',
@ -68,9 +68,8 @@ Ext.define('PVE.openvz.Config', {
});
var removeBtn = Ext.create('PVE.button.Button', {
text: 'Remove',
confirmMsg: 'Are you sure you want to remove VM ' +
vmid + '? This will permanently erase all VM data.',
text: gettext('Remove'),
confirmMsg: Ext.String.format(gettext('Are you sure you want to remove VM {0}? This will permanently erase all VM data.'), vmid),
handler: function() {
PVE.Utils.API2Request({
url: '/nodes/' + nodename + '/openvz/' + vmid,
@ -84,34 +83,34 @@ Ext.define('PVE.openvz.Config', {
});
var consoleBtn = Ext.create('Ext.Button', {
text: 'Console',
text: gettext('Console'),
handler: function() {
PVE.Utils.openConoleWindow('openvz', vmid, nodename);
}
});
var vmname = me.pveSelNode.data.name;
var descr = vmname ? " '" + vmname + "'" : '';
var descr = vmid + " (" + (vmname ? "'" + vmname + "' " : "'CT " + vmid + "'") + ")";
Ext.apply(me, {
title: "OpenVZ container " + vmid + descr +
" on node '" + nodename + "'",
title: Ext.String.format(gettext("Container {0} on node {1}"), descr, "'" + nodename + "'"),
hstateid: 'ovztab',
tbar: [ startBtn, stopBtn, shutdownBtn, migrateBtn,
removeBtn, consoleBtn ],
defaults: { statusStore: me.statusStore },
items: [
{
title: 'Summary',
title: gettext('Summary'),
xtype: 'pveOpenVZSummary',
itemId: 'summary'
},
{
title: 'Ressources',
itemId: 'ressources',
title: gettext('Resources'),
itemId: 'resources',
xtype: 'pveOpenVZRessourceView'
},
{
title: 'Network',
title: gettext('Network'),
itemId: 'network',
xtype: 'pveOpenVZNetworkView'
},
@ -121,7 +120,7 @@ Ext.define('PVE.openvz.Config', {
xtype: 'pveOpenVZDNS'
},
{
title: 'Options',
title: gettext('Options'),
itemId: 'options',
xtype: 'pveOpenVZOptions'
},
@ -138,12 +137,12 @@ Ext.define('PVE.openvz.Config', {
url: '/api2/extjs/nodes/' + nodename + '/openvz/' + vmid + '/initlog'
},
{
title: gettext('Backup'),
xtype: 'pveBackupView',
title: 'Backup',
itemId: 'backup'
},
{
title: 'Permissions',
title: gettext('Permissions'),
itemId: 'permissions',
html: 'permissions ' + vmid
}

View File

@ -33,12 +33,12 @@ Ext.define('PVE.panel.StatusPanel', {
items: [
{
itemId: 'tasks',
title: 'Recent tasks',
title: gettext('Tasks'),
xtype: 'pveClusterTasks'
},
{
itemId: 'clog',
title: 'Cluster log',
title: gettext('Cluster log'),
xtype: 'pveClusterLog'
}
]

View File

@ -27,18 +27,18 @@ Ext.define('PVE.qemu.CmdMenu', {
me.items = [
{
text: 'Start',
text: gettext('Start'),
icon: '/pve2/images/start.png',
handler: function() {
vm_command('start');
}
},
{
text: 'Shutdown',
text: gettext('Shutdown'),
icon: '/pve2/images/stop.png',
handler: function() {
var msg = "Do you really want to shutdown the VM?";
Ext.Msg.confirm('Confirmation', msg, function(btn) {
var msg = Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), me.vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
@ -48,7 +48,7 @@ Ext.define('PVE.qemu.CmdMenu', {
}
},
{
text: 'Console',
text: gettext('Console'),
icon: '/pve2/images/display.png',
handler: function() {
PVE.Utils.openConoleWindow('kvm', me.vmid, me.nodename);

View File

@ -33,22 +33,22 @@ Ext.define('PVE.qemu.Config', {
};
var startBtn = Ext.create('Ext.Button', {
text: 'Start',
text: gettext('Start'),
handler: function() {
vm_command('start');
}
});
var stopBtn = Ext.create('PVE.button.Button', {
text: 'Stop',
confirmMsg: "Do you really want to stop the VM?",
text: gettext('Stop'),
confirmMsg: Ext.String.format(gettext("Do you really want to stop VM {0}?"), vmid),
handler: function() {
vm_command("stop", { timeout: 30 });
}
});
var migrateBtn = Ext.create('Ext.Button', {
text: 'Migrate',
text: gettext('Migrate'),
handler: function() {
var win = Ext.create('PVE.window.Migrate', {
vmtype: 'qemu',
@ -60,8 +60,8 @@ Ext.define('PVE.qemu.Config', {
});
var resetBtn = Ext.create('PVE.button.Button', {
text: 'Reset',
confirmMsg: "Do you really want to reset the VM?",
text: gettext('Reset'),
confirmMsg: Ext.String.format(gettext("Do you really want to reset VM {0}?"), vmid),
handler: function() {
vm_command("reset");
}
@ -69,16 +69,15 @@ Ext.define('PVE.qemu.Config', {
var shutdownBtn = Ext.create('PVE.button.Button', {
text: gettext('Shutdown'),
confirmMsg: "Do you really want to shutdown the VM?",
confirmMsg: Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), vmid),
handler: function() {
vm_command('shutdown', { timeout: 30 });
}
});
var removeBtn = Ext.create('PVE.button.Button', {
text: 'Remove',
confirmMsg: 'Are you sure you want to remove VM ' +
vmid + '? This will permanently erase all VM data.',
text: gettext('Remove'),
confirmMsg: Ext.String.format(gettext('Are you sure you want to remove VM {0}? This will permanently erase all VM data.'), vmid),
handler: function() {
PVE.Utils.API2Request({
url: '/nodes/' + nodename + '/qemu/' + vmid,
@ -92,49 +91,49 @@ Ext.define('PVE.qemu.Config', {
});
var consoleBtn = Ext.create('Ext.Button', {
text: 'Console',
text: gettext('Console'),
handler: function() {
PVE.Utils.openConoleWindow('kvm', vmid, nodename);
}
});
var vmname = me.pveSelNode.data.name;
var descr = vmname ? "'" + vmname + "' " : '';
var descr = vmid + " (" + (vmname ? "'" + vmname + "' " : "'VM " + vmid + "'") + ")";
Ext.apply(me, {
title: "Virtual machine " + descr + "'KVM " + vmid +
"' on node '" + nodename + "'",
title: Ext.String.format(gettext("Virtual machine {0} on node {1}"), descr, "'" + nodename + "'"),
hstateid: 'kvmtab',
tbar: [ startBtn, stopBtn, resetBtn, shutdownBtn,
migrateBtn, removeBtn, consoleBtn ],
defaults: { statusStore: me.statusStore },
items: [
{
title: 'Summary',
title: gettext('Summary'),
xtype: 'pveQemuSummary',
itemId: 'summary'
},
{
title: 'Hardware',
title: gettext('Hardware'),
itemId: 'hardware',
xtype: 'PVE.qemu.HardwareView'
},
{
title: 'Options',
title: gettext('Options'),
itemId: 'options',
xtype: 'PVE.qemu.Options'
},
{
title: 'Monitor',
title: gettext('Monitor'),
itemId: 'monitor',
xtype: 'pveQemuMonitor'
},
{
title: gettext('Backup'),
xtype: 'pveBackupView',
title: 'Backup',
itemId: 'backup'
},
{
title: 'Permissions',
title: gettext('Permissions'),
itemId: 'permissions',
html: 'permissions ' + vmid
}

View File

@ -16,21 +16,22 @@ Ext.define('PVE.storage.Browser', {
}
Ext.apply(me, {
title: "Storage '" + storeid + "'" + "' on node '" + nodename + "'",
title: Ext.String.format(gettext("Storage {0} on node {1}"),
"'" + storeid + "'", "'" + nodename + "'"),
hstateid: 'storagetab',
items: [
{
title: 'Summary',
title: gettext('Summary'),
xtype: 'pveStorageSummary',
itemId: 'summary'
},
{
xtype: 'pveStorageContentView',
title: 'Content',
title: gettext('Content'),
itemId: 'content'
},
{
title: 'Permissions',
title: gettext('Permissions'),
itemId: 'permissions',
html: 'Permissions '
}

View File

@ -10,19 +10,19 @@ Ext.define('PVE.tree.ResourceTree', {
typeDefaults: {
node: {
iconCls: 'x-tree-node-server',
text: 'Node list'
text: gettext('Node list')
},
storage: {
iconCls: 'x-tree-node-harddisk',
text: 'Storage list'
text: gettext('Storage list')
},
qemu: {
iconCls: 'x-tree-node-computer',
text: 'Virtual machines'
text: gettext('Virtual machines')
},
openvz: {
iconCls: 'x-tree-node-openvz',
text: 'OpenVZ containers'
text: gettext('OpenVZ containers')
}
}
},
@ -182,7 +182,7 @@ Ext.define('PVE.tree.ResourceTree', {
root: {
expanded: true,
id: 'root',
text: "Datacenter"
text: gettext('Datacenter')
}
});