more translation support
This commit is contained in:
parent
ac861f9314
commit
c35dc7bcf1
3 changed files with 15 additions and 8 deletions
|
@ -212,9 +212,9 @@ class Guild extends SnowFlake {
|
||||||
}
|
}
|
||||||
s1.options.push(new RoleList(permlist, this, this.updateRolePermissions.bind(this), false));
|
s1.options.push(new RoleList(permlist, this, this.updateRolePermissions.bind(this), false));
|
||||||
{
|
{
|
||||||
const emoji = settings.addButton("Emojis");
|
const emoji = settings.addButton(I18n.getTranslation("emoji.title"));
|
||||||
emoji.addButtonInput("", "Upload Emoji", () => {
|
emoji.addButtonInput("", I18n.getTranslation("emoji.upload"), () => {
|
||||||
const popup = new Dialog("Upload emoji");
|
const popup = new Dialog(I18n.getTranslation("emoji.upload"));
|
||||||
const form = popup.options.addForm(
|
const form = popup.options.addForm(
|
||||||
"",
|
"",
|
||||||
() => {
|
() => {
|
||||||
|
@ -226,8 +226,8 @@ class Guild extends SnowFlake {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
form.addFileInput("Image:", "image", {required: true});
|
form.addFileInput(I18n.getTranslation("emoji.image:"), "image", {required: true});
|
||||||
form.addTextInput("Name:", "name", {required: true});
|
form.addTextInput(I18n.getTranslation("emoji.name:"), "name", {required: true});
|
||||||
popup.show();
|
popup.show();
|
||||||
});
|
});
|
||||||
const containdiv = document.createElement("div");
|
const containdiv = document.createElement("div");
|
||||||
|
@ -255,7 +255,7 @@ class Guild extends SnowFlake {
|
||||||
del.classList.add("svgicon", "svg-x", "deleteEmoji");
|
del.classList.add("svgicon", "svg-x", "deleteEmoji");
|
||||||
del.onclick = () => {
|
del.onclick = () => {
|
||||||
const diaolog = new Dialog("");
|
const diaolog = new Dialog("");
|
||||||
diaolog.options.addTitle("Are you sure you want to delete this emoji?");
|
diaolog.options.addTitle(I18n.getTranslation("emoji.confirmDel"));
|
||||||
const options = diaolog.options.addOptions("", {ltr: true});
|
const options = diaolog.options.addOptions("", {ltr: true});
|
||||||
options.addButtonInput("", I18n.getTranslation("yes"), () => {
|
options.addButtonInput("", I18n.getTranslation("yes"), () => {
|
||||||
fetch(`${this.info.api}/guilds/${this.id}/emojis/${emoji.id}`, {
|
fetch(`${this.info.api}/guilds/${this.id}/emojis/${emoji.id}`, {
|
||||||
|
|
|
@ -33,10 +33,10 @@ import {badgeArr} from "./Dbadges.js";
|
||||||
const wsCodesRetry = new Set([4000, 4001, 4002, 4003, 4005, 4007, 4008, 4009]);
|
const wsCodesRetry = new Set([4000, 4001, 4002, 4003, 4005, 4007, 4008, 4009]);
|
||||||
|
|
||||||
class Localuser {
|
class Localuser {
|
||||||
badges: Map<
|
badges = new Map<
|
||||||
string,
|
string,
|
||||||
{id: string; description: string; icon: string; link?: string; translate?: boolean}
|
{id: string; description: string; icon: string; link?: string; translate?: boolean}
|
||||||
> = new Map(badgeArr);
|
>(badgeArr);
|
||||||
lastSequence: number | null = null;
|
lastSequence: number | null = null;
|
||||||
token!: string;
|
token!: string;
|
||||||
userinfo!: Specialuser;
|
userinfo!: Specialuser;
|
||||||
|
|
|
@ -438,6 +438,13 @@
|
||||||
"legacy_username": "Has legacy username",
|
"legacy_username": "Has legacy username",
|
||||||
"quest_completed": "did a quest"
|
"quest_completed": "did a quest"
|
||||||
},
|
},
|
||||||
|
"emoji": {
|
||||||
|
"title": "Emojis",
|
||||||
|
"upload": "Upload Emojis",
|
||||||
|
"image:": "Image:",
|
||||||
|
"name:": "Name:",
|
||||||
|
"confirmDel": "Are you sure you want to delete this emoji?"
|
||||||
|
},
|
||||||
"uploadFilesText": "Upload your files here!",
|
"uploadFilesText": "Upload your files here!",
|
||||||
"errorReconnect": "Unable to connect to the server, retrying in **$1** seconds...",
|
"errorReconnect": "Unable to connect to the server, retrying in **$1** seconds...",
|
||||||
"retrying": "Retrying...",
|
"retrying": "Retrying...",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue