Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/utils/cape-error-translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const CAPE_ERROR_TRANSLATIONS: Record<string, string> = {
"Copyright": "Your cape was rejected due to copyright infringement.",
"Incomplete": "Your cape was rejected because the design is incomplete.",

// Static message for custom reason
"Custom Reason": "Your cape was rejected: {0}",

// Static messages (from CosmeticCapeRoute.kt)
"In Review": "Your cape is currently being reviewed. Please be patient.",
"Image does not fit the required resolution": "Your cape image must be 512x256 pixels.",
Expand Down Expand Up @@ -91,6 +94,11 @@ export function translateCapeError(errorText: string): string {
return result;
}

// Custom reason will also be in translatableKey
if(translated == parsedError.translatableKey) {
return translateCapeErrorKey("Custom Reason").replace("{0}", parsedError.translatableKey);
}

return translated;
}

Expand Down