diff --git a/src/utils/translation.tsx b/src/utils/translation.tsx index e5f51910c..57d900705 100644 --- a/src/utils/translation.tsx +++ b/src/utils/translation.tsx @@ -136,11 +136,17 @@ export function $t(key: string, variables?: Record): string { // description: $t("clientTheme.description") // } // and any future accesses of the description prop will result in an up to date translation - return { - __proto__: String.prototype, - valueOf: getter, - toString: getter - } as unknown as string; + const descriptor = { + configurable: true, + enumerable: false, + writable: false, + value: getter + }; + + return Object.create(String.prototype, { + toString: descriptor, + valueOf: descriptor + }); } interface TranslateProps {