Skip to content

Node.js based forum software built for the modern web

replace 2 error messages with keys

barisusakli14d0081fdf19
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 <strong>' + username + '</strong>',
- timeout: 5000
- });
-
- return;
+ return app.alertError('[[error:not-logged-in]]');
}
require(['chat'], function (chat) {