1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-25 20:22:37 +01:00

Return original token when missing from translation

This commit is contained in:
Bogdan 2023-08-27 23:12:16 +03:00 committed by Mark McDowall
parent ce4ac75941
commit 2e9dbfd382

View File

@ -30,9 +30,8 @@ export default function translate(
const translation = translations[key] || key;
if (tokens) {
return translation.replace(
/\{([a-z0-9]+?)\}/gi,
(match, tokenMatch) => String(tokens[tokenMatch]) ?? match
return translation.replace(/\{([a-z0-9]+?)\}/gi, (match, tokenMatch) =>
String(tokens[tokenMatch] ?? match)
);
}