diff --git a/android/app/src/main/assets/public/blah/en-cat.json b/android/app/src/main/assets/public/blah/en-cat.json index 79250c19..581ba1b5 100644 --- a/android/app/src/main/assets/public/blah/en-cat.json +++ b/android/app/src/main/assets/public/blah/en-cat.json @@ -1,5 +1,6 @@ { "user.not.found": "meowser not found :c", + "dm.already.exists": "direct meowchat already exists :3", "cant.invite.urself": "you can't invite yourself, silly :3", "user.already.invited": "you have already invited this user meow", "user.invited": "user invited successfully :3", @@ -9,6 +10,13 @@ "dm.accepted": "direct meowchat accepted", "no.invite.found": "you can't create a dm without invitation *hiss*", "unknown.error": "unknown error :o", + "forbidden": "you do not have pawmission to perform this action *hiss*", + "dm.key.too.large": "meowchat key too large :o", + "dm.key.not.found": "meowchat key not found :c", + "dm.key.updated": "meowchat key updated successfully :3", + "body.too.large": "request body too large ><", + "invite.revoked": "invite revoked successfully", + "invite.declined": "invite declined successfully", "account.creation.request.expired": "cat creation request expired. try again", "invalid.username": "invalid cat name: {0}", "invalid.password": "invalid meow word: {0}", @@ -73,6 +81,24 @@ "title.all": "all", "title.unread": "unread", + "desc.no.invites": "no invites found :c", + "desc.no.notifications": "no notifications found :c", + "desc.fetching.invites": "fetching invites...", + "desc.fetching.notifications": "fetching notifications...", + "desc.invite.dm.received": "{0} ({1}) invited you to meowchat", + "desc.invite.dm.sent": "you invited {0} ({1}) to meowchat", + "desc.invite.group.received": "{0} ({1}) invited you to a clowder", + "desc.invite.group.sent": "you invited {0} ({1}) to a clowder", + + "action.fetching.invites.sent": "fetching sent invites...", + "action.fetching.invites.recv": "fetching received invites...", + "action.dm.fetch": "fetching direct meowchats...", + "action.auth": "authenticating...", + "action.dm.adding": "adding...", + "action.invite.revoking": "revoking invite...", + "action.invite.accepting": "accepting invite...", + "action.invite.declining": "declining invite...", + "title.sign.up": "sign up", "title.sign.in": "sign in", "title.sign.in.to": "sign in to your larpix instance", diff --git a/android/app/src/main/assets/public/blah/en-us.json b/android/app/src/main/assets/public/blah/en-us.json index 056f4a5e..d5d1df94 100644 --- a/android/app/src/main/assets/public/blah/en-us.json +++ b/android/app/src/main/assets/public/blah/en-us.json @@ -1,5 +1,6 @@ { "user.not.found": "User not found", + "dm.already.exists": "Direct message already exists", "cant.invite.urself": "You can't invite yourself", "user.already.invited": "You have already invited this user", "user.invited": "User invited successfully", @@ -9,6 +10,13 @@ "dm.accepted": "DM accepted", "no.invite.found": "You can't create a dm without invitation", "unknown.error": "Unknown error", + "forbidden": "You do not have permission to perform this action", + "dm.key.too.large": "DM key too large", + "dm.key.not.found": "DM key not found", + "dm.key.updated": "DM key updated successfully", + "body.too.large": "Request body too large", + "invite.revoked": "Invite revoked successfully", + "invite.declined": "Invite declined successfully", "account.creation.request.expired": "Account creation request expired. Try again", "invalid.username": "Invalid username: {0}", "invalid.password": "Invalid password: {0}", diff --git a/android/app/src/main/assets/public/main.js b/android/app/src/main/assets/public/main.js index e15f77bd..72f3ea8f 100644 --- a/android/app/src/main/assets/public/main.js +++ b/android/app/src/main/assets/public/main.js @@ -824,48 +824,52 @@ function splitLimit(str, separator, limit) { } function processBlah(blahmessage) { + let prepended = false; try { if (!blahmessage.includes(":")) { blahmessage = `:${blahmessage}`; + prepended = true; } let split = splitLimit(blahmessage, ":", 3); let values = []; try { - values = split[2].split(";"); + if (split[2]) { + values = split[2].split(";"); + } } catch (e) { } let message = blah[split[1]]; + if (message === undefined) throw new Error(); let valueslist = ""; for (let i = 0; i < values.length; i++) { let value = processBlah(values[i]); - if (value.startsWith(":")) - { - value = value.substring(1); - } - valueslist+=`${value}, `; - message = message.replaceAll(`{${i}}`, value); } - valueslist = valueslist.slice(0, -2); + if (values.length > 0) { + valueslist = valueslist.slice(0, -2); + } if (message.includes('{all}')) { - message = message.replaceAll('{all}', valueslist); } return message; } catch (e) { + if (prepended) { + return blahmessage.substring(1); + } return blahmessage; } } function getLang() { return (navigator.language || navigator.languages[0]); + //return "en-cat"; } var id = ""; diff --git a/webroot/blah/en-cat.json b/webroot/blah/en-cat.json index 79250c19..581ba1b5 100644 --- a/webroot/blah/en-cat.json +++ b/webroot/blah/en-cat.json @@ -1,5 +1,6 @@ { "user.not.found": "meowser not found :c", + "dm.already.exists": "direct meowchat already exists :3", "cant.invite.urself": "you can't invite yourself, silly :3", "user.already.invited": "you have already invited this user meow", "user.invited": "user invited successfully :3", @@ -9,6 +10,13 @@ "dm.accepted": "direct meowchat accepted", "no.invite.found": "you can't create a dm without invitation *hiss*", "unknown.error": "unknown error :o", + "forbidden": "you do not have pawmission to perform this action *hiss*", + "dm.key.too.large": "meowchat key too large :o", + "dm.key.not.found": "meowchat key not found :c", + "dm.key.updated": "meowchat key updated successfully :3", + "body.too.large": "request body too large ><", + "invite.revoked": "invite revoked successfully", + "invite.declined": "invite declined successfully", "account.creation.request.expired": "cat creation request expired. try again", "invalid.username": "invalid cat name: {0}", "invalid.password": "invalid meow word: {0}", @@ -73,6 +81,24 @@ "title.all": "all", "title.unread": "unread", + "desc.no.invites": "no invites found :c", + "desc.no.notifications": "no notifications found :c", + "desc.fetching.invites": "fetching invites...", + "desc.fetching.notifications": "fetching notifications...", + "desc.invite.dm.received": "{0} ({1}) invited you to meowchat", + "desc.invite.dm.sent": "you invited {0} ({1}) to meowchat", + "desc.invite.group.received": "{0} ({1}) invited you to a clowder", + "desc.invite.group.sent": "you invited {0} ({1}) to a clowder", + + "action.fetching.invites.sent": "fetching sent invites...", + "action.fetching.invites.recv": "fetching received invites...", + "action.dm.fetch": "fetching direct meowchats...", + "action.auth": "authenticating...", + "action.dm.adding": "adding...", + "action.invite.revoking": "revoking invite...", + "action.invite.accepting": "accepting invite...", + "action.invite.declining": "declining invite...", + "title.sign.up": "sign up", "title.sign.in": "sign in", "title.sign.in.to": "sign in to your larpix instance", diff --git a/webroot/blah/en-us.json b/webroot/blah/en-us.json index 056f4a5e..d5d1df94 100644 --- a/webroot/blah/en-us.json +++ b/webroot/blah/en-us.json @@ -1,5 +1,6 @@ { "user.not.found": "User not found", + "dm.already.exists": "Direct message already exists", "cant.invite.urself": "You can't invite yourself", "user.already.invited": "You have already invited this user", "user.invited": "User invited successfully", @@ -9,6 +10,13 @@ "dm.accepted": "DM accepted", "no.invite.found": "You can't create a dm without invitation", "unknown.error": "Unknown error", + "forbidden": "You do not have permission to perform this action", + "dm.key.too.large": "DM key too large", + "dm.key.not.found": "DM key not found", + "dm.key.updated": "DM key updated successfully", + "body.too.large": "Request body too large", + "invite.revoked": "Invite revoked successfully", + "invite.declined": "Invite declined successfully", "account.creation.request.expired": "Account creation request expired. Try again", "invalid.username": "Invalid username: {0}", "invalid.password": "Invalid password: {0}", diff --git a/webroot/main.js b/webroot/main.js index e15f77bd..72f3ea8f 100644 --- a/webroot/main.js +++ b/webroot/main.js @@ -824,48 +824,52 @@ function splitLimit(str, separator, limit) { } function processBlah(blahmessage) { + let prepended = false; try { if (!blahmessage.includes(":")) { blahmessage = `:${blahmessage}`; + prepended = true; } let split = splitLimit(blahmessage, ":", 3); let values = []; try { - values = split[2].split(";"); + if (split[2]) { + values = split[2].split(";"); + } } catch (e) { } let message = blah[split[1]]; + if (message === undefined) throw new Error(); let valueslist = ""; for (let i = 0; i < values.length; i++) { let value = processBlah(values[i]); - if (value.startsWith(":")) - { - value = value.substring(1); - } - valueslist+=`${value}, `; - message = message.replaceAll(`{${i}}`, value); } - valueslist = valueslist.slice(0, -2); + if (values.length > 0) { + valueslist = valueslist.slice(0, -2); + } if (message.includes('{all}')) { - message = message.replaceAll('{all}', valueslist); } return message; } catch (e) { + if (prepended) { + return blahmessage.substring(1); + } return blahmessage; } } function getLang() { return (navigator.language || navigator.languages[0]); + //return "en-cat"; } var id = "";