diff --git a/.tools/mergeTranslations.ts b/.tools/mergeTranslations.ts index 5f9db7f..0535d40 100644 --- a/.tools/mergeTranslations.ts +++ b/.tools/mergeTranslations.ts @@ -1,4 +1,4 @@ - +/// import fjs from "formatted-json-stringify" import fs from "fs" @@ -124,6 +124,8 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("helpPage"), new fjs.PropertyFormatter("withReason"), new fjs.PropertyFormatter("withoutTranscript"), + new fjs.PropertyFormatter("blacklistAdd"), + new fjs.PropertyFormatter("blacklistRemove"), ]), new fjs.ObjectFormatter("titles",true,[ new fjs.PropertyFormatter("created"), @@ -162,6 +164,7 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("prioritySet"), new fjs.PropertyFormatter("priorityGet"), new fjs.PropertyFormatter("transfer"), + new fjs.PropertyFormatter("transcripts"), ]), new fjs.ObjectFormatter("descriptions",true,[ new fjs.PropertyFormatter("create"), @@ -255,6 +258,8 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("prioritySetDm"), new fjs.PropertyFormatter("roleUpdateLog"), new fjs.PropertyFormatter("roleUpdateDm"), + new fjs.PropertyFormatter("topicSetLog"), + new fjs.PropertyFormatter("topicSetDm"), ]), ]), new fjs.ObjectFormatter("transcripts",true,[ @@ -277,6 +282,8 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("backup"), new fjs.PropertyFormatter("error"), new fjs.PropertyFormatter("title"), + new fjs.PropertyFormatter("noHistory"), + new fjs.PropertyFormatter("historyNotSupported"), ]), new fjs.ObjectFormatter("text",true,[ new fjs.PropertyFormatter("messagesTitle"), @@ -303,8 +310,9 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("unknownPanel"), new fjs.PropertyFormatter("notInGuild"), new fjs.PropertyFormatter("channelRename"), + new fjs.PropertyFormatter("channelCategory"), new fjs.PropertyFormatter("busy"), - new fjs.PropertyFormatter("permissionError"), + new fjs.PropertyFormatter("permissionError"), ]), new fjs.ObjectFormatter("descriptions",true,[ new fjs.PropertyFormatter("askForInfo"), @@ -326,11 +334,15 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("deprecatedTicket"), new fjs.PropertyFormatter("notInGuild"), new fjs.PropertyFormatter("channelRename"), + new fjs.PropertyFormatter("channelCategory"), new fjs.PropertyFormatter("channelRenameSource"), new fjs.PropertyFormatter("busy"), new fjs.PropertyFormatter("closeBeforeMessage"), new fjs.PropertyFormatter("closeBeforeAdminMessage"), new fjs.PropertyFormatter("unableToCreateTicket"), + new fjs.PropertyFormatter("messageMissing"), + new fjs.PropertyFormatter("stateExpired"), + new fjs.PropertyFormatter("panelStateExpired"), ]), new fjs.ObjectFormatter("optionInvalidReasons",true,[ new fjs.PropertyFormatter("stringRegex"), @@ -392,6 +404,8 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("syntax"), new fjs.PropertyFormatter("originalName"), new fjs.PropertyFormatter("newName"), + new fjs.PropertyFormatter("originalCategory"), + new fjs.PropertyFormatter("newCategory"), new fjs.PropertyFormatter("until"), new fjs.PropertyFormatter("validOptions"), new fjs.PropertyFormatter("validPanels"), @@ -413,6 +427,8 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("participants"), new fjs.PropertyFormatter("yes"), new fjs.PropertyFormatter("no"), + new fjs.PropertyFormatter("accept"), + new fjs.PropertyFormatter("cancel"), new fjs.PropertyFormatter("option"), new fjs.PropertyFormatter("topic"), new fjs.PropertyFormatter("uptime"), @@ -425,6 +441,7 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("admins"), new fjs.PropertyFormatter("roles"), new fjs.PropertyFormatter("size"), + ]), new fjs.ObjectFormatter("lowercase",true,[ new fjs.PropertyFormatter("text"), @@ -444,6 +461,7 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("panelAutoUpdate"), new fjs.PropertyFormatter("ticket"), new fjs.PropertyFormatter("ticketId"), + new fjs.PropertyFormatter("ticketOtherUser"), new fjs.PropertyFormatter("close"), new fjs.PropertyFormatter("delete"), new fjs.PropertyFormatter("deleteNoTranscript"), @@ -510,6 +528,8 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("priorityList"), new fjs.PropertyFormatter("transfer"), new fjs.PropertyFormatter("transferUser"), + new fjs.PropertyFormatter("transcripts"), + new fjs.PropertyFormatter("transcriptsUser"), ]), new fjs.ObjectFormatter("helpMenu",true,[ new fjs.PropertyFormatter("help"), @@ -600,6 +620,7 @@ const formatter = new fjs.ObjectFormatter(null,true,[ new fjs.PropertyFormatter("selectTicket"), new fjs.PropertyFormatter("selectRole"), new fjs.PropertyFormatter("selectOption"), + new fjs.PropertyFormatter("selectPriorityLevel"), ]), new fjs.ObjectFormatter("priorities",true,[ new fjs.PropertyFormatter("urgent"), @@ -612,14 +633,14 @@ const formatter = new fjs.ObjectFormatter(null,true,[ ]), ]) -for (const language of fs.readdirSync(".docs/languages/")){ +for (const language of fs.readdirSync(".tools/languages/")){ if (!fs.existsSync("./languages/"+language)){ console.log("language:",language,"does not exist yet in the primary ./languages/ folder. Unable to merge!") continue } console.log("merging "+language+"...") const original = JSON.parse(fs.readFileSync("./languages/"+language).toString()) - const newSentences = JSON.parse(fs.readFileSync(".docs/languages/"+language).toString()) + const newSentences = JSON.parse(fs.readFileSync(".tools/languages/"+language).toString()) for (const key of Object.keys(newSentences)){ if (key.startsWith("_")) continue @@ -644,7 +665,7 @@ for (const language of fs.readdirSync(".docs/languages/")){ } } original["_TRANSLATION"]["lastedited"] = new Date().toLocaleDateString("nl-BE",{day:"2-digit",month:"2-digit",year:"numeric"}) - original["_TRANSLATION"]["otversion"] = "v4.1.3" + original["_TRANSLATION"]["otversion"] = "v"+JSON.parse(fs.readFileSync("./package.json").toString()).version const finalText = formatter.stringify(original) fs.writeFileSync("./languages/"+language,finalText) } \ No newline at end of file diff --git a/languages/custom.json b/languages/custom.json index f22936f..022ef77 100644 --- a/languages/custom.json +++ b/languages/custom.json @@ -2,7 +2,7 @@ "_TRANSLATION":{ "otversion":"v4.2.0", "translators":["DJj123dj"], - "lastedited":"16/02/2026", + "lastedited":"25/05/2026", "language":"Custom", "automated":false }, @@ -61,7 +61,7 @@ "booleanTrue":"Boolean must be false", "booleanFalse":"Boolean must be true", - + "arrayEmptyDisabled":"List must not be empty", "arrayEmptyRequired":"List must be empty", "arrayTooShort":"List must have at least {0} items", @@ -69,7 +69,7 @@ "arrayLengthInvalid":"List must have exactly {0} items", "arrayInvalidTypes":"List may only contain the following types: {0}", "arrayDouble":"List must not contain duplicate values", - + "discordInvalidId":"Invalid Discord {0} ID", "discordInvalidIdOptions":"Invalid Discord {0} ID. Alternatively, use one of the following: {1}", "discordInvalidToken":"Invalid Discord token", @@ -86,7 +86,7 @@ "urlInvalidPath":"Invalid URL path", "idNotUnique":"This ID is already in use. Please choose a unique ID", "idNonExistent":"ID {0} does not exist", - + "invalidType":"Property must be of type: {0}", "propertyMissing":"Required property {0} is missing from the object", "propertyOptional":"Property {0} is optional in the object", @@ -99,7 +99,7 @@ "invalidButton":"Button must have at least an {0} or {1}", "unusedOption":"Option {0} is not used anywhere", "unusedQuestion":"Question {0} is not used anywhere", - "dropdownOption":"Panels with dropdown enabled may only contain options of the 'ticket' type", + "dropdownOption":"A panel with dropdown can only contain options of the types: 'ticket', 'role' or 'sub-panel'.", "customInvalidVersion":"Config version mismatch. Make sure to update your config to the latest version" } }, @@ -118,7 +118,9 @@ "helpSwitchText":"View Text Commands", "helpPage":"Page {0}", "withReason":"With Reason", - "withoutTranscript":"Without Transcript" + "withoutTranscript":"Without Transcript", + "blacklistAdd":"Blacklist User", + "blacklistRemove":"Release User" }, "titles":{ "created":"Ticket Created", @@ -156,7 +158,8 @@ "topicSet":"Topic Changed", "prioritySet":"Priority Changed", "priorityGet":"Ticket Priority", - "transfer":"Ticket Transferred" + "transfer":"Ticket Transferred", + "transcripts":"Transcript History" }, "descriptions":{ "create":"Your ticket is ready. Click the button below to view and continue.", @@ -249,7 +252,9 @@ "prioritySetLog":"The priority of this ticket has been set to {0} by {1}.", "prioritySetDm":"The priority of your ticket has been set to {0}.", "roleUpdateLog":"{0} has modified their roles.", - "roleUpdateDm":"Your roles have been modified." + "roleUpdateDm":"Your roles have been modified.", + "topicSetLog":"The priority of this ticket has been set to {0} by {1}.", + "topicSetDm":"The priority of your ticket has been set to {0}." } }, "transcripts":{ @@ -258,7 +263,7 @@ "ready":"Transcript Created", "textFileDescription":"This is a text transcript of a deleted ticket.", "htmlProgress":"Please wait while the HTML transcript is being generated...", - + "createdChannel":"A new {0} transcript has been created in the server.", "createdCreator":"A new {0} transcript has been created for one of your tickets.", "createdParticipant":"A new {0} transcript has been created for a ticket you participated in.", @@ -271,7 +276,9 @@ "continue":"Delete Without Transcript", "backup":"Create Backup Transcript", "error":"Something went wrong while creating the transcript.\nWhat would you like to do?\n\nThis ticket will not be deleted until you select one of the options below.", - "title":"Transcript Error" + "title":"Transcript Error", + "noHistory":"This user does not yet have any transcripts.", + "historyNotSupported":"Transcript history is currently only supported with HTML Transcripts.\nText transcript history will be available in future versions." }, "text":{ "messagesTitle":"MESSAGES", @@ -298,6 +305,7 @@ "unknownPanel":"Unknown Panel", "notInGuild":"Not In Server", "channelRename":"Unable To Rename Channel", + "channelCategory":"Unable To Change Category", "busy":"Ticket Is Busy", "permissionError":"Permission Error" }, @@ -321,11 +329,15 @@ "deprecatedTicket":"This channel is not recognized as a valid ticket. It may have been created with an older version of the bot.", "notInGuild":"This {0} cannot be used in direct messages. Please use it in a server.", "channelRename":"Due to Discord rate limits, the channel could not be renamed immediately. It will be renamed automatically within 10 minutes if the bot remains online.", + "channelCategory":"Due to Discord rate limits, the channel category could not be changed immediately. It will be changed automatically within 10 minutes if the bot remains online.", "channelRenameSource":"Error source: {0}", "busy":"This {0} is currently unavailable.\nThe ticket is being processed by the bot.\n\nPlease try again in a few seconds.", "closeBeforeMessage":"This ticket cannot be closed or deleted before a user has sent a message.", "closeBeforeAdminMessage":"This ticket cannot be closed or deleted before a support member or admin has sent a message.", - "unableToCreateTicket":"You are currently unable to create a ticket." + "unableToCreateTicket":"You are currently unable to create a ticket.", + "messageMissing":"Unable to locate message of interaction. Use the command `{0}` instead.", + "stateExpired":"This interaction is no longer valid or has expired. Use the command `{0}` instead. It is normal to receive this error after a major Open Ticket update.", + "panelStateExpired":"This panel is no longer valid or has expired. Create a new panel using `{0}` to solve the issue. It is normal to receive this error after a major Open Ticket update." }, "optionInvalidReasons":{ "stringRegex":"The value does not match the required pattern.", @@ -387,6 +399,8 @@ "syntax":"Syntax", "originalName":"Original Name", "newName":"New Name", + "originalCategory":"Original Category", + "newCategory":"New Category", "until":"Until", "validOptions":"Valid Options", "validPanels":"Valid Panels", @@ -408,6 +422,8 @@ "participants":"Participants", "yes":"Yes", "no":"No", + "accept":"Accept", + "cancel":"Cancel", "option":"Option", "topic":"Topic", "uptime":"System Uptime", @@ -439,6 +455,7 @@ "panelAutoUpdate":"Automatically update this panel when edited.", "ticket":"Create a ticket instantly.", "ticketId":"ID of the ticket to create.", + "ticketOtherUser":"Create a ticket for another user.", "close":"Close this ticket.", "delete":"Delete this ticket.", "deleteNoTranscript":"Delete ticket without saving a transcript.", @@ -504,7 +521,9 @@ "priorityGet":"View ticket priority.", "priorityList":"List all ticket priorities.", "transfer":"Transfer ticket ownership.", - "transferUser":"User to transfer to." + "transferUser":"User to transfer to.", + "transcripts":"View ticket transcript history of a user.", + "transcriptsUser":"The user to view." }, "helpMenu":{ "help":"View all available commands.", @@ -594,7 +613,8 @@ "panel":{ "selectTicket":"Select a ticket", "selectRole":"Select a role", - "selectOption":"Select an option" + "selectOption":"Select an option", + "selectPriorityLevel":"Select priority level" }, "priorities":{ "urgent":"Urgent", diff --git a/languages/english.json b/languages/english.json index 7244893..8e73d7c 100644 --- a/languages/english.json +++ b/languages/english.json @@ -2,7 +2,7 @@ "_TRANSLATION":{ "otversion":"v4.2.0", "translators":["DJj123dj"], - "lastedited":"16/02/2026", + "lastedited":"25/05/2026", "language":"English", "automated":false }, @@ -61,7 +61,7 @@ "booleanTrue":"Boolean must be false", "booleanFalse":"Boolean must be true", - + "arrayEmptyDisabled":"List must not be empty", "arrayEmptyRequired":"List must be empty", "arrayTooShort":"List must have at least {0} items", @@ -69,7 +69,7 @@ "arrayLengthInvalid":"List must have exactly {0} items", "arrayInvalidTypes":"List may only contain the following types: {0}", "arrayDouble":"List must not contain duplicate values", - + "discordInvalidId":"Invalid Discord {0} ID", "discordInvalidIdOptions":"Invalid Discord {0} ID. Alternatively, use one of the following: {1}", "discordInvalidToken":"Invalid Discord token", @@ -86,7 +86,7 @@ "urlInvalidPath":"Invalid URL path", "idNotUnique":"This ID is already in use. Please choose a unique ID", "idNonExistent":"ID {0} does not exist", - + "invalidType":"Property must be of type: {0}", "propertyMissing":"Required property {0} is missing from the object", "propertyOptional":"Property {0} is optional in the object", @@ -99,7 +99,7 @@ "invalidButton":"Button must have at least an {0} or {1}", "unusedOption":"Option {0} is not used anywhere", "unusedQuestion":"Question {0} is not used anywhere", - "dropdownOption":"Panels with dropdown enabled may only contain options of the 'ticket' type", + "dropdownOption":"A panel with dropdown can only contain options of the types: 'ticket', 'role' or 'sub-panel'.", "customInvalidVersion":"Config version mismatch. Make sure to update your config to the latest version" } }, @@ -118,7 +118,9 @@ "helpSwitchText":"View Text Commands", "helpPage":"Page {0}", "withReason":"With Reason", - "withoutTranscript":"Without Transcript" + "withoutTranscript":"Without Transcript", + "blacklistAdd":"Blacklist User", + "blacklistRemove":"Release User" }, "titles":{ "created":"Ticket Created", @@ -156,7 +158,8 @@ "topicSet":"Topic Changed", "prioritySet":"Priority Changed", "priorityGet":"Ticket Priority", - "transfer":"Ticket Transferred" + "transfer":"Ticket Transferred", + "transcripts":"Transcript History" }, "descriptions":{ "create":"Your ticket is ready. Click the button below to view and continue.", @@ -249,7 +252,9 @@ "prioritySetLog":"The priority of this ticket has been set to {0} by {1}.", "prioritySetDm":"The priority of your ticket has been set to {0}.", "roleUpdateLog":"{0} has modified their roles.", - "roleUpdateDm":"Your roles have been modified." + "roleUpdateDm":"Your roles have been modified.", + "topicSetLog":"The priority of this ticket has been set to {0} by {1}.", + "topicSetDm":"The priority of your ticket has been set to {0}." } }, "transcripts":{ @@ -258,7 +263,7 @@ "ready":"Transcript Created", "textFileDescription":"This is a text transcript of a deleted ticket.", "htmlProgress":"Please wait while the HTML transcript is being generated...", - + "createdChannel":"A new {0} transcript has been created in the server.", "createdCreator":"A new {0} transcript has been created for one of your tickets.", "createdParticipant":"A new {0} transcript has been created for a ticket you participated in.", @@ -271,7 +276,9 @@ "continue":"Delete Without Transcript", "backup":"Create Backup Transcript", "error":"Something went wrong while creating the transcript.\nWhat would you like to do?\n\nThis ticket will not be deleted until you select one of the options below.", - "title":"Transcript Error" + "title":"Transcript Error", + "noHistory":"This user does not yet have any transcripts.", + "historyNotSupported":"Transcript history is currently only supported with HTML Transcripts.\nText transcript history will be available in future versions." }, "text":{ "messagesTitle":"MESSAGES", @@ -298,6 +305,7 @@ "unknownPanel":"Unknown Panel", "notInGuild":"Not In Server", "channelRename":"Unable To Rename Channel", + "channelCategory":"Unable To Change Category", "busy":"Ticket Is Busy", "permissionError":"Permission Error" }, @@ -321,11 +329,15 @@ "deprecatedTicket":"This channel is not recognized as a valid ticket. It may have been created with an older version of the bot.", "notInGuild":"This {0} cannot be used in direct messages. Please use it in a server.", "channelRename":"Due to Discord rate limits, the channel could not be renamed immediately. It will be renamed automatically within 10 minutes if the bot remains online.", + "channelCategory":"Due to Discord rate limits, the channel category could not be changed immediately. It will be changed automatically within 10 minutes if the bot remains online.", "channelRenameSource":"Error source: {0}", "busy":"This {0} is currently unavailable.\nThe ticket is being processed by the bot.\n\nPlease try again in a few seconds.", "closeBeforeMessage":"This ticket cannot be closed or deleted before a user has sent a message.", "closeBeforeAdminMessage":"This ticket cannot be closed or deleted before a support member or admin has sent a message.", - "unableToCreateTicket":"You are currently unable to create a ticket." + "unableToCreateTicket":"You are currently unable to create a ticket.", + "messageMissing":"Unable to locate message of interaction. Use the command `{0}` instead.", + "stateExpired":"This interaction is no longer valid or has expired. Use the command `{0}` instead. It is normal to receive this error after a major Open Ticket update.", + "panelStateExpired":"This panel is no longer valid or has expired. Create a new panel using `{0}` to solve the issue. It is normal to receive this error after a major Open Ticket update." }, "optionInvalidReasons":{ "stringRegex":"The value does not match the required pattern.", @@ -387,6 +399,8 @@ "syntax":"Syntax", "originalName":"Original Name", "newName":"New Name", + "originalCategory":"Original Category", + "newCategory":"New Category", "until":"Until", "validOptions":"Valid Options", "validPanels":"Valid Panels", @@ -408,6 +422,8 @@ "participants":"Participants", "yes":"Yes", "no":"No", + "accept":"Accept", + "cancel":"Cancel", "option":"Option", "topic":"Topic", "uptime":"System Uptime", @@ -439,6 +455,7 @@ "panelAutoUpdate":"Automatically update this panel when edited.", "ticket":"Create a ticket instantly.", "ticketId":"ID of the ticket to create.", + "ticketOtherUser":"Create a ticket for another user.", "close":"Close this ticket.", "delete":"Delete this ticket.", "deleteNoTranscript":"Delete ticket without saving a transcript.", @@ -504,7 +521,9 @@ "priorityGet":"View ticket priority.", "priorityList":"List all ticket priorities.", "transfer":"Transfer ticket ownership.", - "transferUser":"User to transfer to." + "transferUser":"User to transfer to.", + "transcripts":"View ticket transcript history of a user.", + "transcriptsUser":"The user to view." }, "helpMenu":{ "help":"View all available commands.", @@ -594,7 +613,8 @@ "panel":{ "selectTicket":"Select a ticket", "selectRole":"Select a role", - "selectOption":"Select an option" + "selectOption":"Select an option", + "selectPriorityLevel":"Select priority level" }, "priorities":{ "urgent":"Urgent", diff --git a/src/actions/utilities.ts b/src/actions/utilities.ts index 25f9b45..73d7d75 100644 --- a/src/actions/utilities.ts +++ b/src/actions/utilities.ts @@ -28,18 +28,17 @@ export async function checkTicketCreationPerms(instance:api.ODButtonResponderIns export async function replyInteractiveMessageState(instance:api.ODButtonResponderInstance|api.ODDropdownResponderInstance|api.ODModalResponderInstance,origin:"slash"|"text"|"button"|"dropdown"|"modal"|"other",channel:discord.TextBasedChannel,message:discord.Message|null,replacementCommandName:string){ //check message state const {user,member,guild} = instance + const lang = opendiscord.languages const interactiveMsgState = opendiscord.states.get("opendiscord:interactive-message") if (!message){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"Unable to locate message of interaction. Use the command `{0}` instead.".replace("{0}",replacementCommandName),layout:"simple",customTitle:"Message State Error"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.messageMissing",[replacementCommandName]),layout:"simple",customTitle:"Message State Error"})) return null } const state = await interactiveMsgState.getMsgState({channel,message}) if (!state){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"This interaction is no longer valid or has expired. Use the command `{0}` instead. It is normal to receive this error after a major Open Ticket update.".replace("{0}",replacementCommandName),layout:"simple",customTitle:"Message State Expired"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.stateExpired",[replacementCommandName]),layout:"simple",customTitle:"Message State Expired"})) return null }else return state } diff --git a/src/builders/buttons.ts b/src/builders/buttons.ts index 81b2fd0..bb83519 100644 --- a/src/builders/buttons.ts +++ b/src/builders/buttons.ts @@ -17,8 +17,7 @@ export async function registerAllButtons(){ if (params.verifyButtonId.length > 40) throw new api.ODSystemError("ODButton:opendiscord:verifybar-button => verifyButtonId '"+verifyButtonId+"' exceeds 40 characters limit!") const color = ("customColor" in params && params.customColor) ? params.customColor : "gray" - //TODO TRANSLATION!!! - const defaultLabel = (params.defaultButtonType == "✅") ? "Accept" : "Cancel" + const defaultLabel = (params.defaultButtonType == "✅") ? lang.getTranslation("params.uppercase.accept") : lang.getTranslation("params.uppercase.cancel") const defaultEmoji = (params.defaultButtonType == "✅") ? "✅" : "❌" const label = ("customLabel" in params && params.customLabel) ? params.customLabel : (params.useDefaultLabels ? defaultLabel : null) diff --git a/src/builders/dropdowns.ts b/src/builders/dropdowns.ts index 91b99af..28d26ae 100644 --- a/src/builders/dropdowns.ts +++ b/src/builders/dropdowns.ts @@ -80,8 +80,7 @@ const panelDropdowns = () => { })) const currentPriority = opendiscord.priorities.getFromPriorityLevel(ticket.get("opendiscord:priority").value) - //TODO TRANSLATION!!! - const placeholder = (currentPriority.priority < 0) ? "Select priority level" : (lang.getTranslation("params.uppercase.priority")+": "+currentPriority.renderDisplayName()) + const placeholder = (currentPriority.priority < 0) ? lang.getTranslation("panel.selectPriorityLevel") : (lang.getTranslation("params.uppercase.priority")+": "+currentPriority.renderDisplayName()) instance.setCustomId("od:priority-dropdown") instance.setType("string") diff --git a/src/builders/embeds.ts b/src/builders/embeds.ts index ca3eb1b..988654d 100644 --- a/src/builders/embeds.ts +++ b/src/builders/embeds.ts @@ -353,17 +353,13 @@ const errorEmbeds = () => { const method = (origin == "ticket-create" || origin == "ticket-close" || origin == "ticket-reopen" || origin == "ticket-claim" || origin == "ticket-unclaim" || origin == "ticket-move") ? origin : getMethodFromOrigin(origin) instance.setColor(generalConfig.data.ticketSystem.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor) - //TODO TRANSLATION!!! - instance.setTitle(utilities.emojiTitle("❌","Unable To Change Category")) + instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.channelCategory"))) instance.setAuthor(user.displayName,user.displayAvatarURL()) - //TODO TRANSLATION!!! - instance.setDescription("Due to Discord rate limits, the channel category could not be changed immediately. It will be changed automatically within 10 minutes if the bot remains online.") + instance.setDescription(lang.getTranslation("errors.descriptions.channelCategory")) instance.setFooter(lang.getTranslationWithParams("errors.descriptions.channelRenameSource",[method])) instance.addFields( - //TODO TRANSLATION!!! - {name:"Original Category"+":",value:"```"+originalCategory+"```",inline:true}, - //TODO TRANSLATION!!! - {name:"New Category"+":",value:"```"+newCategory+"```",inline:true} + {name:lang.getTranslation("params.uppercase.originalCategory")+":",value:"```"+originalCategory+"```",inline:true}, + {name:lang.getTranslation("params.uppercase.newCategory")+":",value:"```"+newCategory+"```",inline:true} ) }) ) @@ -1141,14 +1137,12 @@ const transcriptEmbeds = () => { //transcript history only supports URL (html) transcripts at the moment const filteredList = transcriptList.filter((t) => t.transcriptType == "remoteUrl") const renderedList = filteredList.map((t) => "- ["+t.ticketName+"]("+t.transcriptUrl+") ("+discord.time(new Date(t.ticketDeletedDate ?? 0),"R")+")").join("\n") - //TODO TRANSLATION!!! - const contents = (transcriptList.length < 1) ? "This user does not yet have any transcripts." : ((filteredList.length > 0) ? renderedList : "*⚠️ Transcript history is currently only supported with HTML Transcripts.\nText transcript history will be available soon.*") + const contents = (transcriptList.length < 1) ? lang.getTranslation("transcripts.errors.noHistory") : ((filteredList.length > 0) ? renderedList : "⚠️ "+lang.getTranslation("transcripts.errors.historyNotSupported")) instance.setAuthor(transcriptUser.displayName,transcriptUser.displayAvatarURL()) instance.setThumbnail(transcriptUser.displayAvatarURL()) instance.setColor(generalConfig.data.mainColor) - //TODO TRANSLATION!!! - instance.setTitle(utilities.emojiTitle("📄","Transcript History")) + instance.setTitle(utilities.emojiTitle("📄",lang.getTranslation("actions.titles.transcripts"))) instance.setDescription(contents) }) ) diff --git a/src/commands/clear.ts b/src/commands/clear.ts index 06093d9..30bb9c9 100644 --- a/src/commands/clear.ts +++ b/src/commands/clear.ts @@ -6,6 +6,7 @@ import * as discord from "discord.js" const generalConfig = opendiscord.configs.get("opendiscord:general") const clearMsgState = opendiscord.states.get("opendiscord:clear-message") +const lang = opendiscord.languages export async function registerCommandResponders(){ //CLEAR COMMAND RESPONDER @@ -72,8 +73,7 @@ export async function registerButtonResponders(){ //check message state const state = await clearMsgState.getMsgState({channel,message,user}) if (!state){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"This interaction is no longer valid or has expired. Use the command `{0}` instead. It is normal to receive this error after a major Open Ticket update.".replace("{0}","/clear"),layout:"simple",customTitle:"Message State Expired"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.stateExpired",["/clear"]),layout:"simple",customTitle:"Message State Expired"})) return cancel() } diff --git a/src/commands/panel.ts b/src/commands/panel.ts index 434b62b..d6607e7 100644 --- a/src/commands/panel.ts +++ b/src/commands/panel.ts @@ -6,6 +6,7 @@ import * as discord from "discord.js" const generalConfig = opendiscord.configs.get("opendiscord:general") const panelMsgState = opendiscord.states.get("opendiscord:panel-message") +const lang = opendiscord.languages export async function registerCommandResponders(){ //PANEL COMMAND RESPONDER @@ -64,8 +65,7 @@ export async function registerButtonResponders(){ //check message state const state = await panelMsgState.getMsgState({channel,message}) if (!state){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"This panel is no longer valid or has expired. Create a new panel using `{0}` to solve the issue. It is normal to receive this error after a major Open Ticket update.".replace("{0}","/panel"),layout:"simple",customTitle:"Message State Expired"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.panelStateExpired",["/panel"]),layout:"simple",customTitle:"Message State Expired"})) return cancel() } @@ -123,8 +123,7 @@ export async function registerDropdownResponders(){ //check message state const state = await panelMsgState.getMsgState({channel,message}) if (!state){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"This panel is no longer valid or has expired. Create a new panel using `{0}` to solve the issue. It is normal to receive this error after a major Open Ticket update.".replace("{0}","/panel"),layout:"simple",customTitle:"Message State Expired"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.panelStateExpired",["/panel"]),layout:"simple",customTitle:"Message State Expired"})) return cancel() } @@ -188,8 +187,7 @@ export async function registerDropdownResponders(){ //check message state const state = await panelMsgState.getMsgState({channel,message}) if (!state){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"This panel is no longer valid or has expired. Create a new panel using `{0}` to solve the issue. It is normal to receive this error after a major Open Ticket update.".replace("{0}","/panel"),layout:"simple",customTitle:"Message State Expired"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.panelStateExpired",["/panel"]),layout:"simple",customTitle:"Message State Expired"})) return cancel() } @@ -243,8 +241,7 @@ export async function registerDropdownResponders(){ //check message state const state = await panelMsgState.getMsgState({channel,message}) if (!state){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"This panel is no longer valid or has expired. Create a new panel using `{0}` to solve the issue. It is normal to receive this error after a major Open Ticket update.".replace("{0}","/panel"),layout:"simple",customTitle:"Message State Expired"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.panelStateExpired",["/panel"]),layout:"simple",customTitle:"Message State Expired"})) return cancel() } diff --git a/src/commands/role.ts b/src/commands/role.ts index f0cc7b7..8e1249a 100644 --- a/src/commands/role.ts +++ b/src/commands/role.ts @@ -6,6 +6,7 @@ import * as discord from "discord.js" const generalConfig = opendiscord.configs.get("opendiscord:general") const panelMsgState = opendiscord.states.get("opendiscord:panel-message") +const lang = opendiscord.languages export async function registerButtonResponders(){ //ROLE OPTION BUTTON RESPONDER @@ -21,8 +22,7 @@ export async function registerButtonResponders(){ //check message state const state = await panelMsgState.getMsgState({channel,message}) if (!state){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"This panel is no longer valid or has expired. Create a new panel using `{0}` to solve the issue. It is normal to receive this error after a major Open Ticket update.".replace("{0}","/panel"),layout:"simple",customTitle:"Message State Expired"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.panelStateExpired",["/panel"]),layout:"simple",customTitle:"Message State Expired"})) return cancel() } diff --git a/src/commands/ticket.ts b/src/commands/ticket.ts index 2b0e67a..66d0223 100644 --- a/src/commands/ticket.ts +++ b/src/commands/ticket.ts @@ -92,8 +92,7 @@ export async function registerButtonResponders(){ //check message state const state = await panelMsgState.getMsgState({channel,message}) if (!state){ - //TODO TRANSLATION!!! - await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:"This panel is no longer valid or has expired. Create a new panel using `{0}` to solve the issue. It is normal to receive this error after a major Open Ticket update.".replace("{0}","/panel"),layout:"simple",customTitle:"Message State Expired"})) + await instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(origin,{guild,channel,user,error:lang.getTranslationWithParams("errors.descriptions.panelStateExpired",["/panel"]),layout:"simple",customTitle:"Message State Expired"})) return cancel() } diff --git a/src/core/mappings/language.ts b/src/core/mappings/language.ts index e5ff8c7..48decc9 100644 --- a/src/core/mappings/language.ts +++ b/src/core/mappings/language.ts @@ -161,6 +161,8 @@ export type ODLanguageManagerTranslationIdMappings = ( "actions.buttons.helpPage"| "actions.buttons.withReason"| "actions.buttons.withoutTranscript"| + "actions.buttons.blacklistAdd"| + "actions.buttons.blacklistRemove"| "actions.titles.created"| "actions.titles.close"| @@ -198,6 +200,7 @@ export type ODLanguageManagerTranslationIdMappings = ( "actions.titles.prioritySet"| "actions.titles.priorityGet"| "actions.titles.transfer"| + "actions.titles.transcripts"| "actions.descriptions.create"| "actions.descriptions.close"| @@ -288,7 +291,9 @@ export type ODLanguageManagerTranslationIdMappings = ( "actions.logs.prioritySetDm"| "actions.logs.roleUpdateLog"| "actions.logs.roleUpdateDm"| - + "actions.logs.topicSetLog"| + "actions.logs.topicSetDm"| + "transcripts.success.visit"| "transcripts.success.ready"| "transcripts.success.textFileDescription"| @@ -306,7 +311,9 @@ export type ODLanguageManagerTranslationIdMappings = ( "transcripts.errors.backup"| "transcripts.errors.error"| "transcripts.errors.title"| - + "transcripts.errors.noHistory"| + "transcripts.errors.historyNotSupported"| + "transcripts.text.messagesTitle"| "transcripts.text.embedTitle"| "transcripts.text.fileTitle"| @@ -328,6 +335,7 @@ export type ODLanguageManagerTranslationIdMappings = ( "errors.titles.unknownPanel"| "errors.titles.notInGuild"| "errors.titles.channelRename"| + "errors.titles.channelCategory"| "errors.titles.busy"| "errors.titles.permissionError"| @@ -350,12 +358,16 @@ export type ODLanguageManagerTranslationIdMappings = ( "errors.descriptions.deprecatedTicket"| "errors.descriptions.notInGuild"| "errors.descriptions.channelRename"| + "errors.descriptions.channelCategory"| "errors.descriptions.channelRenameSource"| "errors.descriptions.busy"| "errors.descriptions.closeBeforeMessage"| "errors.descriptions.closeBeforeAdminMessage"| "errors.descriptions.unableToCreateTicket"| - + "errors.descriptions.messageMissing"| + "errors.descriptions.stateExpired"| + "errors.descriptions.panelStateExpired"| + "errors.optionInvalidReasons.stringRegex"| "errors.optionInvalidReasons.stringMinLength"| "errors.optionInvalidReasons.stringMaxLength"| @@ -410,6 +422,8 @@ export type ODLanguageManagerTranslationIdMappings = ( "params.uppercase.syntax"| "params.uppercase.originalName"| "params.uppercase.newName"| + "params.uppercase.originalCategory"| + "params.uppercase.newCategory"| "params.uppercase.until"| "params.uppercase.validOptions"| "params.uppercase.validPanels"| @@ -432,6 +446,8 @@ export type ODLanguageManagerTranslationIdMappings = ( "params.uppercase.participants"| "params.uppercase.yes"| "params.uppercase.no"| + "params.uppercase.accept"| + "params.uppercase.cancel"| "params.uppercase.option"| "params.uppercase.topic"| "params.uppercase.uptime"| @@ -460,6 +476,7 @@ export type ODLanguageManagerTranslationIdMappings = ( "commands.panelAutoUpdate"| "commands.ticket"| "commands.ticketId"| + "commands.ticketOtherUser"| "commands.close"| "commands.delete"| "commands.deleteNoTranscript"| @@ -522,6 +539,8 @@ export type ODLanguageManagerTranslationIdMappings = ( "commands.priorityList"| "commands.transfer"| "commands.transferUser"| + "commands.transcripts"| + "commands.transcriptsUser"| "helpMenu.help"| "helpMenu.ticket"| @@ -604,6 +623,7 @@ export type ODLanguageManagerTranslationIdMappings = ( "panel.selectTicket"| "panel.selectRole"| "panel.selectOption"| + "panel.selectPriorityLevel"| "priorities.urgent"| "priorities.veryHigh"| diff --git a/src/data/framework/checkerLoader.ts b/src/data/framework/checkerLoader.ts index acd3b4a..a32a13e 100644 --- a/src/data/framework/checkerLoader.ts +++ b/src/data/framework/checkerLoader.ts @@ -123,8 +123,7 @@ export function registerDefaultCheckerCustomTranslations(tm:api.ODMappedCheckerT tm.quickTranslate(lm,"checker.messages.invalidButton","message","opendiscord:invalid-button") // This button needs to have at least an {0} or {1}! tm.quickTranslate(lm,"checker.messages.unusedOption","message","opendiscord:unused-option") // The option {0} isn't used anywhere! tm.quickTranslate(lm,"checker.messages.unusedQuestion","message","opendiscord:unused-question") // The question {0} isn't used anywhere! - //TODO TRANSLATION!!! (changed) - //tm.quickTranslate(lm,"checker.messages.dropdownOption","message","opendiscord:dropdown-option") // A panel with dropdown can only contain options of the types: 'ticket', 'role' or 'sub-panel'. + tm.quickTranslate(lm,"checker.messages.dropdownOption","message","opendiscord:dropdown-option") // A panel with dropdown can only contain options of the types: 'ticket', 'role' or 'sub-panel'. tm.quickTranslate(lm,"checker.messages.customInvalidVersion","message","opendiscord:invalid-version") // The version specified in your config does not match! Make sure you have updated the config to the latest version! } diff --git a/src/data/framework/commandLoader.ts b/src/data/framework/commandLoader.ts index fbae27d..818e004 100644 --- a/src/data/framework/commandLoader.ts +++ b/src/data/framework/commandLoader.ts @@ -68,8 +68,7 @@ export async function loadAllSlashCommands(){ }, { name:"user", - //TODO TRANSLATION!!! - description:"Create a ticket for another user.", + description:lang.getTranslation("commands.ticketOtherUser"), type:acot.User, required:false, } @@ -642,15 +641,13 @@ export async function loadAllSlashCommands(){ if (allowedCommands.includes("transcripts")) commands.add(new api.ODSlashCommand("opendiscord:transcripts",{ type:act.ChatInput, name:"transcripts", - //TODO TRANSLATION!!! - description:"View ticket transcript history of a user.", + description:lang.getTranslation("commands.transcripts"), contexts:[discord.InteractionContextType.Guild], integrationTypes:[discord.ApplicationIntegrationType.GuildInstall], options:[ { name:"user", - //TODO TRANSLATION!!! - description:"The user to view.", + description:lang.getTranslation("commands.transcriptsUser"), type:acot.User, required:true } diff --git a/src/data/framework/helpMenuLoader.ts b/src/data/framework/helpMenuLoader.ts index afc605c..ccae3a4 100644 --- a/src/data/framework/helpMenuLoader.ts +++ b/src/data/framework/helpMenuLoader.ts @@ -285,9 +285,9 @@ export async function loadAllHelpMenuComponents(){ })) if (allowedCommands.includes("transcripts")) advanced.add(new api.ODHelpMenuCommandComponent("opendiscord:transcripts",0,{ textName:prefix+"transcripts", - textDescription:"View ticket transcript history of a user.", //TODO TRANSLATION!!! + textDescription:lang.getTranslation("commands.transcripts"), slashName:"/transcripts", - slashDescription:"View ticket transcript history of a user.", //TODO TRANSLATION!!! + slashDescription:lang.getTranslation("commands.transcripts"), textOptions:[{name:"user",optional:false}], slashOptions:[{name:"user",optional:false}] }))