Fix i18n types (#33305)

Without the fix the return type would be `string` in cases where it should be `ReactNode`
This commit is contained in:
Michael Telatynski
2026-04-27 15:09:55 +00:00
committed by GitHub
parent 03b730db58
commit 7766ae92d7
6 changed files with 621 additions and 574 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import _ from "lodash";
import {
_t,
normalizeLanguageKey,
type IVariables,
type StringVariables,
KEY_SEPARATOR,
getLangsJson,
registerTranslations,
@@ -72,7 +72,7 @@ export class UserFriendlyError extends Error {
public constructor(
message: TranslationKey,
substitutionVariablesAndCause?: Omit<IVariables, keyof ErrorOptions> | ErrorOptions,
substitutionVariablesAndCause?: Omit<StringVariables, keyof ErrorOptions> | ErrorOptions,
) {
// Prevent "Could not find /%\(cause\)s/g in x" logs to the console by removing it from the list
const { cause, ...substitutionVariables } = substitutionVariablesAndCause ?? {};