mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #7894, translate log in to view
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
"last_reply_time": "Last reply",
|
||||
"reply-as-topic": "Reply as topic",
|
||||
"guest-login-reply": "Log in to reply",
|
||||
"login-to-view": "🔒 Log in to view",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"purge": "Purge",
|
||||
|
||||
@@ -8,7 +8,8 @@ define('forum/topic/posts', [
|
||||
'forum/topic/images',
|
||||
'navigator',
|
||||
'components',
|
||||
], function (pagination, infinitescroll, postTools, images, navigator, components) {
|
||||
'translator',
|
||||
], function (pagination, infinitescroll, postTools, images, navigator, components, translator) {
|
||||
var Posts = { };
|
||||
|
||||
Posts.onNewPost = function (data) {
|
||||
@@ -309,8 +310,9 @@ define('forum/topic/posts', [
|
||||
var loginEl = document.createElement('a');
|
||||
loginEl.className = 'login-required';
|
||||
loginEl.href = config.relative_path + '/login';
|
||||
loginEl.appendChild(document.createTextNode('🔒 Log in to view'));
|
||||
|
||||
translator.translate('[[topic:login-to-view]]', function (translated) {
|
||||
loginEl.appendChild(document.createTextNode(translated));
|
||||
posts.each(function (idx, postEl) {
|
||||
$(postEl).find('[component="post/content"] img').each(function (idx, imgEl) {
|
||||
imgEl = $(imgEl);
|
||||
@@ -319,6 +321,7 @@ define('forum/topic/posts', [
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Posts.onNewPostsAddedToDom = function (posts) {
|
||||
|
||||
Reference in New Issue
Block a user