Skip to content

Commit fb216fc

Browse files
committed
i18n integration
1 parent a8a86ac commit fb216fc

File tree

18 files changed

+287
-224
lines changed

18 files changed

+287
-224
lines changed

web/add/user/index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
$v_email = escapeshellarg($_POST['v_email']);
3535
$v_fname = escapeshellarg($_POST['v_fname']);
3636
$v_lname = escapeshellarg($_POST['v_lname']);
37-
if (empty($_POST['v_notify'])) $v_notify = 'off';
37+
$v_notify = $_POST['v_notify'];
3838

3939
// Validate email
4040
if (!filter_var($_POST['v_email'], FILTER_VALIDATE_EMAIL)) {
@@ -60,8 +60,8 @@
6060
if (empty($error)) $error = _('Error: vesta did not return any output.');
6161
$_SESSION['error_msg'] = $error;
6262
} else {
63-
if (empty($v_notify)) {
64-
$to = $_POST['v_email'];
63+
if (!empty($v_notify)) {
64+
$to = $_POST['v_notify'];
6565
$subject = _("Welcome to Vesta Control Panel");
6666
$hostname = exec('hostname');
6767
$from = _('MAIL_FROM',$hostname);
@@ -80,6 +80,7 @@
8080
unset($v_email);
8181
unset($v_fname);
8282
unset($v_lname);
83+
unset($v_notify);
8384
}
8485
unset($output);
8586
}

web/add/web/index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// Panel
1313
top_panel($user,$TAB);
14-
14+
$v_ftp_email = $panel[$user]['CONTACT'];
1515
if (!empty($_POST['ok'])) {
1616
// Check input
1717
if (empty($_POST['v_domain'])) $errors[] = _('domain');
@@ -91,7 +91,7 @@
9191
$_SESSION['error_msg'] = $error;
9292
}
9393
unset($output);
94-
94+
9595
// Add DNS
9696
if (($_POST['v_dns'] == 'on') && (empty($_SESSION['error_msg']))) {
9797
exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip, $output, $return_var);
@@ -256,7 +256,7 @@
256256
$from = _('MAIL_FROM',$hostname);
257257
$mailtext .= _('FTP_ACCOUNT_READY',$_POST['v_domain'],$user,$_POST['v_ftp_user'],$_POST['v_ftp_password']);
258258
send_email($to, $subject, $mailtext, $from);
259-
unset($v_ftp_email);
259+
//unset($v_ftp_email);
260260
}
261261
}
262262
unset($v_ftp);
@@ -283,7 +283,7 @@
283283
$_SESSION['error_msg'] = $error;
284284
}
285285
unset($output);
286-
$_SESSION['ok_msg'] = _('HOSTING_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
286+
$_SESSION['ok_msg'] = _('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
287287
unset($v_domain);
288288
unset($v_aliases);
289289
unset($v_ssl);

web/edit/web/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// Panel
1515
top_panel($user,$TAB);
1616

17+
$lang = 'ru_RU.utf8';
18+
setlocale(LC_ALL, $lang);
1719

1820
// Check user argument?
1921
if (empty($_GET['domain'])) {
@@ -85,7 +87,9 @@
8587
unset($output);
8688
}
8789

90+
8891
// Action
92+
$v_ftp_email = $panel[$user]['CONTACT'];
8993
if (!empty($_POST['save'])) {
9094
$v_domain = escapeshellarg($_POST['v_domain']);
9195

@@ -567,7 +571,7 @@
567571
$subject = _("FTP login credentials");
568572
$hostname = exec('hostname');
569573
$from = _('MAIL_FROM',$hostname);
570-
$mailtext .= _('FTP_ACCOUNT_READY',$_GET['domain'],$user."_".$_POST['v_ftp_user'],$_POST['v_ftp_password']);
574+
$mailtext .= _('FTP_ACCOUNT_READY',$_GET['v_domain'],$user,$_POST['v_ftp_user'],$_POST['v_ftp_password']);
571575
send_email($to, $subject, $mailtext, $from);
572576
unset($v_ftp_email);
573577
}

web/inc/i18n/en.php

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
if (!defined('LANGUAGE')) die('Direct access not allowed');
88

99
$LANG = array(
10+
'yes'=>'yes',
11+
'no'=>'no',
1012
'Hour'=>'Hour',
1113
'Min'=>'Min',
1214
'pb'=>'pb',
@@ -32,22 +34,22 @@
3234
'type'=>'type',
3335
'charset'=>'charset',
3436
'edit'=>'edit',
35-
'DATABASE_CREATED_OK'=>'Success: Database <a href="/edit/db/?database=%s"><b>%s</b></a> has been created.',
37+
'DATABASE_CREATED_OK'=>'Database <a href="/edit/db/?database=%s"><b>%s</b></a> has been created successfully.',
3638
'domain'=>'domain',
3739
'ip'=>'IP',
38-
'DOMAIN_CREATED_OK'=>'Success: Domain <a href="/list/dns/?domain=%s"><b>%s</b></a> has been created.',
39-
'RECORD_CREATED_OK'=>'Success: Record <b>%s.%s</b> has been created.',
40+
'DOMAIN_CREATED_OK'=>'Domain <a href="/list/dns/?domain=%s"><b>%s</b></a> has been created successfully.',
41+
'RECORD_CREATED_OK'=>'Record <b>%s.%s</b> has been created successfully.',
4042
'ip address'=>'IP-address',
4143
'netmask'=>'netmask',
4244
'Netmask'=>'Netmask',
4345
'interface'=>'interface',
4446
'Interface'=>'Interface',
4547
'assigned user'=>'assigned user',
46-
'IP_CREATED_OK'=>'"Success: IP address <a href="/edit/ip/?ip=%s"><b>%s</b></a> has been created.',
47-
'DOMAIN_MAIL_CREATED_OK'=>'Success: Mail for domain <a href="/list/mail/?domain=%s"><b>%s</b></a> has been created.',
48+
'IP_CREATED_OK'=>'"IP address <a href="/edit/ip/?ip=%s"><b>%s</b></a> has been created successfully.',
49+
'DOMAIN_MAIL_CREATED_OK'=>'Mail for domain <a href="/list/mail/?domain=%s"><b>%s</b></a> has been created successfully.',
4850
'account'=>'account',
4951
'Account'=>'Account',
50-
'MAIL_ACCOUNT_CREATED_OK'=>'Success: Mail account <a href="/edit/mail/?account=%s&domain=%s"><b>%s@%s</b></a> has been created.',
52+
'MAIL_ACCOUNT_CREATED_OK'=>'Mail account <a href="/edit/mail/?account=%s&domain=%s"><b>%s@%s</b></a> has been created successfully.',
5153
'package'=>'package',
5254
'template'=>'template',
5355
'shell'=>'SSH',
@@ -77,7 +79,7 @@
7779
'Bandwidth'=>'Bandwidth',
7880
'ns1'=>'ns1',
7981
'ns2'=>'ns2',
80-
'PACKAGE_CREATED_OK'=>'Success: Package <a href="/edit/package/?package=%s"><b>%s</b></a> has been created.',
82+
'PACKAGE_CREATED_OK'=>'Package <a href="/edit/package/?package=%s"><b>%s</b></a> has been created successfully.',
8183
'user'=>'user',
8284
'email'=>'email',
8385
'Email'=>'Email',
@@ -89,7 +91,7 @@
8991
'GREETINGS_GORDON_FREEMAN'=>"Hello, %s %s,\n",
9092
'GREETINGS'=>"Hello,\n",
9193
'ACCOUNT_READY'=>"You account has been created and ready for use.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n",
92-
'ACCOUNT_CREATED_OK'=>'Success: User <a href="/edit/user/?user=%s"><b>%s</b></a> has been created.',
94+
'ACCOUNT_CREATED_OK'=>'User <a href="/edit/user/?user=%s"><b>%s</b></a> has been created successfully.',
9395
'ssl certificate'=>'SSL certificate',
9496
'ssl key'=>'SSL key',
9597
'SSL Support'=>'SSL Support',
@@ -103,8 +105,8 @@
103105
'ftp user password'=>'FTP user password',
104106
'ftp user'=>'FTP user',
105107
'FTP login credentials'=>'FTP login credentials',
106-
'FTP_ACCOUNT_READY'=>"Your FTP account has been created and ready for use.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n",
107-
'HOSTING_DOMAIN_CREATED_OK'=>'Success: Web domain <a href="/edit/web/?domain=%s"><b>%s</b></a> has been created.',
108+
'FTP_ACCOUNT_READY'=>"FTP account has been created and ready for use.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n",
109+
'WEB_DOMAIN_CREATED_OK'=>'Web domain <a href="/edit/web/?domain=%s"><b>%s</b></a> has been created successfully.',
108110
'OK: changes has been saved.'=>'Success: Changes have been saved.',
109111
'FTP login credentials'=>'FTP login credentials',
110112
'505'=>'505 &mdash; oops, internal error. Call an Ambulance!',
@@ -156,6 +158,7 @@
156158
'Confirm Password'=>'Confirm Password',
157159
'Reset'=>'Reset',
158160
'Statistics'=>'Statistics',
161+
'Web Statistics'=>'Statistics',
159162
'History Log'=>'History Log',
160163
'Vesta logo'=>'Vesta logo',
161164
'USER'=>'USER',
@@ -183,7 +186,7 @@
183186
'Disk'=>'Disk',
184187
'traffic'=>'traffic',
185188
'Database Credentials'=>'Database Credentials',
186-
'DATABASE_READY'=>"Hello, %s %s,\nYour %s database has been created successfully.\n\nDatabase: %s_%s\nUser: %s_%s\nPassword: %s\n\n",
189+
'DATABASE_READY'=>"Hello, %s %s,\nDatabase %s has been created successfully.\n\nDatabase: %s_%s\nUser: %s_%s\nPassword: %s\n\n",
187190
'Send credentials to'=>'Send credentials to',
188191
'Adding DNS Record'=>'Adding DNS Record',
189192
'Record'=>'Record',
@@ -213,8 +216,9 @@
213216
'Adding User'=>'Adding User',
214217
'First Name'=>'First Name',
215218
'Last Name'=>'Last Name',
216-
'SEND_CREDENTIALS_NOTICE'=>'Send fresh credentials to user by email?',
217-
'Adding Domain for hosting'=>'Adding Domain for hosting',
219+
'SEND_CREDENTIALS_NOTICE'=>'Send login credentials to',
220+
'SEND_FTP_CREDENTIALS' => 'Send FTP credentials to'
221+
'Adding Web Domain'=>'Adding Web Domain',
218222
'Apache template'=>'Apache template',
219223
'Nginx Support'=>'Nginx Support',
220224
'Nginx Extentions'=>'Nginx Extentions',
@@ -249,7 +253,7 @@
249253
'Memory'=>'Memory',
250254
'stop'=>'stop',
251255
'Run Time'=>'Run Time',
252-
'BACKUP_DELETE_CONFIRMATION'=>'Are you sure to delete <b>%s</b> backup?',
256+
'BACKUP_DELETE_CONFIRMATION'=>'Are you sure to delete %s backup?',
253257
'Backup Size'=>'Backup Size',
254258
'SYS'=>'SYS',
255259
'one archive'=>'one archive',
@@ -259,45 +263,45 @@
259263
'open webmail'=>'open webmail',
260264
'suspend'=>'suspend',
261265
'unsuspend'=>'unsuspend',
262-
'CRON_ACTION_CONFIRMATION'=>'Are you sure to <b>%s</b> cron job?',
266+
'CRON_ACTION_CONFIRMATION'=>'Are you sure to %s cron job?',
263267
'Confirmation'=>'Confirmation',
264268
'one cron job'=>'one cron job',
265269
'%s cron jobs'=>'%s cron jobs',
266270
'Add Database'=>'Add Database',
267271
'open %s'=>'open %s',
268-
'DATABASE_ACTION_CONFIRMATION'=>'Are you sure to <b>%s</b> database <b>%s</b>?',
272+
'DATABASE_ACTION_CONFIRMATION'=>'Are you sure to %s database %s?',
269273
'one database'=>'ne database',
270274
'%s databases'=>'%s databases',
271275
'Add DNS Domain'=>'Add DNS Domain',
272276
'Search'=>'Search',
273277
'LIST_DOMAIN_RECORDS'=>'Show %s records',
274278
'add record'=>'add record',
275-
'DOMAIN_ACTION_CONFIRMATION'=>'Are you sure to <b>%s</b> domain <b>%s?</b>',
276-
'one domain'=>'one domain',
279+
'DOMAIN_ACTION_CONFIRMATION'=>'Are you sure to %s domain %s?',
280+
'1 domain'=>'1 domain',
277281
'%s domains'=>'%s domains',
278282
'Add DNS Record'=>'Add DNS Record',
279283
'Listing'=>'Listing',
280284
'list'=>'list',
281-
'RECORD_ACTION_CONFIRMATION'=>'Are you sure to <b>%s</b> record <b>%s</b>?',
285+
'RECORD_ACTION_CONFIRMATION'=>'Are you sure to %s record %s?',
282286
'one DNS record'=>'one DNS record',
283287
'%s DNS records'=>'%s DNS records',
284288
'Add IP'=>'Add IP',
285-
'IP_DELETE_CONFIRMATION'=>'Are you sure to delere IP-address <b>%s</b>?',
289+
'IP_DELETE_CONFIRMATION'=>'Are you sure to delere IP-address %s?',
286290
'Status'=>'Status',
287291
'one IP address'=>'one IP address',
288292
'%s IP addresses'=>'%s IP addresses',
289293
'one log record'=>'one log record',
290294
'%s log records'=>'%s log records',
291295
'Add Mail Domain'=>'Add Mail Domain',
292-
'MAIL_ACTION_CONFIRMATION'=>'Are you sure to <b>%s</b> mail for domain <b>%s</b>?',
296+
'MAIL_ACTION_CONFIRMATION'=>'Are you sure to %s mail for domain %s?',
293297
'one domain with email'=>'one domain with email',
294298
'%s domains with email'=>'%s domains with email',
295299
'Add Mail Account'=>'Add Mail Account',
296-
'MAIL_ACCOUNT_ACTION_CONFIRMATION'=>'Are you sure to <b>%s</b> mail account <b>%s</b>?',
300+
'MAIL_ACCOUNT_ACTION_CONFIRMATION'=>'Are you sure to %s mail account %s?',
297301
'one mail account'=>'one mail account',
298302
'%s mail accounts'=>'%s mail accounts',
299303
'Add Package'=>'Add Package',
300-
'PACKAGE_DELETE_CONFIRMATION'=>'Are you sure to delete package <b>%s</b>?',
304+
'PACKAGE_DELETE_CONFIRMATION'=>'Are you sure to delete package %s?',
301305
'one package'=>'one package',
302306
'%s packages'=>'%s packages',
303307
'Daily'=>'Daily',
@@ -326,8 +330,8 @@
326330
'rebuild db'=>'rebuild db',
327331
'rebuild cron'=>'rebuild cron',
328332
'update counters'=>'update counters',
329-
'LOGGED_IN_AS'=>'Logged in as %s',
330-
'USER_ACTION_CONFIRMATION'=>'Are you sure to <b>%s</b> user <b>%s</b>?',
333+
'LOGGED_IN_AS'=>'Logged in as user %s',
334+
'USER_ACTION_CONFIRMATION'=>'Are you sure to %s user %s?',
331335
'one account'=>'one account',
332336
'%s accounts'=>'%s accounts',
333337
'Add Domain for hosting'=>'Add Domain for hosting',

0 commit comments

Comments
 (0)