Replies: 3 comments
-
cc @kazupon |
Beta Was this translation helpful? Give feedback.
0 replies
-
the dev mode still fallback to the text output. but in production to throw error broken page. |
Beta Was this translation helpful? Give feedback.
0 replies
-
const originalT = i18n.global.t;
const cache = new Map()
i18n.global.t = function (...args: any[]) {
try {
return (originalT as any)(...args)
} catch (e) {
if(cache.has(args[0])) return cache.get(args[0]);
const ret = get((i18n.global.messages.value[i18n.global.locale.value] as Record<string, any>), args[0]);
if (ret) {
cache.set(args[0], ret)
return ret;
} else {
throw ret;
}
}
} I am doing somethings like this, if we get any more better solution, please tell me . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Now i have a text like
test case aaa @xxxxxx
and i just want "@" text, the parser got a error, and the page was broken. anyway to make sure when parser failed and fallback to text output ?Beta Was this translation helpful? Give feedback.
All reactions