-
Email
+
@@ -314,13 +314,13 @@ class User
$id = $this->id;
if ($_POST['password']!=$_POST['password_repeat'])
{
- $message = "Passwords do not match!";
+ $message = _("Passwords do not match!");
}else{
if (!$token)
{
if ($_SESSION['user']!=$id)
{
- $message = "Cannot change password of other users!";
+ $message = _("Cannot change password of other users!");
}else{
$stmt = $mysqli->prepare("SELECT password_salt as salt FROM users WHERE id=?");
$stmt->bind_param("i", $id);
@@ -346,7 +346,7 @@ class User
User::logout();
}
else{
- $message = "Wrong password!";
+ $message = _("Wrong password!");
}
}
}else{
@@ -368,7 +368,7 @@ class User
}
else
{
- $message = "Invalid token detected, please retry your request from start!";
+ $message = _("Invalid token detected, please retry your request from start!");
}
Token::delete($token);
@@ -394,8 +394,8 @@ class User
$link = WEB_URL."/admin/?do=lost-password&id=$id&token=$token";
$to = $email;
$user = new User($id);
- $subject = 'Reset password - '.NAME;
- $msg = 'Hi '.$user->get_name()."!
Below you will find link to change your password. The link is valid for 24hrs. If you didn't request this, feel free to ignore it.
RESET PASSWORDIf the link doesn't work, copy & paste it into your browser:
$link";
+ $subject = _('Reset password')' - '.NAME;
+ $msg = sprintf(_( "Hi %s!
Below you will find link to change your password. The link is valid for 24hrs. If you didn't request this, feel free to ignore it.
RESET PASSWORDIf the link doesn't work, copy & paste it into your browser:
%s"), $user->get_name(), $link, $link);
$headers = "Content-Type: text/html; charset=utf-8 ".PHP_EOL;
$headers .= "MIME-Version: 1.0 ".PHP_EOL;
$headers .= "From: ".MAILER_NAME.' <'.MAILER_ADDRESS.'>'.PHP_EOL;
@@ -415,8 +415,8 @@ class User
$link = WEB_URL."/admin/?do=change-email&id=$id&token=$token";
$to = $email;
- $subject = 'Email change - '.NAME;
- $msg = 'Hi '.$this->get_name()."!
Below you will find link to finish changing your email. The link is valid for 24hrs. If you didn't request this, feel free to ignore it.
CHANGE EMAILIf the link doesn't work, copy & paste it into your browser:
$link";
+ $subject = _('Email change').' - '.NAME;
+ $msg = sprintf(_( "Hi %s!
Below you will find link to change your email. The link is valid for 24hrs. If you didn't request this, feel free to ignore it.
RESET PASSWORDIf the link doesn't work, copy & paste it into your browser:
%s"), $user->get_name(), $link, $link);
$headers = "Content-Type: text/html; charset=utf-8 ".PHP_EOL;
$headers .= "MIME-Version: 1.0 ".PHP_EOL;
$headers .= "From: ".MAILER_NAME.' <'.MAILER_ADDRESS.'>'.PHP_EOL;
@@ -448,7 +448,7 @@ class User
}
else
{
- $message = "Invalid token detected, please retry your request from start!";
+ $message = _("Invalid token detected, please retry your request from start!");
}
Token::delete($token);
@@ -480,7 +480,7 @@ class User
header("Location: /admin/?do=user&id=".$id);
}
else{
- $message = "You don't have permission to do that!";
+ $message = _("You don't have permission to do that!");
}
}
}
diff --git a/config.php.template b/config.php.template
index 72c8874..7a32cc9 100644
--- a/config.php.template
+++ b/config.php.template
@@ -18,9 +18,9 @@ if ($mysqli->connect_errno) {
$mysqli->set_charset("utf8");
//This should later be translatable, maybe find a better solution?
-$statuses = array("Major outage", "Minor outage", "Planned maintenance", "Operational" );
+$statuses = array(_("Major outage"), _("Minor outage"), _("Planned maintenance"), _("Operational") );
$classes = array("danger", "warning", "primary", "success" );
$icons = array("fa fa-times", "fa fa-exclamation", "fa fa-info", "fa fa-check" );
-$some = array("Some systems are experiencing major outages", "Some systems are experiencing minor outages", "Some systems are under maintenance");
-$all = array("Our systems are experiencing major outages.", "Our systems are experiencing minor outages", "Our systems are under maintenance", "All systems operational");
-$permissions = array("Super admin", "Admin", "Writer");
\ No newline at end of file
+$some = array(_("Some systems are experiencing major outages"), _("Some systems are experiencing minor outages"), _("Some systems are under maintenance"));
+$all = array(_("Our systems are experiencing major outages."), _("Our systems are experiencing minor outages"), _("Our systems are under maintenance"), _("All systems operational"));
+$permissions = array(_("Super admin"), _("Admin"), _("Writer"));
\ No newline at end of file
diff --git a/header.php b/header.php
index d868c86..b70a3fc 100644
--- a/header.php
+++ b/header.php
@@ -25,7 +25,7 @@ function render_header($page_name, $admin = false){