fix(i18n): keep opted-in dialog copy current while pending
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { interpolate, type TranslationParams } from "./i18n/I18nProvider";
|
||||
import { translations, type TranslationKey } from "./i18n/translations";
|
||||
|
||||
export type DialogText = string | { key: TranslationKey; params?: TranslationParams };
|
||||
|
||||
export function resolveDialogText(text: DialogText, t?: (key: TranslationKey, params?: TranslationParams) => string): string {
|
||||
return typeof text === "string" ? text : t ? t(text.key, text.params) : interpolate(translations.en[text.key], text.params);
|
||||
}
|
||||
Reference in New Issue
Block a user