mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
closes #855 - app.alert strings are now passed through translator so we can finally start getting rid of the remainder of hardcoded strings
This commit is contained in:
@@ -38,5 +38,14 @@
|
|||||||
"motd.follow": "Follow",
|
"motd.follow": "Follow",
|
||||||
|
|
||||||
"previouspage": "Previous Page",
|
"previouspage": "Previous Page",
|
||||||
"nextpage": "Next Page"
|
"nextpage": "Next Page",
|
||||||
|
|
||||||
|
"alert.success": "Success",
|
||||||
|
"alert.error": "Error",
|
||||||
|
|
||||||
|
"alert.banned": "Banned",
|
||||||
|
"alert.banned.message": "You are banned you will be logged out!",
|
||||||
|
|
||||||
|
"alert.unfollow": "You are no longer following %1!",
|
||||||
|
"alert.follow": "You are now following %1!"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,8 +113,8 @@ var socket,
|
|||||||
|
|
||||||
socket.on('event:banned', function() {
|
socket.on('event:banned', function() {
|
||||||
app.alert({
|
app.alert({
|
||||||
title: 'Banned',
|
title: '[[global:alert.banned]]',
|
||||||
message: 'You are banned you will be logged out!',
|
message: '[[global:alert.banned.message]]',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
timeout: 1000
|
timeout: 1000
|
||||||
});
|
});
|
||||||
@@ -190,7 +190,10 @@ var socket,
|
|||||||
if (params.location == null)
|
if (params.location == null)
|
||||||
params.location = 'alert_window';
|
params.location = 'alert_window';
|
||||||
|
|
||||||
$('#' + params.location).prepend(div.fadeIn('100'));
|
translator.translate(div.html(), function(translatedHTML) {
|
||||||
|
div.html(translatedHTML);
|
||||||
|
$('#' + params.location).prepend(div.fadeIn('100'));
|
||||||
|
});
|
||||||
|
|
||||||
if (params.timeout) {
|
if (params.timeout) {
|
||||||
startTimeout(div, params.timeout);
|
startTimeout(div, params.timeout);
|
||||||
@@ -212,7 +215,7 @@ var socket,
|
|||||||
timeout = 2000;
|
timeout = 2000;
|
||||||
|
|
||||||
app.alert({
|
app.alert({
|
||||||
title: 'Success',
|
title: '[[global:alert.success]]',
|
||||||
message: message,
|
message: message,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
timeout: timeout
|
timeout: timeout
|
||||||
@@ -224,7 +227,7 @@ var socket,
|
|||||||
timeout = 2000;
|
timeout = 2000;
|
||||||
|
|
||||||
app.alert({
|
app.alert({
|
||||||
title: 'Error',
|
title: '[[global:alert.error]]',
|
||||||
message: message,
|
message: message,
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
timeout: timeout
|
timeout: timeout
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ define(['forum/accountheader'], function(header) {
|
|||||||
|
|
||||||
followBtn.addClass('hide');
|
followBtn.addClass('hide');
|
||||||
unfollowBtn.removeClass('hide');
|
unfollowBtn.removeClass('hide');
|
||||||
app.alertSuccess('You are now following ' + username + '!');
|
app.alertSuccess('[[global:alert.follow, ' + username + ']]');
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -59,7 +59,7 @@ define(['forum/accountheader'], function(header) {
|
|||||||
|
|
||||||
followBtn.removeClass('hide');
|
followBtn.removeClass('hide');
|
||||||
unfollowBtn.addClass('hide');
|
unfollowBtn.addClass('hide');
|
||||||
app.alertSuccess('You are no longer following ' + username + '!');
|
app.alertSuccess('[[global:alert.unfollow, ' + username + ']]');
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user