feat: add internationalization message handling in messages.ts

This commit is contained in:
2026-04-28 09:36:08 -05:00
parent 6da211d2e1
commit d046a669fd

View File

@@ -1,10 +1,10 @@
import * as generatedMessages from '$lib/paraglide/messages';
const normalizedMessageKeyCache = new Map();
const generatedMessagesAny = /** @type {Record<string, any>} */ (generatedMessages);
const normalizedMessageKeyCache = new Map<string, string>();
const generatedMessagesAny: Record<string, unknown> = generatedMessages;
export const m = new Proxy({}, {
get(_target, property) {
export const m = new Proxy({} as typeof generatedMessages, {
get(_target, property: string | symbol) {
if (typeof property !== 'string') {
return undefined;
}
@@ -36,4 +36,4 @@ export const m = new Proxy({}, {
return generatedMessagesAny[property];
}
});
}) as typeof generatedMessages;