diff --git a/frontend/src/Utilities/String/translate.ts b/frontend/src/Utilities/String/translate.ts index 7d59a22d1..76ab770ea 100644 --- a/frontend/src/Utilities/String/translate.ts +++ b/frontend/src/Utilities/String/translate.ts @@ -25,15 +25,13 @@ export async function fetchTranslations(): Promise { export default function translate( key: string, - tokens: Record = { appName: 'Sonarr' } + tokens: Record = {} ) { const translation = translations[key] || key; - if (tokens) { - return translation.replace(/\{([a-z0-9]+?)\}/gi, (match, tokenMatch) => - String(tokens[tokenMatch] ?? match) - ); - } + tokens.appName = 'Sonarr'; - return translation; + return translation.replace(/\{([a-z0-9]+?)\}/gi, (match, tokenMatch) => + String(tokens[tokenMatch] ?? match) + ); }