From e86459ebf29f9754de77b91fa4ca28ff957f9238 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 4 Jan 2021 01:38:43 -0800 Subject: [PATCH] Added multi-language support for user notifications. --- meshuser.js | 80 ++++---- translate/translate.json | 394 ++++++++++++++++++++++++++++++--------- views/default.handlebars | 51 ++++- 3 files changed, 398 insertions(+), 127 deletions(-) diff --git a/meshuser.js b/meshuser.js index 26197e42..bcff2ca1 100644 --- a/meshuser.js +++ b/meshuser.js @@ -488,7 +488,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use const lastLoginTime = parent.users[user._id].pastlogin; if (lastLoginTime != null) { db.GetFailedLoginCount(user.name, user.domain, new Date(lastLoginTime * 1000), function (count) { - if (count > 0) { try { ws.send(JSON.stringify({ action: 'msg', type: 'notify', title: "Security Warning", tag: 'ServerNotify', id: Math.random(), value: "There has been " + count + " failed login attempts on this account since the last login." })); } catch (ex) { } delete user.pastlogin; } + if (count > 0) { try { ws.send(JSON.stringify({ action: 'msg', type: 'notify', title: "Security Warning", tag: 'ServerNotify', id: Math.random(), value: "There has been " + count + " failed login attempts on this account since the last login.", titleid: 3, msgid: 12, args: [count] })); } catch (ex) { } delete user.pastlogin; } }); } @@ -1540,7 +1540,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use db.GetUserWithVerifiedEmail(domain.id, command.email, function (err, docs) { if ((docs != null) && (docs.length > 0)) { // Notify the duplicate email error - try { ws.send(JSON.stringify({ action: 'msg', type: 'notify', title: 'Account Settings', id: Math.random(), tag: 'ServerNotify', value: 'Failed to change email address, another account already using: ' + command.email + '.' })); } catch (ex) { } + try { ws.send(JSON.stringify({ action: 'msg', type: 'notify', title: 'Account Settings', id: Math.random(), tag: 'ServerNotify', value: 'Failed to change email address, another account already using: ' + command.email + '.', titleid: 4, msgid: 13, args: [command.email] })); } catch (ex) { } } else { // Update the user's email var oldemail = user.email; @@ -1815,7 +1815,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use // Account count exceed, do notification // Create the notification message - var notification = { action: 'msg', type: 'notify', id: Math.random(), value: "Account limit reached.", title: "Server Limit", userid: user._id, username: user.name, domain: domain.id }; + var notification = { action: 'msg', type: 'notify', id: Math.random(), value: "Account limit reached.", title: "Server Limit", userid: user._id, username: user.name, domain: domain.id, titleid: 2, msgid: 10 }; // Get the list of sessions for this user var sessions = parent.wssessions[user._id]; @@ -1870,36 +1870,36 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (command.randomPassword === true) { command.pass = getRandomPassword(); } // Add a new user account - var err = null, newusername, newuserid, newuserdomain; + var err = null, errid = 0, newusername, newuserid, newuserdomain; try { - if ((user.siteadmin & 2) == 0) { err = 'Permission denied'; } - else if (common.validateUsername(command.username, 1, 256) == false) { err = 'Invalid username'; } // Username is between 1 and 64 characters, no spaces - else if ((command.username[0] == '~') || (command.username.indexOf('/') >= 0)) { err = 'Invalid username'; } // Usernames cant' start with ~ and can't have '/' - else if (common.validateString(command.pass, 1, 256) == false) { err = 'Invalid password'; } // Password is between 1 and 256 characters - else if ((command.randomPassword !== true) && (common.checkPasswordRequirements(command.pass, domain.passwordrequirements) == false)) { err = 'Invalid password'; } // Password does not meet requirements - else if ((command.email != null) && (common.validateEmail(command.email, 1, 1024) == false)) { err = 'Invalid email'; } // Check if this is a valid email address - else if ((obj.crossDomain === true) && (command.domain != null) && ((typeof command.domain != 'string') || (parent.parent.config.domains[command.domain] == null))) { err = 'Invalid domain'; } // Check if this is a valid domain + if ((user.siteadmin & 2) == 0) { err = "Permission denied"; errid = 1; } + else if (common.validateUsername(command.username, 1, 256) == false) { err = "Invalid username"; errid = 2; } // Username is between 1 and 64 characters, no spaces + else if ((command.username[0] == '~') || (command.username.indexOf('/') >= 0)) { err = "Invalid username"; errid = 2; } // Usernames cant' start with ~ and can't have '/' + else if (common.validateString(command.pass, 1, 256) == false) { err = "Invalid password"; errid = 3; } // Password is between 1 and 256 characters + else if ((command.randomPassword !== true) && (common.checkPasswordRequirements(command.pass, domain.passwordrequirements) == false)) { err = "Invalid password"; errid = 3; } // Password does not meet requirements + else if ((command.email != null) && (common.validateEmail(command.email, 1, 1024) == false)) { err = "Invalid email"; errid = 4; } // Check if this is a valid email address + else if ((obj.crossDomain === true) && (command.domain != null) && ((typeof command.domain != 'string') || (parent.parent.config.domains[command.domain] == null))) { err = "Invalid domain"; errid = 5; } // Check if this is a valid domain else { newuserdomain = domain; if ((obj.crossDomain === true) && (command.domain != null)) { newuserdomain = parent.parent.config.domains[command.domain]; } newusername = command.username; newuserid = 'user/' + newuserdomain.id + '/' + command.username.toLowerCase(); if (command.siteadmin != null) { - if ((typeof command.siteadmin != 'number') || (Number.isInteger(command.siteadmin) == false)) { err = 'Invalid site permissions'; } // Check permissions - else if ((user.siteadmin != SITERIGHT_ADMIN) && ((command.siteadmin & (SITERIGHT_ADMIN - 224)) != 0)) { err = 'Invalid site permissions'; } + if ((typeof command.siteadmin != 'number') || (Number.isInteger(command.siteadmin) == false)) { err = "Invalid site permissions"; errid = 6; } // Check permissions + else if ((user.siteadmin != SITERIGHT_ADMIN) && ((command.siteadmin & (SITERIGHT_ADMIN - 224)) != 0)) { err = "Invalid site permissions"; errid = 6; } } - if (parent.users[newuserid]) { err = 'User already exists'; } // Account already exists - else if ((newuserdomain.auth == 'sspi') || (newuserdomain.auth == 'ldap')) { err = 'Unable to add user in this mode'; } + if (parent.users[newuserid]) { err = "User already exists"; errid = 7; } // Account already exists + else if ((newuserdomain.auth == 'sspi') || (newuserdomain.auth == 'ldap')) { err = "Unable to add user in this mode"; errid = 8; } } - } catch (ex) { err = 'Validation exception'; } + } catch (ex) { err = "Validation exception"; errid = 9; } // Handle any errors if (err != null) { if (command.responseid != null) { - try { ws.send(JSON.stringify({ action: 'adduser', responseid: command.responseid, result: err })); } catch (ex) { } + try { ws.send(JSON.stringify({ action: 'adduser', responseid: command.responseid, result: err, msgid: errid })); } catch (ex) { } } else { // Send error back, user not found. - displayNotificationMessage(err, 'New Account', 'ServerNotify'); + displayNotificationMessage(err, "New Account", 'ServerNotify', null, 1, errid); } break; } @@ -1913,7 +1913,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use try { ws.send(JSON.stringify({ action: 'adduser', responseid: command.responseid, result: 'maxUsersExceed' })); } catch (ex) { } } else { // Create the notification message - var notification = { action: 'msg', type: 'notify', id: Math.random(), value: "Account limit reached.", title: "Server Limit", userid: user._id, username: user.name, domain: newuserdomain.id }; + var notification = { action: 'msg', type: 'notify', id: Math.random(), value: "Account limit reached.", title: "Server Limit", userid: user._id, username: user.name, domain: newuserdomain.id, titleid: 2, msgid: 10 }; // Get the list of sessions for this user var sessions = parent.wssessions[user._id]; @@ -2420,7 +2420,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (unknownUsers.length > 0) { // Send error back, user not found. - displayNotificationMessage('User' + ((unknownUsers.length > 1) ? 's' : '') + ' ' + EscapeHtml(unknownUsers.join(', ')) + ' not found.', 'Device Group', 'ServerNotify'); + displayNotificationMessage('User' + ((unknownUsers.length > 1) ? 's' : '') + ' ' + EscapeHtml(unknownUsers.join(', ')) + ' not found.', "Device Group", 'ServerNotify', 5, (unknownUsers.length > 1) ? 16 : 15, [EscapeHtml(unknownUsers.join(', '))]); } } @@ -2553,16 +2553,16 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use parent.checkOldUserPasswords(domain, user, command.newpass, function (result) { if (result == 1) { // Send user notification of error - displayNotificationMessage('Error, unable to change to previously used password.', 'Account Settings', 'ServerNotify'); + displayNotificationMessage("Error, unable to change to previously used password.", "Account Settings", 'ServerNotify', 4, 17); } else if (result == 2) { // Send user notification of error - displayNotificationMessage('Error, unable to change to commonly used password.', 'Account Settings', 'ServerNotify'); + displayNotificationMessage("Error, unable to change to commonly used password.", "Account Settings", 'ServerNotify', 4, 18); } else { // Update the password require('./pass').hash(command.newpass, function (err, salt, hash, tag) { if (err) { // Send user notification of error - displayNotificationMessage('Error, password not changed.', 'Account Settings', 'ServerNotify'); + displayNotificationMessage("Error, password not changed.", "Account Settings", 'ServerNotify', 4, 19); } else { const nowSeconds = Math.floor(Date.now() / 1000); @@ -2592,7 +2592,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use parent.parent.DispatchEvent(targets, obj, event); // Send user notification of password change - displayNotificationMessage('Password changed.', 'Account Settings', 'ServerNotify'); + displayNotificationMessage("Password changed.", "Account Settings", 'ServerNotify', 4, 20); // Log in the auth log if (parent.parent.authlog) { parent.parent.authLog('https', 'User ' + user.name + ' changed this password'); } @@ -2602,7 +2602,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use }); } else { // Send user notification of error - displayNotificationMessage('Current password not correct.', 'Account Settings', 'ServerNotify'); + displayNotificationMessage("Current password not correct.", "Account Settings", 'ServerNotify', 4, 21); } }); break; @@ -2699,7 +2699,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use // Create the notification message var notification = { - 'action': 'msg', 'type': 'notify', id: Math.random(), 'value': "Chat Request, Click here to accept.", 'title': user.name, 'userid': user._id, 'username': user.name, 'tag': 'meshmessenger/' + encodeURIComponent(command.userid) + '/' + encodeURIComponent(user._id) + 'action': 'msg', 'type': 'notify', id: Math.random(), 'value': "Chat Request, Click here to accept.", 'title': user.name, 'userid': user._id, 'username': user.name, 'tag': 'meshmessenger/' + encodeURIComponent(command.userid) + '/' + encodeURIComponent(user._id), msgid: 11 }; // Get the list of sessions for this user @@ -2977,7 +2977,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use } if (dup != null) { // A duplicate was found, don't allow this change. - displayNotificationMessage('Error, invite code \"' + dup + '\" already in use.', 'Invite Codes'); + displayNotificationMessage("Error, invite code \"" + dup + "\" already in use.", "Invite Codes", null, 6, 22, [ dup ]); return; } mesh.invite = { codes: command.invite.codes, flags: command.invite.flags }; @@ -3123,7 +3123,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (unknownUsers.length > 0) { // Send error back, user not found. - displayNotificationMessage('User' + ((unknownUsers.length > 1) ? 's' : '') + ' ' + EscapeHtml(unknownUsers.join(', ')) + ' not found.', 'Device Group', 'ServerNotify'); + displayNotificationMessage('User' + ((unknownUsers.length > 1) ? 's' : '') + ' ' + EscapeHtml(unknownUsers.join(', ')) + ' not found.', "Device Group", 'ServerNotify', 5, (unknownUsers.length > 1) ? 16 : 15, [EscapeHtml(unknownUsers.join(', '))]); } if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'addmeshuser', responseid: command.responseid, result: msgs.join(', '), success: successCount, failed: failCount })); } catch (ex) { } } @@ -4489,24 +4489,24 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use break; } case 'smsuser': { // Send a SMS message to a user - var errMsg = null, smsuser = null; - if (parent.parent.smsserver == null) { errMsg = 'SMS gateway not enabled'; } - else if ((user.siteadmin & 2) == 0) { errMsg = 'No user management rights'; } - else if (common.validateString(command.userid, 1, 2048) == false) { errMsg = 'Invalid userid'; } - else if (common.validateString(command.msg, 1, 160) == false) { errMsg = 'Invalid SMS message'; } + var errMsg = null, errId = 0, smsuser = null; + if (parent.parent.smsserver == null) { errMsg = "SMS gateway not enabled"; errId = 23; } + else if ((user.siteadmin & 2) == 0) { errMsg = "No user management rights"; errId = 24; } + else if (common.validateString(command.userid, 1, 2048) == false) { errMsg = "Invalid username"; errId = 2; } + else if (common.validateString(command.msg, 1, 160) == false) { errMsg = "Invalid SMS message"; errId = 25; } else { smsuser = parent.users[command.userid]; - if (smsuser == null) { errMsg = 'Invalid userid'; } - else if (smsuser.phone == null) { errMsg = 'No phone number for this user'; } + if (smsuser == null) { errMsg = "Invalid username"; errId = 2; } + else if (smsuser.phone == null) { errMsg = "No phone number for this user"; errId = 26; } } if (errMsg != null) { displayNotificationMessage(errMsg); break; } parent.parent.smsserver.sendSMS(smsuser.phone, command.msg, function (success, msg) { if (success) { - displayNotificationMessage('SMS succesfuly sent.'); + displayNotificationMessage("SMS succesfuly sent.", null, null, null, 27); } else { - if (typeof msg == 'string') { displayNotificationMessage('SMS error: ' + msg); } else { displayNotificationMessage('SMS error'); } + if (typeof msg == 'string') { displayNotificationMessage("SMS error: " + msg, null, null, null, 29, [msg]); } else { displayNotificationMessage("SMS error", null, null, null, 28); } } }); break; @@ -4527,7 +4527,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (errMsg != null) { displayNotificationMessage(errMsg); break; } parent.parent.mailserver.sendMail(emailuser.email, command.subject, command.msg); - displayNotificationMessage("Email sent."); + displayNotificationMessage("Email sent.", null, null, null, 14); break; } case 'getClip': { @@ -5105,7 +5105,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use } // Display a notification message for this session only. - function displayNotificationMessage(msg, title, tag) { ws.send(JSON.stringify({ 'action': 'msg', 'type': 'notify', id: Math.random(), 'value': msg, 'title': title, 'userid': user._id, 'username': user.name, 'tag': tag })); } + function displayNotificationMessage(msg, title, tag, titleid, msgid, args) { + ws.send(JSON.stringify({ 'action': 'msg', 'type': 'notify', id: Math.random(), 'value': msg, 'title': title, 'userid': user._id, 'username': user.name, 'tag': tag, 'titleid': titleid, 'msgid': msgid, 'args': args })); + } // Read the folder and all sub-folders and serialize that into json. function readFilesRec(path) { diff --git a/translate/translate.json b/translate/translate.json index 8ae89a81..13eff6f0 100644 --- a/translate/translate.json +++ b/translate/translate.json @@ -2775,11 +2775,18 @@ "default-mobile.handlebars->container->page_content->column_l->p3->p3info->1->p3AccountActions->p2AccountSecurity->1->0", "default.handlebars->29->1298", "default.handlebars->29->1300", - "default.handlebars->29->2149", + "default.handlebars->29->2184", "default.handlebars->29->540", "default.handlebars->29->542" ] }, + { + "en": "Account Settings", + "fr": "Paramètres du compte", + "xloc": [ + "default.handlebars->29->2082" + ] + }, { "cs": "Ověření účtu", "de": "Bestätigung des Kontos", @@ -2919,6 +2926,7 @@ "zh-chs": "达到帐户限制。", "zh-cht": "達到帳戶限制。", "xloc": [ + "default.handlebars->29->2094", "login-mobile.handlebars->5->6", "login.handlebars->5->6", "login2.handlebars->7->7" @@ -4356,7 +4364,7 @@ "zh-chs": "代理错误计数器", "zh-cht": "代理錯誤計數器", "xloc": [ - "default.handlebars->29->2084" + "default.handlebars->29->2119" ] }, { @@ -4459,7 +4467,7 @@ "zh-chs": "代理时段", "zh-cht": "代理時段", "xloc": [ - "default.handlebars->29->2100" + "default.handlebars->29->2135" ] }, { @@ -4644,7 +4652,7 @@ "zh-chs": "代理", "zh-cht": "代理", "xloc": [ - "default.handlebars->29->2116" + "default.handlebars->29->2151" ] }, { @@ -5664,7 +5672,7 @@ "zh-chs": "您确定要{0}插件吗:{1}", "zh-cht": "你確定要{0}外掛嗎:{1}", "xloc": [ - "default.handlebars->29->2158" + "default.handlebars->29->2193" ] }, { @@ -5995,7 +6003,7 @@ "zh-chs": "可用內存", "zh-cht": "可用內存", "xloc": [ - "default.handlebars->29->2109" + "default.handlebars->29->2144" ] }, { @@ -6239,7 +6247,7 @@ "zh-chs": "错误的签名", "zh-cht": "錯誤的簽名", "xloc": [ - "default.handlebars->29->2091" + "default.handlebars->29->2126" ] }, { @@ -6259,7 +6267,7 @@ "zh-chs": "错误的网络证书", "zh-cht": "錯誤的網絡憑證", "xloc": [ - "default.handlebars->29->2090" + "default.handlebars->29->2125" ] }, { @@ -6626,7 +6634,7 @@ "zh-chs": "CIRA服务器", "zh-cht": "CIRA伺服器", "xloc": [ - "default.handlebars->29->2144" + "default.handlebars->29->2179" ] }, { @@ -6646,7 +6654,7 @@ "zh-chs": "CIRA服务器命令", "zh-cht": "CIRA伺服器指令", "xloc": [ - "default.handlebars->29->2145" + "default.handlebars->29->2180" ] }, { @@ -6707,7 +6715,7 @@ "zh-chs": "CPU负载", "zh-cht": "CPU負載", "xloc": [ - "default.handlebars->29->2105" + "default.handlebars->29->2140" ] }, { @@ -6727,7 +6735,7 @@ "zh-chs": "最近15分钟的CPU负载", "zh-cht": "最近15分鐘的CPU負載", "xloc": [ - "default.handlebars->29->2108" + "default.handlebars->29->2143" ] }, { @@ -6747,7 +6755,7 @@ "zh-chs": "最近5分钟的CPU负载", "zh-cht": "最近5分鐘的CPU負載", "xloc": [ - "default.handlebars->29->2107" + "default.handlebars->29->2142" ] }, { @@ -6767,7 +6775,7 @@ "zh-chs": "最近一分钟的CPU负载", "zh-cht": "最近一分鐘的CPU負載", "xloc": [ - "default.handlebars->29->2106" + "default.handlebars->29->2141" ] }, { @@ -6874,7 +6882,7 @@ "zh-chs": "呼叫错误", "zh-cht": "呼叫錯誤", "xloc": [ - "default.handlebars->29->2159" + "default.handlebars->29->2194" ] }, { @@ -7428,6 +7436,13 @@ "default.handlebars->29->1515" ] }, + { + "en": "Chat Request, Click here to accept.", + "fr": "Demande de chat, cliquez ici pour accepter.", + "xloc": [ + "default.handlebars->29->2095" + ] + }, { "cs": "ChatSession", "de": "ChatSession", @@ -7566,7 +7581,7 @@ "zh-cht": "檢查...", "xloc": [ "default.handlebars->29->1067", - "default.handlebars->29->2153" + "default.handlebars->29->2188" ] }, { @@ -9234,7 +9249,7 @@ "zh-chs": "已连接的英特尔®AMT", "zh-cht": "已連接的Intel® AMT", "xloc": [ - "default.handlebars->29->2096" + "default.handlebars->29->2131" ] }, { @@ -9254,7 +9269,7 @@ "zh-chs": "已连接的用户", "zh-cht": "已连接的用户", "xloc": [ - "default.handlebars->29->2101" + "default.handlebars->29->2136" ] }, { @@ -9345,7 +9360,7 @@ "zh-chs": "连接数量", "zh-cht": "連接數量", "xloc": [ - "default.handlebars->29->2115" + "default.handlebars->29->2150" ] }, { @@ -9365,7 +9380,7 @@ "zh-chs": "连接转发器", "zh-cht": "連接轉發器", "xloc": [ - "default.handlebars->29->2143" + "default.handlebars->29->2178" ] }, { @@ -9515,7 +9530,7 @@ "zh-chs": "Cookie编码器", "zh-cht": "Cookie編碼器", "xloc": [ - "default.handlebars->29->2129" + "default.handlebars->29->2164" ] }, { @@ -9922,7 +9937,7 @@ "zh-chs": "核心服务器", "zh-cht": "核心伺服器", "xloc": [ - "default.handlebars->29->2128" + "default.handlebars->29->2163" ] }, { @@ -10534,6 +10549,13 @@ "default.handlebars->29->110" ] }, + { + "en": "Current password not correct.", + "fr": "Le mot de passe actuel n'est pas correct.", + "xloc": [ + "default.handlebars->29->2105" + ] + }, { "cs": "Vyjmout", "de": "Ausschneiden", @@ -11752,7 +11774,8 @@ "default.handlebars->29->1895", "default.handlebars->29->1901", "default.handlebars->29->2013", - "default.handlebars->29->2064" + "default.handlebars->29->2064", + "default.handlebars->29->2083" ] }, { @@ -11798,7 +11821,7 @@ "default.handlebars->29->1842", "default.handlebars->29->1882", "default.handlebars->29->1953", - "default.handlebars->29->2099", + "default.handlebars->29->2134", "default.handlebars->container->column_l->p2->p2info->7" ] }, @@ -13523,7 +13546,7 @@ "zh-chs": "代理重复", "zh-cht": "代理重複", "xloc": [ - "default.handlebars->29->2095" + "default.handlebars->29->2130" ] }, { @@ -14627,6 +14650,7 @@ "zh-chs": "电邮已发送。", "zh-cht": "電郵已發送。", "xloc": [ + "default.handlebars->29->2098", "login-mobile.handlebars->5->2", "login.handlebars->5->2", "login2.handlebars->7->3" @@ -14691,7 +14715,7 @@ "zh-chs": "电邮/短信流量", "zh-cht": "電郵/短信流量", "xloc": [ - "default.handlebars->29->2137" + "default.handlebars->29->2172" ] }, { @@ -15405,6 +15429,34 @@ "default.handlebars->29->150" ] }, + { + "en": "Error, invite code \\\"{0}\\\" already in use.", + "fr": "Erreur, code d'invitation \\\"{0}\\\" déjà utilisé.", + "xloc": [ + "default.handlebars->29->2106" + ] + }, + { + "en": "Error, password not changed.", + "fr": "Erreur, mot de passe non modifié.", + "xloc": [ + "default.handlebars->29->2103" + ] + }, + { + "en": "Error, unable to change to commonly used password.", + "fr": "Erreur, impossible de changer le mot de passe couramment utilisé.", + "xloc": [ + "default.handlebars->29->2102" + ] + }, + { + "en": "Error, unable to change to previously used password.", + "fr": "Erreur, impossible de changer le mot de passe précédemment utilisé.", + "xloc": [ + "default.handlebars->29->2101" + ] + }, { "cs": "Chyba: nebyl zadán klíč pro připojení.", "de": "Fehler: Kein Verbindungsschlüssel angegeben.", @@ -15732,7 +15784,7 @@ "zh-chs": "外部", "zh-cht": "外部", "xloc": [ - "default.handlebars->29->2122" + "default.handlebars->29->2157" ] }, { @@ -15815,6 +15867,13 @@ "default.handlebars->29->67" ] }, + { + "en": "Failed to change email address, another account already using: {0}.", + "fr": "Échec de la modification de l'adresse e-mail, un autre compte utilise déjà: {0}.", + "xloc": [ + "default.handlebars->29->2097" + ] + }, { "cs": "Vzdálenou plochu se nepodařilo spustit po odmítnutí místním uživatelem", "de": "Fehler beim Starten des Remotedesktops, nachdem der lokale Benutzer abgelehnt wurde", @@ -16563,8 +16622,8 @@ "zh-chs": "自由", "zh-cht": "自由", "xloc": [ - "default.handlebars->29->2080", - "default.handlebars->29->2082" + "default.handlebars->29->2115", + "default.handlebars->29->2117" ] }, { @@ -17879,7 +17938,7 @@ "zh-chs": "堆总数", "zh-cht": "堆總數", "xloc": [ - "default.handlebars->29->2124" + "default.handlebars->29->2159" ] }, { @@ -17899,7 +17958,7 @@ "zh-chs": "堆使用", "zh-cht": "堆使用", "xloc": [ - "default.handlebars->29->2123" + "default.handlebars->29->2158" ] }, { @@ -19069,7 +19128,7 @@ "zh-chs": "英特尔AMT", "zh-cht": "英特爾AMT", "xloc": [ - "default.handlebars->29->2120" + "default.handlebars->29->2155" ] }, { @@ -19117,7 +19176,7 @@ "default.handlebars->29->1380", "default.handlebars->29->1551", "default.handlebars->29->1559", - "default.handlebars->29->2142", + "default.handlebars->29->2177", "default.handlebars->29->526", "default.handlebars->29->584", "default.handlebars->29->611" @@ -19987,7 +20046,7 @@ "zh-chs": "无效的设备组类型", "zh-cht": "無效的裝置群類型", "xloc": [ - "default.handlebars->29->2094" + "default.handlebars->29->2129" ] }, { @@ -20007,7 +20066,7 @@ "zh-chs": "无效的JSON", "zh-cht": "無效的JSON", "xloc": [ - "default.handlebars->29->2088" + "default.handlebars->29->2123" ] }, { @@ -20068,7 +20127,7 @@ "zh-chs": "无效的PKCS签名", "zh-cht": "無效的PKCS簽名", "xloc": [ - "default.handlebars->29->2086" + "default.handlebars->29->2121" ] }, { @@ -20088,7 +20147,14 @@ "zh-chs": "無效的RSA密碼", "zh-cht": "無效的RSA密碼", "xloc": [ - "default.handlebars->29->2087" + "default.handlebars->29->2122" + ] + }, + { + "en": "Invalid SMS message", + "fr": "Message SMS non valide", + "xloc": [ + "default.handlebars->29->2109" ] }, { @@ -20113,6 +20179,20 @@ "login2.handlebars->7->9" ] }, + { + "en": "Invalid domain", + "fr": "Domaine non valide", + "xloc": [ + "default.handlebars->29->2089" + ] + }, + { + "en": "Invalid email", + "fr": "Email invalide", + "xloc": [ + "default.handlebars->29->2088" + ] + }, { "cs": "Neplatný e-mail.", "de": "Ungültige E-Mail.", @@ -20176,6 +20256,20 @@ "invite.handlebars->3->1" ] }, + { + "en": "Invalid password", + "fr": "Mot de passe incorrect", + "xloc": [ + "default.handlebars->29->2087" + ] + }, + { + "en": "Invalid site permissions", + "fr": "Autorisations de site non valides", + "xloc": [ + "default.handlebars->29->2090" + ] + }, { "cs": "Neplatný token, zkuste to znovu.", "de": "Ungültiges Token, versuchen Sie es erneut.", @@ -20198,6 +20292,13 @@ "login2.handlebars->7->14" ] }, + { + "en": "Invalid username", + "fr": "Nom d'utilisateur invalide", + "xloc": [ + "default.handlebars->29->2086" + ] + }, { "cs": "Zrušení platnosti e-mailu", "de": "E-Mail ungültig machen", @@ -20358,7 +20459,8 @@ "default.handlebars->29->1531", "default.handlebars->29->1536", "default.handlebars->29->1538", - "default.handlebars->29->1543" + "default.handlebars->29->1543", + "default.handlebars->29->2084" ] }, { @@ -21591,7 +21693,7 @@ "zh-chs": "减", "zh-cht": "減", "xloc": [ - "default.handlebars->29->2161" + "default.handlebars->29->2196" ] }, { @@ -23099,6 +23201,7 @@ }, { "en": "MacOS Installer", + "fr": "Installateur MacOS", "xloc": [ "default.handlebars->29->807" ] @@ -23120,7 +23223,7 @@ "zh-chs": "主服务器信息", "zh-cht": "主伺服器訊息", "xloc": [ - "default.handlebars->29->2131" + "default.handlebars->29->2166" ] }, { @@ -23630,7 +23733,7 @@ "zh-chs": "达到连接数量上限", "zh-cht": "達到連接數量上限", "xloc": [ - "default.handlebars->29->2092" + "default.handlebars->29->2127" ] }, { @@ -23695,7 +23798,7 @@ "zh-chs": "Megabyte", "zh-cht": "Megabyte", "xloc": [ - "default.handlebars->29->2121" + "default.handlebars->29->2156" ] }, { @@ -23717,7 +23820,7 @@ "xloc": [ "default-mobile.handlebars->9->396", "default.handlebars->29->1021", - "default.handlebars->29->2112", + "default.handlebars->29->2147", "default.handlebars->container->column_l->p40->3->1->p40type->3" ] }, @@ -23916,7 +24019,7 @@ "zh-chs": "MeshAgent流量", "zh-cht": "MeshAgent流量", "xloc": [ - "default.handlebars->29->2133" + "default.handlebars->29->2168" ] }, { @@ -23936,7 +24039,7 @@ "zh-chs": "MeshAgent更新", "zh-cht": "MeshAgent更新", "xloc": [ - "default.handlebars->29->2134" + "default.handlebars->29->2169" ] }, { @@ -24057,7 +24160,7 @@ "zh-chs": "MeshCentral服务器同级化", "zh-cht": "MeshCentral伺服器同級化", "xloc": [ - "default.handlebars->29->2132" + "default.handlebars->29->2167" ] }, { @@ -24436,7 +24539,7 @@ "zh-chs": "消息调度器", "zh-cht": "電郵調度器", "xloc": [ - "default.handlebars->29->2130" + "default.handlebars->29->2165" ] }, { @@ -24619,7 +24722,7 @@ "zh-chs": "更多", "zh-cht": "更多", "xloc": [ - "default.handlebars->29->2160" + "default.handlebars->29->2195" ] }, { @@ -25383,6 +25486,13 @@ "default.handlebars->29->1698" ] }, + { + "en": "New Account", + "fr": "Nouveau compte", + "xloc": [ + "default.handlebars->29->2079" + ] + }, { "cs": "Nový účet…", "de": "Neues Konto...", @@ -26410,6 +26520,13 @@ "default.handlebars->29->798" ] }, + { + "en": "No phone number for this user", + "fr": "Aucun numéro de téléphone pour cet utilisateur", + "xloc": [ + "default.handlebars->29->2110" + ] + }, { "cs": "Žádné zásuvné moduly na serveru.", "de": "Keine Plugins auf dem Server.", @@ -26490,6 +26607,13 @@ "default.handlebars->29->2020" ] }, + { + "en": "No user management rights", + "fr": "Aucun droit de gestion des utilisateurs", + "xloc": [ + "default.handlebars->29->2108" + ] + }, { "cs": "Nenalezeni žádní uživatelé.", "de": "Keine Benutzer gefunden.", @@ -28018,6 +28142,13 @@ "login2.handlebars->7->19" ] }, + { + "en": "Password changed.", + "fr": "Mot de passe changé.", + "xloc": [ + "default.handlebars->29->2104" + ] + }, { "cs": "Heslo pro účet {0} bylo obnoveno na:", "de": "Das Passwort für Konto {0} wurde zurückgesetzt auf:", @@ -28472,6 +28603,13 @@ "default.handlebars->29->1631" ] }, + { + "en": "Permission denied", + "fr": "Permission refusée", + "xloc": [ + "default.handlebars->29->2085" + ] + }, { "cs": "Práva", "de": "Berechtigungen", @@ -28759,7 +28897,7 @@ "zh-cht": "外掛指令", "xloc": [ "default.handlebars->29->201", - "default.handlebars->29->2157" + "default.handlebars->29->2192" ] }, { @@ -29804,7 +29942,7 @@ "zh-chs": "RSS", "zh-cht": "RSS", "xloc": [ - "default.handlebars->29->2125" + "default.handlebars->29->2160" ] }, { @@ -30219,7 +30357,7 @@ "zh-chs": "中继数量", "zh-cht": "中繼數量", "xloc": [ - "default.handlebars->29->2104" + "default.handlebars->29->2139" ] }, { @@ -30239,7 +30377,7 @@ "zh-chs": "中继错误", "zh-cht": "中繼錯誤", "xloc": [ - "default.handlebars->29->2097" + "default.handlebars->29->2132" ] }, { @@ -30259,8 +30397,8 @@ "zh-chs": "中继连接", "zh-cht": "中繼連接", "xloc": [ - "default.handlebars->29->2103", - "default.handlebars->29->2119" + "default.handlebars->29->2138", + "default.handlebars->29->2154" ] }, { @@ -32353,6 +32491,7 @@ }, { "en": "SCP", + "fr": "SCP", "xloc": [ "default.handlebars->29->647" ] @@ -32403,6 +32542,27 @@ "default.handlebars->29->1988" ] }, + { + "en": "SMS error", + "fr": "Erreur SMS", + "xloc": [ + "default.handlebars->29->2112" + ] + }, + { + "en": "SMS error: {0}", + "fr": "Erreur SMS: {0}", + "xloc": [ + "default.handlebars->29->2113" + ] + }, + { + "en": "SMS gateway not enabled", + "fr": "Passerelle SMS non activée", + "xloc": [ + "default.handlebars->29->2107" + ] + }, { "cs": "SMS odeslána.", "de": "SMS gesendet.", @@ -32425,8 +32585,16 @@ "login2.handlebars->7->5" ] }, + { + "en": "SMS succesfuly sent.", + "fr": "SMS envoyé avec succès.", + "xloc": [ + "default.handlebars->29->2111" + ] + }, { "en": "SSH", + "fr": "SSH", "xloc": [ "default.handlebars->29->645" ] @@ -32983,6 +33151,13 @@ "default.handlebars->29->1969" ] }, + { + "en": "Security Warning", + "fr": "Avertissement de sécurité", + "xloc": [ + "default.handlebars->29->2081" + ] + }, { "cs": "Hledám", "de": "Ich suche", @@ -33689,7 +33864,7 @@ "zh-chs": "服务器证书", "zh-cht": "伺服器憑證", "xloc": [ - "default.handlebars->29->2135" + "default.handlebars->29->2170" ] }, { @@ -33709,7 +33884,7 @@ "zh-chs": "服务器数据库", "zh-cht": "伺服器數據庫", "xloc": [ - "default.handlebars->29->2136" + "default.handlebars->29->2171" ] }, { @@ -33758,6 +33933,13 @@ "agent-translations.json" ] }, + { + "en": "Server Limit", + "fr": "Limite du serveur", + "xloc": [ + "default.handlebars->29->2080" + ] + }, { "cs": "Oprávnění serveru", "de": "Server-Berechtigungen", @@ -33856,7 +34038,7 @@ "zh-chs": "服务器状态", "zh-cht": "伺服器狀態", "xloc": [ - "default.handlebars->29->2083" + "default.handlebars->29->2118" ] }, { @@ -33896,7 +34078,7 @@ "zh-chs": "服务器跟踪", "zh-cht": "伺服器追蹤", "xloc": [ - "default.handlebars->29->2146" + "default.handlebars->29->2181" ] }, { @@ -34122,7 +34304,7 @@ "zh-chs": "ServerStats.csv", "zh-cht": "ServerStats.csv", "xloc": [ - "default.handlebars->29->2127" + "default.handlebars->29->2162" ] }, { @@ -37727,6 +37909,13 @@ "default.handlebars->29->2075" ] }, + { + "en": "There has been {0} failed login attempts on this account since the last login.", + "fr": "Il y a eu {0} tentatives de connexion infructueuses sur ce compte depuis la dernière connexion.", + "xloc": [ + "default.handlebars->29->2096" + ] + }, { "cs": "Tyto soubory jsou veřejné, kliknutím na „odkaz“ získáte veřejnou url adresu.", "de": "Diese Dateien werden öffentlich geteilt, klicken Sie auf \"Link\", um die öffentliche URL zu erhalten.", @@ -39260,10 +39449,17 @@ "zh-cht": "在啟用兩因素身份驗證之前,無法訪問此功能。這是額外的安全性所必需的。轉到“我的帳戶”標籤,然後查看“帳戶安全性”部分。", "xloc": [ "default.handlebars->29->1301", - "default.handlebars->29->2150", + "default.handlebars->29->2185", "default.handlebars->29->543" ] }, + { + "en": "Unable to add user in this mode", + "fr": "Impossible d'ajouter un utilisateur dans ce mode", + "xloc": [ + "default.handlebars->29->2092" + ] + }, { "cs": "Nedaří se připojit k web socketu", "de": "Web-Socket kann nicht verbunden werden", @@ -39532,7 +39728,7 @@ "zh-chs": "未知动作", "zh-cht": "未知動作", "xloc": [ - "default.handlebars->29->2089" + "default.handlebars->29->2124" ] }, { @@ -39575,7 +39771,7 @@ "xloc": [ "default.handlebars->29->1893", "default.handlebars->29->2011", - "default.handlebars->29->2093" + "default.handlebars->29->2128" ] }, { @@ -39595,7 +39791,7 @@ "zh-chs": "未知群组", "zh-cht": "未知群組", "xloc": [ - "default.handlebars->29->2085" + "default.handlebars->29->2120" ] }, { @@ -39783,7 +39979,7 @@ "zh-chs": "最新", "zh-cht": "最新", "xloc": [ - "default.handlebars->29->2155" + "default.handlebars->29->2190" ] }, { @@ -40201,8 +40397,8 @@ "zh-chs": "用过的", "zh-cht": "用過的", "xloc": [ - "default.handlebars->29->2079", - "default.handlebars->29->2081" + "default.handlebars->29->2114", + "default.handlebars->29->2116" ] }, { @@ -40291,7 +40487,7 @@ "zh-chs": "用户帐户", "zh-cht": "用戶帳戶", "xloc": [ - "default.handlebars->29->2098" + "default.handlebars->29->2133" ] }, { @@ -40582,7 +40778,7 @@ "zh-chs": "用户节", "zh-cht": "用戶節", "xloc": [ - "default.handlebars->29->2118" + "default.handlebars->29->2153" ] }, { @@ -40669,6 +40865,13 @@ "desktop.handlebars->3->17" ] }, + { + "en": "User already exists", + "fr": "L'utilisateur existe déjà", + "xloc": [ + "default.handlebars->29->2091" + ] + }, { "cs": "Převzít z webového prohlížeče", "de": "Browsereinstellung des Benutzers", @@ -40775,6 +40978,13 @@ "terms.handlebars->container->topbar" ] }, + { + "en": "User {0} not found.", + "fr": "Utilisateur {0} introuvable.", + "xloc": [ + "default.handlebars->29->2099" + ] + }, { "cs": "Identif. uživatele", "de": "Benutzer-ID", @@ -40889,7 +41099,7 @@ "xloc": [ "default.handlebars->29->1841", "default.handlebars->29->1881", - "default.handlebars->29->2117", + "default.handlebars->29->2152", "default.handlebars->container->topbar->1->1->UsersSubMenuSpan->UsersSubMenu->1->0->UsersGeneral" ] }, @@ -40910,7 +41120,14 @@ "zh-chs": "用户会话", "zh-cht": "用戶節", "xloc": [ - "default.handlebars->29->2102" + "default.handlebars->29->2137" + ] + }, + { + "en": "Users {0} not found.", + "fr": "Utilisateurs {0} introuvables.", + "xloc": [ + "default.handlebars->29->2100" ] }, { @@ -40954,6 +41171,13 @@ "default.handlebars->29->1763" ] }, + { + "en": "Validation exception", + "fr": "Exception de validation", + "xloc": [ + "default.handlebars->29->2093" + ] + }, { "cs": "Doba platnosti", "de": "Gültigkeit", @@ -41207,7 +41431,7 @@ "zh-chs": "版本不兼容,请先升级您的MeshCentral", "zh-cht": "版本不兼容,請先升級你的MeshCentral", "xloc": [ - "default.handlebars->29->2151" + "default.handlebars->29->2186" ] }, { @@ -41309,8 +41533,8 @@ "zh-chs": "查看变更日志", "zh-cht": "查看變更日誌", "xloc": [ - "default.handlebars->29->2154", - "default.handlebars->29->2156" + "default.handlebars->29->2189", + "default.handlebars->29->2191" ] }, { @@ -41722,8 +41946,8 @@ "zh-chs": "网络服务器", "zh-cht": "網絡伺服器", "xloc": [ - "default.handlebars->29->2138", - "default.handlebars->29->2139" + "default.handlebars->29->2173", + "default.handlebars->29->2174" ] }, { @@ -41743,7 +41967,7 @@ "zh-chs": "Web服务器请求", "zh-cht": "Web伺服器請求", "xloc": [ - "default.handlebars->29->2140" + "default.handlebars->29->2175" ] }, { @@ -41763,7 +41987,7 @@ "zh-chs": "Web套接字中继", "zh-cht": "Web插座中繼", "xloc": [ - "default.handlebars->29->2141" + "default.handlebars->29->2176" ] }, { @@ -43254,7 +43478,7 @@ "zh-chs": "\\\\'", "zh-cht": "\\\\'", "xloc": [ - "default.handlebars->29->2152" + "default.handlebars->29->2187" ] }, { @@ -43682,8 +43906,8 @@ "zh-chs": "免费", "zh-cht": "免費", "xloc": [ - "default.handlebars->29->2110", - "default.handlebars->29->2113" + "default.handlebars->29->2145", + "default.handlebars->29->2148" ] }, { @@ -44351,7 +44575,7 @@ "zh-chs": "servertrace.csv", "zh-cht": "servertrace.csv", "xloc": [ - "default.handlebars->29->2148" + "default.handlebars->29->2183" ] }, { @@ -44417,7 +44641,7 @@ "zh-chs": "time, conn.agent, conn.users, conn.usersessions, conn.relaysession, conn.intelamt, mem.external, mem.heapused, mem.heaptotal, mem.rss", "zh-cht": "time, conn.agent, conn.users, conn.usersessions, conn.relaysession, conn.intelamt, mem.external, mem.heapused, mem.heaptotal, mem.rss", "xloc": [ - "default.handlebars->29->2126" + "default.handlebars->29->2161" ] }, { @@ -44437,7 +44661,7 @@ "zh-chs": "时间,来源,信息", "zh-cht": "時間,來源,訊息", "xloc": [ - "default.handlebars->29->2147" + "default.handlebars->29->2182" ] }, { @@ -44474,8 +44698,8 @@ "zh-chs": "总计", "zh-cht": "總", "xloc": [ - "default.handlebars->29->2111", - "default.handlebars->29->2114" + "default.handlebars->29->2146", + "default.handlebars->29->2149" ] }, { diff --git a/views/default.handlebars b/views/default.handlebars index fa56cdc5..5ec25e48 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2185,7 +2185,7 @@ else if (message.type == 'notify') { // This is a notification message. var n = getstore('notifications', 0); if (((n & 8) == 0) && (message.amtMessage != null)) { break; } // Intel AMT desktop & terminal messages should be ignored. - var n = { text: message.value, title: message.title, icon: message.icon }; + var n = { text: message.value, title: message.title, icon: message.icon, titleid: message.titleid, msgid: message.msgid, args: message.args }; if (message.id != null) { n.id = message.id; } if (message.nodeid != null) { n.nodeid = message.nodeid; } if (message.tag != null) { n.tag = message.tag; } @@ -2226,7 +2226,7 @@ } } else { if (message.type == 'notify') { // This is a notification message. - var n = { text: message.value, title: message.title, icon: message.icon }; + var n = { text: message.value, title: message.title, icon: message.icon, titleid: message.titleid, msgid: message.msgid, args: message.args }; if (message.id != null) { n.id = message.id; } if (message.tag != null) { n.tag = message.tag; } if (message.username != null) { n.username = message.username; } @@ -3027,7 +3027,7 @@ break; } case 'notify': { - var n = { text: message.event.value, title: message.event.title, icon: message.event.icon }; + var n = { text: message.event.value, title: message.event.title, icon: message.event.icon, titleid: message.titleid, msgid: message.msgid, args: message.args }; if (message.id != null) { n.id = message.id; } if (message.event.tag != null) { n.tag = message.event.tag; } if (typeof message.maxtime == 'number') { n.maxtime = message.maxtime; } @@ -13168,6 +13168,51 @@ // Add a new notification and play the notification sound function addNotification(n) { + // Perform message translation + var translatedTitles = [ + null, + "New Account", // 1 + "Server Limit", + "Security Warning", + "Account Settings", + "Device Group", + "Invite Codes" + ]; + var translatedMessages = [ + null, + "Permission denied", // 1 + "Invalid username", + "Invalid password", + "Invalid email", + "Invalid domain", + "Invalid site permissions", + "User already exists", + "Unable to add user in this mode", + "Validation exception", + "Account limit reached.", // 10 + "Chat Request, Click here to accept.", + "There has been {0} failed login attempts on this account since the last login.", + "Failed to change email address, another account already using: {0}.", + "Email sent.", + "User {0} not found.", + "Users {0} not found.", + "Error, unable to change to previously used password.", + "Error, unable to change to commonly used password.", + "Error, password not changed.", + "Password changed.", // 20 + "Current password not correct.", + "Error, invite code \"{0}\" already in use.", + "SMS gateway not enabled", + "No user management rights", + "Invalid SMS message", + "No phone number for this user", + "SMS succesfuly sent.", + "SMS error", + "SMS error: {0}" + ]; + if (typeof n.titleid == 'number') { try { n.title = translatedTitles[n.titleid]; } catch (ex) {} } + if (typeof n.msgid == 'number') { try { n.text = translatedMessages[n.msgid]; if (Array.isArray(n.args)) { format(n.text, ...n.args); } } catch (ex) {} } + // Show notification within the web page. if (n.time == null) { n.time = Date.now(); } if (n.id == null) { n.id = Math.random(); }