Преглед изворни кода

Translate “Welcome” new user in selected language

Jaap Marcus пре 5 година
родитељ
комит
bb2acbbe0c
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      web/add/user/index.php

+ 7 - 2
web/add/user/index.php

@@ -88,18 +88,23 @@ if (!empty($_POST['ok'])) {
     // Send email to the new user
     // Send email to the new user
     if ((empty($_SESSION['error_msg'])) && (!empty($v_notify))) {
     if ((empty($_SESSION['error_msg'])) && (!empty($v_notify))) {
         $to = $_POST['v_notify'];
         $to = $_POST['v_notify'];
-        $subject = _("Welcome to Hestia Control Panel"); //currently not supported to use the account language
+        // send email in "users" language 
+        putenv("LANGUAGE=".$_POST['v_language']);
+        
+        $subject = _("Welcome to Hestia Control Panel");
         $hostname = exec('hostname');
         $hostname = exec('hostname');
         unset($output);
         unset($output);
-        $from = sprintf(_('MAIL_FROM'),$hostname); //currently not supported to use the account language
+        $from = sprintf(_('MAIL_FROM'),$hostname); /
 
 
         if (!empty($_POST['v_name'])) {
         if (!empty($_POST['v_name'])) {
             $mailtext = sprintf(_('GREETINGS_GORDON'),$_POST['v_name'])."\r\n";
             $mailtext = sprintf(_('GREETINGS_GORDON'),$_POST['v_name'])."\r\n";
         } else {
         } else {
             $mailtext = _('GREETINGS')."\r\n";
             $mailtext = _('GREETINGS')."\r\n";
         }
         }
+        
         $mailtext .= sprintf(_('ACCOUNT_READY'),$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']);
         $mailtext .= sprintf(_('ACCOUNT_READY'),$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']);
         send_email($to, $subject, $mailtext, $from);
         send_email($to, $subject, $mailtext, $from);
+        putenv("LANGUAGE=".detect_user_language());
     }
     }
 
 
     // Flush field values on success
     // Flush field values on success