Просмотр исходного кода

#2634 If issues due to use of old translation method (#2637)

* Do not use _(string,value) but  sprintf(_('xxx'),'xxx')

* Add some extra locations

* Other affected locations
Jaap Marcus 3 лет назад
Родитель
Сommit
2a3441e880
4 измененных файлов с 9 добавлено и 9 удалено
  1. 1 1
      web/add/web/index.php
  2. 1 1
      web/edit/mail/index.php
  3. 1 1
      web/edit/package/index.php
  4. 6 6
      web/edit/web/index.php

+ 1 - 1
web/add/web/index.php

@@ -434,7 +434,7 @@ if (!empty($_POST['ok'])) {
                     if (!empty($v_ftp_user_data['v_ftp_user'])) {
                         $pw_len = strlen($v_ftp_user_data['v_ftp_password']);
                         if ($pw_len < 6) {
-                            $_SESSION['error_msg'] = _('Password is too short.', $error_msg);
+                            $_SESSION['error_msg'] =  sprintf(_('Password is too short.'), $error_msg);
                         }
                     }
                 }

+ 1 - 1
web/edit/mail/index.php

@@ -382,7 +382,7 @@ if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (empty($_GET['accou
                     $error_msg = $error_msg.", ".$error;
                 }
             }
-            $_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
+            $_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
         } else {
             exec('mktemp -d', $mktemp_output, $return_var);
             $tmpdir = $mktemp_output[0];

+ 1 - 1
web/edit/package/index.php

@@ -208,7 +208,7 @@ if (!empty($_POST['save'])) {
                 $error_msg = $error_msg.", ".$error;
             }
         }
-        $_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
+        $_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
     }
 
     // Protect input

+ 6 - 6
web/edit/web/index.php

@@ -556,7 +556,7 @@ if (!empty($_POST['save'])) {
                     $error_msg = $error_msg.", ".$error;
                 }
             }
-            $_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
+            $_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
         } else {
             exec('mktemp -d', $mktemp_output, $return_var);
             $tmpdir = $mktemp_output[0];
@@ -702,7 +702,7 @@ if (!empty($_POST['save'])) {
                     $error_msg = $error_msg.", ".$error;
                 }
             }
-            $_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
+            $_SESSION['error_msg'] =  sprintf(_('Field "%s" can not be blank.'), $error_msg);
         } else {
             $v_stats_user = escapeshellarg($_POST['v_stats_user']);
             $v_stats_password = tempnam("/tmp", "vst");
@@ -730,7 +730,7 @@ if (!empty($_POST['save'])) {
                     $error_msg = $error_msg.", ".$error;
                 }
             }
-            $_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
+            $_SESSION['error_msg'] =  sprintf(_('Field "%s" can not be blank.'), $error_msg);
         }
         if (($v_stats_user != $_POST['v_stats_user']) || (!empty($_POST['v_stats_password'])) && (empty($_SESSION['error_msg']))) {
             $v_stats_user = escapeshellarg($_POST['v_stats_user']);
@@ -770,7 +770,7 @@ if (!empty($_POST['save'])) {
                             $error_msg = $error_msg.", ".$error;
                         }
                     }
-                    $_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
+                    $_SESSION['error_msg'] =  sprintf(_('Field "%s" can not be blank.'), $error_msg);
                 }
 
                 // Add ftp account
@@ -841,7 +841,7 @@ if (!empty($_POST['save'])) {
                             $error_msg = $error_msg.", ".$error;
                         }
                     }
-                    $_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
+                    $_SESSION['error_msg'] =  sprintf(_('Field "%s" can not be blank.'), $error_msg);
                 }
 
                 // Change FTP account path
@@ -868,7 +868,7 @@ if (!empty($_POST['save'])) {
                     $hostname = exec('hostname');
                     $from = "noreply@".$hostname;
                     $from_name = _('Hestia Control Panel');
-                    $mailtext = _('FTP_ACCOUNT_READY', escapeshellarg($_GET['domain']), $user, $v_ftp_username_for_emailing, $v_ftp_user_data['v_ftp_password']);
+                    $mailtext =  sprintf(_('FTP_ACCOUNT_READY'), escapeshellarg($_GET['domain']), $user, $v_ftp_username_for_emailing, $v_ftp_user_data['v_ftp_password']);
                     send_email($to, $subject, $mailtext, $from, $from_name);
                     unset($v_ftp_email);
                 }