mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 07:56:18 +02:00
feat(invitations): add server translate message for send invitations
This commit is contained in:
@@ -1498,6 +1498,8 @@
|
||||
USER_IS_NOT_AUTHORIZED: 'User is not authorized',
|
||||
SENDING_ACTIVE_MAIL_SUCCESSFULLY: 'Welcome join <strong>{{site}}</strong>, We`ve sent you an email to <strong>{{mail}}</strong>, please check you mail box and click the active url to verify you mail address and active you account in <strong>{{hours}}</strong> hours, thanks!',
|
||||
ACTIVE_MAIL_RENDER_ERROR: 'The authentication mail render error',
|
||||
INVITE_MAIL_RENDER_FAILED: 'The invitation mail render error',
|
||||
DELETE_EXPIRED_OFFICIAL_INVITATION_OK: 'Delete all expired official invitation successfully',
|
||||
SENDING_ACTIVE_MAIL_FAILED: 'The authentication mail send failed',
|
||||
SCORE_NOT_ENOUGH: 'you don`t have enough score for this operation',
|
||||
ALREADY_THUMBS_UP: 'you already thumbs up it',
|
||||
@@ -1516,10 +1518,13 @@
|
||||
CAN_NOT_DOWNLOAD_BANNED: 'Download failed, you are banned from server',
|
||||
CAN_NOT_DOWNLOAD_IDLE: 'Download failed, you are idle for long time, before download any things, you should active you account again in profile menu "account status"!',
|
||||
ALREADY_FOLLOWING: 'You have already following {{name}}',
|
||||
INVALID_OBJECTID: 'Invalid object id',
|
||||
INVALID_OBJECTID: 'Invalid object id (SERVER)',
|
||||
REQUEST_STATUS_FINISHED: 'Status error! Request already finished.',
|
||||
REQUEST_STATUS_EXPIRED: 'Status error! Request already expired.',
|
||||
TORRENT_STATUS_ERROR: 'Status error! Torrent status is not reviewed'
|
||||
TORRENT_STATUS_ERROR: 'Status error! Torrent status is not reviewed',
|
||||
EMAIL_ALREADY_REGISTERED: 'This mail address has been used by other user',
|
||||
EMAIL_ALREADY_INVITED: 'This mail address has been invited',
|
||||
INVITE_MAIL_SEND_FAILED: 'Invitation mail send failed (SERVER)'
|
||||
},
|
||||
|
||||
//server message string, content string support markdown and emoji
|
||||
|
||||
@@ -1498,6 +1498,8 @@
|
||||
USER_IS_NOT_AUTHORIZED: '用户身份验证未通过',
|
||||
SENDING_ACTIVE_MAIL_SUCCESSFULLY: '欢迎加入 <strong>{{site}}</strong>, 我们已向你的邮箱 <strong>{{mail}}</strong> 发送了一封电子邮件, 请在 <strong>{{hours}}</strong> 小时内检查您的邮箱并点击邮件中的链接地址来验证您的邮箱地址并激您的帐号,谢谢!',
|
||||
ACTIVE_MAIL_RENDER_ERROR: '验证与激活邮件渲染失败',
|
||||
INVITE_MAIL_RENDER_FAILED: '邀请邮件渲染失败',
|
||||
DELETE_EXPIRED_OFFICIAL_INVITATION_OK: '删除所有已过期的官方邀请成功',
|
||||
SENDING_ACTIVE_MAIL_FAILED: '验证与激活邮件发送失败',
|
||||
SCORE_NOT_ENOUGH: '您没有足够的积分进行此操作',
|
||||
ALREADY_THUMBS_UP: '您已经赞过啦~',
|
||||
@@ -1516,10 +1518,13 @@
|
||||
CAN_NOT_DOWNLOAD_BANNED: '下载失败, 您被服务器禁止(banned)',
|
||||
CAN_NOT_DOWNLOAD_IDLE: '下载失败,您闲置了太长时间,在您下载任何种子前, 您必须进入帐户状态页再次激活您的帐户!',
|
||||
ALREADY_FOLLOWING: '您已经关注过 {{name}} 了',
|
||||
INVALID_OBJECTID: '无效的数据记录ID',
|
||||
INVALID_OBJECTID: '无效的数据记录ID (SERVER)',
|
||||
REQUEST_STATUS_FINISHED: '状态错误! 求种请求已完成.',
|
||||
REQUEST_STATUS_EXPIRED: '状态错误! 求种请求已过期.',
|
||||
TORRENT_STATUS_ERROR: '状态错误! 种子状态为未审核'
|
||||
TORRENT_STATUS_ERROR: '状态错误! 种子状态为未审核',
|
||||
EMAIL_ALREADY_REGISTERED: '这个邮件地址已被其它用户注册使用了',
|
||||
EMAIL_ALREADY_INVITED: '这个邮件地址已经被邀请过了',
|
||||
INVITE_MAIL_SEND_FAILED: '邀请邮件发送失败(SERVER)'
|
||||
},
|
||||
|
||||
//server message string, content string support markdown and emoji
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
mtDebug.info(res);
|
||||
NotifycationService.showSuccessNotify('ADMIN_INVITATION_SUCCESSFULLY');
|
||||
}, function (res) {
|
||||
NotifycationService.showErrorNotify(res.data.message, 'EXCHANGE_INVITATION_ERROR');
|
||||
NotifycationService.showErrorNotify(res.data.message, 'ADMIN_INVITATION_ERROR');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -198,9 +198,9 @@ exports.update = function (req, res) {
|
||||
return res.status(422).send(err);
|
||||
} else {
|
||||
if (results[0] > 0) {
|
||||
return res.status(422).send({message: 'EMAIL_ALREADY_REGISTERED'});
|
||||
return res.status(422).send({message: 'SERVER.EMAIL_ALREADY_REGISTERED'});
|
||||
} else if (results[1] > 0) {
|
||||
return res.status(422).send({message: 'EMAIL_ALREADY_EXIST'});
|
||||
return res.status(422).send({message: 'SERVER.EMAIL_ALREADY_INVITED'});
|
||||
} else {
|
||||
//send invitation mail
|
||||
res.render(path.resolve('modules/invitations/server/templates/invite-sign-up-email'), {
|
||||
@@ -211,7 +211,7 @@ exports.update = function (req, res) {
|
||||
hours: config.meanTorrentConfig.invite.expires / (60 * 60 * 1000)
|
||||
}, function (err, emailHTML) {
|
||||
if (err) {
|
||||
return res.status(422).send({message: 'INVITE_MAIL_RENDER_FAILED'});
|
||||
return res.status(422).send({message: 'SERVER.INVITE_MAIL_RENDER_FAILED'});
|
||||
} else {
|
||||
var mailOptions = {
|
||||
to: req.query.to_email,
|
||||
@@ -221,7 +221,7 @@ exports.update = function (req, res) {
|
||||
};
|
||||
smtpTransport.sendMail(mailOptions, function (err) {
|
||||
if (err) {
|
||||
return res.status(422).send({message: 'INVITE_MAIL_SEND_FAILED'});
|
||||
return res.status(422).send({message: 'SERVER.INVITE_MAIL_SEND_FAILED'});
|
||||
} else {
|
||||
invitation.to_email = req.query.to_email;
|
||||
invitation.status = 1;
|
||||
@@ -288,9 +288,9 @@ exports.sendOfficial = function (req, res) {
|
||||
return res.status(422).send(err);
|
||||
} else {
|
||||
if (results[0] > 0) {
|
||||
return res.status(422).send({message: 'EMAIL_ALREADY_REGISTERED'});
|
||||
return res.status(422).send({message: 'SERVER.EMAIL_ALREADY_REGISTERED'});
|
||||
} else if (results[1] > 0) {
|
||||
return res.status(422).send({message: 'EMAIL_ALREADY_EXIST'});
|
||||
return res.status(422).send({message: 'SERVER.EMAIL_ALREADY_INVITED'});
|
||||
} else {
|
||||
//write invitation data
|
||||
var invitation = new Invitation();
|
||||
@@ -311,7 +311,7 @@ exports.sendOfficial = function (req, res) {
|
||||
hours: config.meanTorrentConfig.invite.expires / (60 * 60 * 1000)
|
||||
}, function (err, emailHTML) {
|
||||
if (err) {
|
||||
return res.status(422).send({message: 'INVITE_MAIL_RENDER_FAILED'});
|
||||
return res.status(422).send({message: 'SERVER.INVITE_MAIL_RENDER_FAILED'});
|
||||
} else {
|
||||
var mailOptions = {
|
||||
to: req.body.email,
|
||||
@@ -321,7 +321,7 @@ exports.sendOfficial = function (req, res) {
|
||||
};
|
||||
smtpTransport.sendMail(mailOptions, function (err) {
|
||||
if (err) {
|
||||
return res.status(422).send({message: 'INVITE_MAIL_SEND_FAILED'});
|
||||
return res.status(422).send({message: 'SERVER.INVITE_MAIL_SEND_FAILED'});
|
||||
} else {
|
||||
//save invitation data
|
||||
invitation.save(function (err) {
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
"gulp-uglify": "~3.0.0",
|
||||
"helmet": "~3.8.1",
|
||||
"imagemin-pngquant": "~5.0.0",
|
||||
"inbox": "^1.1.59",
|
||||
"irc": "^0.5.2",
|
||||
"jasmine-core": "~2.7.0",
|
||||
"lodash": "~4.17.4",
|
||||
|
||||
Reference in New Issue
Block a user