(v4.2.0) Added new translation sentences

This commit is contained in:
DJj123dj
2026-05-25 11:16:33 +02:00
parent e7475af694
commit fd1e0d6bdb
15 changed files with 142 additions and 78 deletions
+3 -4
View File
@@ -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
}
+1 -2
View File
@@ -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)
+1 -2
View File
@@ -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")
+6 -12
View File
@@ -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)
})
)
+2 -2
View File
@@ -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()
}
+5 -8
View File
@@ -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()
}
+2 -2
View File
@@ -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()
}
+1 -2
View File
@@ -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()
}
+23 -3
View File
@@ -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"|
+1 -2
View File
@@ -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!
}
+3 -6
View File
@@ -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
}
+2 -2
View File
@@ -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}]
}))