feat: add internationalization message handling in messages.ts
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user