Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 161dc0b

Browse files
committed
Add i18n
1 parent f9029cd commit 161dc0b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

β€Žsrc/TextForEvent.jsβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ function textForServerACLEvent(ev) {
207207

208208
let text = "";
209209
if (prev.deny.length === 0 && prev.allow.length === 0) {
210-
text = `${senderDisplayName} set server ACLs for this room. `;
210+
text = _t("%(senderDisplayName)s set the server ACLs for this room.", {senderDisplayName});
211211
} else {
212-
text = `${senderDisplayName} changed the server ACLs for this room. `;
212+
text = _t("%(senderDisplayName)s changed the server ACLs for this room.", {senderDisplayName});
213213
}
214214

215215
if (!Array.isArray(current.allow)) {
@@ -218,10 +218,10 @@ function textForServerACLEvent(ev) {
218218

219219
// If we know for sure everyone is banned, mark the room as obliterated
220220
if (current.allow.length === 0) {
221-
return text + "πŸŽ‰ All servers are banned from participating! This room can no longer be used.";
221+
return text + " " + _t("πŸŽ‰ All servers are banned from participating! This room can no longer be used.");
222222
}
223223

224-
return text.trim();
224+
return text;
225225
}
226226

227227
function textForMessageEvent(ev) {

β€Žsrc/i18n/strings/en_EN.jsonβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@
242242
"%(senderDisplayName)s enabled flair for %(groups)s in this room.": "%(senderDisplayName)s enabled flair for %(groups)s in this room.",
243243
"%(senderDisplayName)s disabled flair for %(groups)s in this room.": "%(senderDisplayName)s disabled flair for %(groups)s in this room.",
244244
"%(senderDisplayName)s enabled flair for %(newGroups)s and disabled flair for %(oldGroups)s in this room.": "%(senderDisplayName)s enabled flair for %(newGroups)s and disabled flair for %(oldGroups)s in this room.",
245+
"%(senderDisplayName)s set the server ACLs for this room.": "%(senderDisplayName)s set the server ACLs for this room.",
246+
"%(senderDisplayName)s changed the server ACLs for this room.": "%(senderDisplayName)s changed the server ACLs for this room.",
247+
"πŸŽ‰ All servers are banned from participating! This room can no longer be used.": "πŸŽ‰ All servers are banned from participating! This room can no longer be used.",
245248
"%(senderDisplayName)s sent an image.": "%(senderDisplayName)s sent an image.",
246249
"%(senderName)s set the main address for this room to %(address)s.": "%(senderName)s set the main address for this room to %(address)s.",
247250
"%(senderName)s removed the main address for this room.": "%(senderName)s removed the main address for this room.",

0 commit comments

Comments
Β (0)