From 14d0081fdf19c9a7395771a6eb6ad73640c2078f Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 10 Apr 2014 12:47:48 -0400 Subject: [PATCH] replace 2 error messages with keys --- public/language/en_GB/error.json | 4 +++- public/src/app.js | 18 ++---------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/public/language/en_GB/error.json b/public/language/en_GB/error.json index 446bd43368..a504628984 100644 --- a/public/language/en_GB/error.json +++ b/public/language/en_GB/error.json @@ -63,5 +63,7 @@ "invalid-file": "Invalid File", "uploads-are-disabled": "Uploads are disabled", - "signature-too-long" : "Signature can't be longer than %1 characters!" + "signature-too-long" : "Signature can't be longer than %1 characters!", + + "cant-chat-with-yourself": "You can't chat with yourself!", } \ No newline at end of file diff --git a/public/src/app.js b/public/src/app.js index 86e6033c45..108635da2e 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -320,25 +320,11 @@ var socket, app.openChat = function (username, touid) { if (username === app.username) { - app.alert({ - type: 'warning', - title: 'Invalid Chat', - message: "You can't chat with yourself!", - timeout: 5000 - }); - - return; + return app.alertError('[[error:cant-chat-with-yourself]]'); } if (!app.uid) { - app.alert({ - type: 'danger', - title: 'Not Logged In', - message: 'Please log in to chat with ' + username + '', - timeout: 5000 - }); - - return; + return app.alertError('[[error:not-logged-in]]'); } require(['chat'], function (chat) {