Skip to content

Node.js based forum software built for the modern web

closes #1513

barisusakli8ee866fc9dfb
diff --git a/public/language/en_GB/modules.json b/public/language/en_GB/modules.json
index 8616bf0298..90ad8c6546 100644
--- a/public/language/en_GB/modules.json
+++ b/public/language/en_GB/modules.json
@@ -3,5 +3,6 @@
"chat.placeholder": "type chat message here, press enter to send",
"chat.send": "Send",
"chat.no_active": "You have no active chats.",
- "chat.user_typing": "%1 is typing ..."
+ "chat.user_typing": "%1 is typing ...",
+ "chat.user_has_messaged_you": "%1 has messaged you."
}
\ No newline at end of file
diff --git a/public/src/app.js b/public/src/app.js
index c0cc527544..edf22a0c50 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -385,16 +385,20 @@ var socket,
if (!titleObj.titles[0]) {
titleObj.titles[0] = window.document.title;
}
- titleObj.titles[1] = title;
- if (titleObj.interval) {
- clearInterval(titleObj.interval);
- }
- titleObj.interval = setInterval(function() {
- var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
- if (title) {
- window.document.title = title;
+
+ translator.translate(title, function(translated) {
+ titleObj.titles[1] = translated;
+ if (titleObj.interval) {
+ clearInterval(titleObj.interval);
}
- }, 2000);
+
+ titleObj.interval = setInterval(function() {
+ var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
+ if (title) {
+ window.document.title = title;
+ }
+ }, 2000);
+ });
} else {
if (titleObj.interval) {
clearInterval(titleObj.interval);
diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js
index 46024ed3b0..93c2c93f7a 100644
--- a/public/src/modules/chat.js
+++ b/public/src/modules/chat.js
@@ -72,13 +72,13 @@ define(['taskbar', 'string', 'sounds'], function(taskbar, S, sounds) {
}
if (!isSelf && (!modal.is(":visible") || !app.isFocused)) {
- app.alternatingTitle(username + ' has messaged you');
+ app.alternatingTitle('[[modules:chat.user_has_messaged_you, ' + username + ']]');
}
} else {
module.createModal(username, data.withUid, function(modal) {
module.toggleNew(modal.attr('UUID'), true);
if (!isSelf) {
- app.alternatingTitle(username + ' has messaged you');
+ app.alternatingTitle('[[modules:chat.user_has_messaged_you, ' + username + ']]');
}
});
}
@@ -91,6 +91,9 @@ define(['taskbar', 'string', 'sounds'], function(taskbar, S, sounds) {
socket.on('event:chats.userStartTyping', function(withUid) {
var modal = module.getModal(withUid);
var chatContent = modal.find('#chat-content');
+ if (!chatContent.length) {
+ return;
+ }
var atBottom = chatContent[0].scrollHeight - chatContent.scrollTop() === chatContent.innerHeight();
modal.find('.user-typing').removeClass('hide').appendTo(chatContent);