Fixed some translation errors & added Catalan!

This commit is contained in:
DJj123dj
2024-08-21 22:46:54 +02:00
parent 0a69efdfe5
commit 1dd8c0246a
19 changed files with 507 additions and 18 deletions
+2 -2
View File
@@ -203,7 +203,7 @@ const errorEmbeds = () => {
instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.noPermissions")))
instance.setAuthor(user.displayName,user.displayAvatarURL())
instance.setDescription(lang.getTranslation("errors.descriptions.noPermissionsBlacklist"))
instance.setDescription(lang.getTranslationWithParams("errors.descriptions.noPermissionsBlacklist",[method]))
})
)
@@ -834,7 +834,7 @@ const ticketEmbeds = () => {
//TODO TRANSLATION!!!
{name:"Option"+":",value:"```"+(ticket.option.get("openticket:name").value)+"```",inline:false},
)
if (reason) instance.addFields({name:"Reason:",value:"```"+reason+"```",inline:false})
if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```",inline:false})
if (mode == "close"){
instance.setTitle(utilities.emojiTitle("🔒",lang.getTranslation("actions.titles.close")))
+4 -4
View File
@@ -94,7 +94,7 @@ const verifyBarMessages = () => {
instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:"Without Transcript",customColor:"red"}))
if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:lang.getTranslation("actions.buttons.withoutTranscript"),customColor:"red"}))
}
})
)
@@ -130,7 +130,7 @@ const verifyBarMessages = () => {
instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:"Without Transcript",customColor:"red"}))
if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:lang.getTranslation("actions.buttons.withoutTranscript"),customColor:"red"}))
}
})
)
@@ -166,7 +166,7 @@ const verifyBarMessages = () => {
instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:"Without Transcript",customColor:"red"}))
if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:lang.getTranslation("actions.buttons.withoutTranscript"),customColor:"red"}))
}
})
)
@@ -319,7 +319,7 @@ const verifyBarMessages = () => {
instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:"Without Transcript",customColor:"red"}))
if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:lang.getTranslation("actions.buttons.withoutTranscript"),customColor:"red"}))
}
})
)
+1 -1
View File
@@ -66,7 +66,7 @@ export const registerCommandResponders = async () => {
//return when user already added to ticket
const participants = await openticket.tickets.getAllTicketParticipants(ticket)
if (!participants || participants.find((p) => p.user.id == data.id)){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"This user is already able to access the ticket!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.add"),layout:"simple"}))
return cancel()
}
+1 -1
View File
@@ -57,7 +57,7 @@ export const registerCommandResponders = async () => {
}
//return when already closed
if (ticket.get("openticket:closed").value){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is already closed!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.close"),layout:"simple"}))
return cancel()
}
//return when busy
+1 -1
View File
@@ -56,7 +56,7 @@ export const registerCommandResponders = async () => {
}
//return when already claimed
if (ticket.get("openticket:claimed").value){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is already claimed!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.claim"),layout:"simple"}))
return cancel()
}
//return when busy
+1 -1
View File
@@ -56,7 +56,7 @@ export const registerCommandResponders = async () => {
}
//return when already closed
if (ticket.get("openticket:closed").value){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is already closed!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.close"),layout:"simple"}))
return cancel()
}
//return when busy
+1 -1
View File
@@ -66,7 +66,7 @@ export const registerCommandResponders = async () => {
const option = openticket.options.get(id)
//return if unknown option
if (!option || !(option instanceof api.ODTicketOption)){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Unknown Option",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.titles.unknownOption"),layout:"simple"}))
return cancel()
}
//return if option is the same
+1 -1
View File
@@ -56,7 +56,7 @@ export const registerCommandResponders = async () => {
}
//return when already pinned
if (ticket.get("openticket:pinned").value){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is already pinned!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
return cancel()
}
//return when busy
+1 -1
View File
@@ -66,7 +66,7 @@ export const registerCommandResponders = async () => {
//return when user is not a participant of the ticket (admins & creator can't be removed)
const participants = await openticket.tickets.getAllTicketParticipants(ticket)
if (!participants || !participants.find((p) => p.user.id == data.id && p.role == "participant")){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Unable to remove this user from the ticket!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.remove"),layout:"simple"}))
return cancel()
}
+1 -1
View File
@@ -56,7 +56,7 @@ export const registerCommandResponders = async () => {
}
//return when not closed
if (!ticket.get("openticket:closed").value){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is not closed yet!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.reopen"),layout:"simple"}))
return cancel()
}
//return when busy
+1 -1
View File
@@ -56,7 +56,7 @@ export const registerCommandResponders = async () => {
}
//return when not claimed
if (!ticket.get("openticket:claimed").value){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is not claimed yet!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.unclaim"),layout:"simple"}))
return cancel()
}
//return when busy
+1 -1
View File
@@ -56,7 +56,7 @@ export const registerCommandResponders = async () => {
}
//return when not pinned yet
if (!ticket.get("openticket:pinned").value){
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is not pinned yet!",layout:"simple"}))
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.unpin"),layout:"simple"}))
return cancel()
}
//return when busy
+1
View File
@@ -450,6 +450,7 @@ export interface ODLanguageManagerIds_Default {
"openticket:portuguese":ODLanguage,
"openticket:czech":ODLanguage,
"openticket:german":ODLanguage,
"openticket:catalan":ODLanguage,
//ADD NEW LANGUAGES HERE!!!
}
+1 -1
View File
@@ -234,7 +234,7 @@ export class ODDefaultsManager {
languageLoading:true,
languageSelection:true,
backupLanguage:"openticket:english",
languageList:["custom","english","dutch","portuguese","czech","german"],
languageList:["custom","english","dutch","portuguese","czech","german","catalan"],
checkerLoading:true,
checkerFunctionLoading:true,
+1 -1
View File
@@ -488,7 +488,7 @@ export const defaultTranscriptsStructure = new api.ODCheckerObjectStructure("ope
{key:"includeFiles",optional:false,priority:0,checker:new api.ODCheckerBooleanStructure("openticket:transcripts-text-include-files",{})},
{key:"includeBotMessages",optional:false,priority:0,checker:new api.ODCheckerBooleanStructure("openticket:transcripts-text-include-bots",{})},
{key:"fileMode",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:transcripts-text-file-mode",{choices:["custom","name","id"]})},
{key:"fileMode",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:transcripts-text-file-mode",{choices:["custom","channel-name","channel-id","user-name","user-id"]})},
{key:"customFileName",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:transcripts-file-name",{maxLength:512,regex:/^[^\.#%&{}\\<>*?/!'":@`|=]*$/})},
]})},
+1
View File
@@ -7,6 +7,7 @@ export const loadAllLanguages = async () => {
openticket.languages.add(new api.ODLanguage("openticket:portuguese","portuguese.json"))
openticket.languages.add(new api.ODLanguage("openticket:czech","czech.json"))
openticket.languages.add(new api.ODLanguage("openticket:german","german.json"))
openticket.languages.add(new api.ODLanguage("openticket:catalan","catalan.json"))
/** How to add more languages?
* - Add the language to the list above
+9
View File
@@ -63,6 +63,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
}
})
//TODO TRANSLATION!!!
const autotitle = (hasTicket && ticketOnly) ? "Select your ticket:" : ((hasRole && roleOnly) ? "Select your role:" : "Select your option:")
const title = (panel.get("openticket:describe-options-custom-title").value.length < 1) ? "__"+autotitle+"__\n" : "__"+panel.get("openticket:describe-options-custom-title").value+"__\n"
@@ -74,10 +75,13 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
let description = opt.exists("openticket:description") ? opt.get("openticket:description").value : "`<no-description>`"
if (layout == "normal" || layout == "detailed"){
//TODO TRANSLATION!!!
if (opt.exists("openticket:cooldown-enabled") && opt.get("openticket:cooldown-enabled").value) description = description + "\nCooldown: `"+opt.get("openticket:cooldown-minutes").value+" min`"
//TODO TRANSLATION!!!
if (opt.exists("openticket:limits-enabled") && opt.get("openticket:limits-enabled").value) description = description + "\nMax Tickets: `"+opt.get("openticket:limits-maximum-user").value+"`"
}
if (layout == "detailed"){
//TODO TRANSLATION!!!
if (opt.exists("openticket:admins")) description = description + "\nAdmins: "+opt.get("openticket:admins").value.map((admin) => discord.roleMention(admin)).join(", ")
}
@@ -98,6 +102,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
let description = opt.exists("openticket:description") ? opt.get("openticket:description").value : "`<no-description>`"
if (layout == "normal" || layout == "detailed"){
//TODO TRANSLATION!!!
if (opt.exists("openticket:roles")) description = description + "\nRoles: "+opt.get("openticket:roles").value.map((admin) => discord.roleMention(admin)).join(", ")
}
@@ -119,10 +124,13 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
let description = opt.exists("openticket:description") ? opt.get("openticket:description").value : "`<no-description>`"
if (layout == "normal" || layout == "detailed"){
//TODO TRANSLATION!!!
if (opt.exists("openticket:cooldown-enabled") && opt.get("openticket:cooldown-enabled").value) description = description + "\nCooldown: `"+opt.get("openticket:cooldown-minutes").value+" min`"
//TODO TRANSLATION!!!
if (opt.exists("openticket:limits-enabled") && opt.get("openticket:limits-enabled").value) description = description + "\nMax Tickets: `"+opt.get("openticket:limits-maximum-user").value+"`"
}
if (layout == "detailed"){
//TODO TRANSLATION!!!
if (opt.exists("openticket:admins")) description = description + "\nAdmins: "+opt.get("openticket:admins").value.map((admin) => discord.roleMention(admin)).join(", ")
}
@@ -145,6 +153,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
let description = opt.exists("openticket:description") ? opt.get("openticket:description").value : "`<no-description>`"
if (layout == "normal" || layout == "detailed"){
//TODO TRANSLATION!!!
if (opt.exists("openticket:roles")) description = description + "\nRoles: "+opt.get("openticket:roles").value.map((admin) => discord.roleMention(admin)).join(", ")
}