diff --git a/public/language/en_GB/pages.json b/public/language/en_GB/pages.json index 6fe89c54bc..5af14abe5e 100644 --- a/public/language/en_GB/pages.json +++ b/public/language/en_GB/pages.json @@ -14,7 +14,6 @@ "notifications": "Notifications", "tags": "Tags", "tag": "Topics tagged under \"%1\"", - "chats": "Chats", "register": "Register an account", "login": "Login to your account", "reset": "Reset your account password", @@ -23,6 +22,9 @@ "groups": "Groups", "group": "%1 group", + "chats": "Chats", + "chat": "Chatting with %1", + "user.edit": "Editing \"%1\"", "user.following": "People %1 Follows", "user.followers": "People who Follow %1", diff --git a/src/meta/title.js b/src/meta/title.js index eb537f006a..8a100665b9 100644 --- a/src/meta/title.js +++ b/src/meta/title.js @@ -15,7 +15,8 @@ module.exports = function(Meta) { isTopic: /^topic\/\d+\/?/, isTag: /^tags\/[\s\S]+\/?/, isUserPage: /^user\/[^\/]+(\/[\w]+)?/, - isGroup: /^groups\/[\s\S]+\/?/ + isGroup: /^groups\/[\s\S]+\/?/, + isChat: /^chats\/[\s\S]+\/?/ }; Meta.title.build = function (urlFragment, language, callback) { @@ -100,6 +101,18 @@ module.exports = function(Meta) { onParsed(null, translated); }); }); + } else if (tests.isChat.test(urlFragment)) { + var userslug = urlFragment.match(/chats\/([\s\S]+)/)[1]; + + user.getUsernameByUserslug(userslug, function(err, username) { + if (err) { + return onParsed(err); + } + + translator.translate('[[pages:chat, ' + username + ']]', language, function(translated) { + onParsed(null, translated); + }); + }); } else if (tests.isUserPage.test(urlFragment)) { var matches = urlFragment.match(/user\/([^\/]+)\/?([\w]+)?/), userslug = matches[1],