Skip to content

Node.js based forum software built for the modern web

first pass, #981

Julian Lamb6e96541e7e5
diff --git a/public/language/en_GB/notifications.json b/public/language/en_GB/notifications.json
index a66ac79b89..6ea4bf837b 100644
--- a/public/language/en_GB/notifications.json
+++ b/public/language/en_GB/notifications.json
@@ -1,5 +1,8 @@
{
"title": "Notifications",
+ "no_notifs": "You have no notifications",
+ "see_all": "See all Notifications",
+
"back_to_home": "Back to NodeBB",
"outgoing_link": "Outgoing Link",
"outgoing_link_message": "You are now leaving",
diff --git a/public/language/en_GB/topic.json b/public/language/en_GB/topic.json
index e1d1651e0d..d398539a27 100644
--- a/public/language/en_GB/topic.json
+++ b/public/language/en_GB/topic.json
@@ -3,6 +3,7 @@
"topics": "Topics",
"no_topics_found": "No topics found!",
+ "no_posts_found": "No posts found!",
"profile": "Profile",
"posted_by": "Posted by",
@@ -20,15 +21,19 @@
"tools": "Tools",
"flag": "Flag",
- "flag_title":"Flag this post for moderation",
+ "flag_title": "Flag this post for moderation",
+ "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.",
"thread_tools.title": "Thread Tools",
"thread_tools.markAsUnreadForAll": "Mark Unread",
- "thread_tools.pin": "Pin Thread",
- "thread_tools.lock": "Lock Thread",
- "thread_tools.move": "Move Thread",
- "thread_tools.fork": "Fork Thread",
- "thread_tools.delete": "Delete Thread",
+ "thread_tools.pin": "Pin",
+ "thread_tools.unpin": "Unpin",
+ "thread_tools.lock": "Lock",
+ "thread_tools.unlock": "Unlock",
+ "thread_tools.move": "Move",
+ "thread_tools.fork": "Fork",
+ "thread_tools.delete": "Delete",
+ "thread_tools.restore": "Restore",
"load_categories": "Loading Categories",
"disabled_categories_note": "Disabled Categories are greyed out",
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index a869e6fd1a..91fde9d7b4 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -913,7 +913,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
x;
if (locked === true) {
- lockThreadEl.html('<i class="fa fa-unlock"></i> Unlock Thread');
+ translator.translate('<i class="fa fa-unlock"></i> [[topic:thread_tools.unlock]] [[topic:topic]]', function(translated) {
+ lockThreadEl.html(translated);
+ });
threadReplyBtn.attr('disabled', true);
threadReplyBtn.html('Locked <i class="fa fa-lock"></i>');
for (x = 0; x < numPosts; x++) {
@@ -935,7 +937,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
thread_state.locked = '1';
} else {
- lockThreadEl.html('<i class="fa fa-lock"></i> Lock Thread');
+ translator.translate('<i class="fa fa-lock"></i> [[topic:thread_tools.lock]] [[topic:topic]]', function(translated) {
+ lockThreadEl.html(translated);
+ });
threadReplyBtn.attr('disabled', false);
threadReplyBtn.html('Reply');
for (x = 0; x < numPosts; x++) {
@@ -967,7 +971,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
deleteNotice = document.getElementById('thread-deleted') || document.createElement('div');
if (deleted) {
- deleteTextEl.html('<i class="fa fa-comment"></i> Restore Thread');
+ translator.translate('<i class="fa fa-comment"></i> [[topic:thread_tools.restore]] [[topic:topic]]', function(translated) {
+ deleteTextEl.html(translated);
+ });
threadEl.addClass('deleted');
// Spawn a 'deleted' notice at the top of the page
@@ -978,7 +984,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
thread_state.deleted = '1';
} else {
- deleteTextEl.html('<i class="fa fa-trash-o"></i> Delete Thread');
+ translator.translate('<i class="fa fa-trash-o"></i> [[topic:thread_tools.delete]] [[topic:topic]]', function(translated) {
+ deleteTextEl.html(translated);
+ });
threadEl.removeClass('deleted');
deleteNotice.parentNode.removeChild(deleteNotice);
@@ -989,33 +997,35 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
function set_pinned_state(pinned, alert) {
var pinEl = $('.pin_thread');
- if (pinned) {
- pinEl.html('<i class="fa fa-thumb-tack"></i> Unpin Thread');
- if (alert) {
- app.alert({
- 'alert_id': 'thread_pin',
- type: 'success',
- title: 'Thread Pinned',
- message: 'Thread has been successfully pinned',
- timeout: 5000
- });
- }
+ translator.translate('<i class="fa fa-thumb-tack"></i> [[topic:thread_tools.' + (pinned ? 'unpin' : 'pin') + ']] [[topic:topic]]', function(translated) {
+ if (pinned) {
+ pinEl.html(translated);
+ if (alert) {
+ app.alert({
+ 'alert_id': 'thread_pin',
+ type: 'success',
+ title: 'Thread Pinned',
+ message: 'Thread has been successfully pinned',
+ timeout: 5000
+ });
+ }
- thread_state.pinned = '1';
- } else {
- pinEl.html('<i class="fa fa-thumb-tack"></i> Pin Thread');
- if (alert) {
- app.alert({
- 'alert_id': 'thread_pin',
- type: 'success',
- title: 'Thread Unpinned',
- message: 'Thread has been successfully unpinned',
- timeout: 5000
- });
- }
+ thread_state.pinned = '1';
+ } else {
+ pinEl.html(translated);
+ if (alert) {
+ app.alert({
+ 'alert_id': 'thread_pin',
+ type: 'success',
+ title: 'Thread Unpinned',
+ message: 'Thread has been successfully unpinned',
+ timeout: 5000
+ });
+ }
- thread_state.pinned = '0';
- }
+ thread_state.pinned = '0';
+ }
+ });
}
function toggle_post_delete_state(pid) {
diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js
index b209ac22c3..13485a47c6 100644
--- a/public/src/modules/notifications.js
+++ b/public/src/modules/notifications.js
@@ -29,10 +29,14 @@ define(function() {
}
} else {
- notifList.append($('<li class="no-notifs"><a>You have no notifications</a></li>'));
+ translator.translate('<li class="no-notifs"><a>[[notifications:no_notifs]]</a></li>', function(translated) {
+ notifList.append($(translated));
+ });
}
- notifList.append($('<li class="pagelink"><a href="' + RELATIVE_PATH + '/notifications">See all Notifications</a></li>'));
+ translator.translate('<li class="pagelink"><a href="' + RELATIVE_PATH + '/notifications">[[notifications:see_all]]</a></li>', function(translated) {
+ notifList.append($(translated));
+ });
updateNotifCount(data.unread.length);
diff --git a/public/templates/header.tpl b/public/templates/header.tpl
index 0ad5f97d90..694823c691 100644
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@ -174,7 +174,7 @@
<form id="search-form" class="navbar-form navbar-right" role="search" method="GET" action="">
<div class="hide" id="search-fields">
<div class="form-group">
- <input type="text" class="form-control" placeholder="Search" name="query" value="">
+ <input type="text" class="form-control" placeholder="[[global:search]]" name="query" value="">
</div>
<button type="submit" class="btn btn-default hide">[[global:search]]</button>
</div>
diff --git a/public/templates/search.tpl b/public/templates/search.tpl
index 1e0a0432cc..55a3b57443 100644
--- a/public/templates/search.tpl
+++ b/public/templates/search.tpl
@@ -1,15 +1,15 @@
<ol class="breadcrumb">
<li><a href="{relative_path}/">[[global:home]]</a></li>
- <li class="active">[[global:header.search]]</li>
+ <li class="active">[[global:search]]</li>
</ol>
<form id="mobile-search-form" class="navbar-form navbar-right visible-xs" role="search" method="GET" action="">
<div class="" id="search-fields">
<div class="form-group">
- <input type="text" class="form-control" placeholder="Search" name="query" value="">
+ <input type="text" class="form-control" placeholder="[[global:search]]" name="query" value="">
</div>
- <button type="submit" class="btn btn-default hide">[[global:header.search]]</button>
+ <button type="submit" class="btn btn-default hide">[[global:search]]</button>
</div>
</form>
@@ -57,12 +57,12 @@
</div>
<div id="post-results" class="col-md-12" data-search-query="{search_query}">
- <h3>Posts</h3>
+ <h3>[[topic:posts]]</h3>
<!-- IF post_matches -->
<small>{post_matches} result(s) matching "{search_query}"</small>
<!-- ENDIF post_matches -->
- <div class="alert alert-info {show_no_posts}">No posts found!</div>
+ <div class="alert alert-info {show_no_posts}">[[tropic:no_posts_found]]</div>
<!-- BEGIN posts -->
<div class="topic-row panel panel-default clearfix">
diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl
index c68438c48b..d56bac87d3 100644
--- a/public/templates/topic.tpl
+++ b/public/templates/topic.tpl
@@ -178,13 +178,13 @@
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">[[topic:thread_tools.title]] <span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<li><a href="#" class="markAsUnreadForAll"><i class="fa fa-inbox"></i> [[topic:thread_tools.markAsUnreadForAll]]</a></li>
- <li><a href="#" class="pin_thread"><i class="fa fa-thumb-tack"></i> [[topic:thread_tools.pin]]</a></li>
- <li><a href="#" class="lock_thread"><i class="fa fa-lock"></i> [[topic:thread_tools.lock]]</a></li>
+ <li><a href="#" class="pin_thread"><i class="fa fa-thumb-tack"></i> [[topic:thread_tools.pin]] [[topic:topic]]</a></li>
+ <li><a href="#" class="lock_thread"><i class="fa fa-lock"></i> [[topic:thread_tools.lock]] [[topic:topic]]</a></li>
<li class="divider"></li>
<li><a href="#" class="move_thread"><i class="fa fa-arrows"></i> [[topic:thread_tools.move]]</a></li>
<li><a href="#" class="fork_thread"><i class="fa fa-code-fork"></i> [[topic:thread_tools.fork]]</a></li>
<li class="divider"></li>
- <li><a href="#" class="delete_thread"><span class="text-error"><i class="fa fa-trash-o"></i> [[topic:thread_tools.delete]]</span></a></li>
+ <li><a href="#" class="delete_thread"><span class="text-error"><i class="fa fa-trash-o"></i> [[topic:thread_tools.delete]] [[topic:topic]]</span></a></li>
</ul>
</div>
</div>