Merge branch 'kmmiio99o:main' into main

This commit is contained in:
OTKUSteyler 2026-05-30 02:50:39 +02:00 • committed by GitHub
commit 1cc7a8a9d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -160,11 +160,12 @@ export function formatString<T = void>(
try {
// @ts-ignore
return new IntlMessageFormat(str).format(val);
} catch (e) {
if (e instanceof SyntaxError) {
} catch (e: any) {
if (e?.name === "SyntaxError") {
logger.warn(`[i18n] Failed to parse message for key "${String(key)}":`, e.message);
return str as FormatStringRet<T>;
}
throw e;
logger.warn(`[i18n] Failed to format message for key "${String(key)}":`, e?.message ?? e);
return str as FormatStringRet<T>;
}
}