I18N support #22

Merged
Rubicon merged 5 commits from feat-i18n into master 2024-09-27 06:20:32 +00:00
Owner

This is an attempt to create the I18N framework. We can translate the pages later.

We already need full ISO code list for #21, so why not create an initial I18N for the later use?

This is an attempt to create the I18N framework. We can translate the pages later. We already need full ISO code list for #21, so why not create an initial I18N for the later use?
Rubicon added this to the v1.0.6 milestone 2024-09-26 09:29:02 +00:00
Rubicon added the
feature
accepted
label 2024-09-26 09:29:02 +00:00
Rubicon self-assigned this 2024-09-26 09:29:02 +00:00
Rubicon added 1 commit 2024-09-26 09:29:02 +00:00
Rubicon added a new dependency 2024-09-26 09:29:24 +00:00
Rubicon reviewed 2024-09-26 09:32:35 +00:00
@ -0,0 +149,4 @@
return () => settings().language || autoMatchLangTag();
}
export function createStringResource<
Author
Owner

That's a needed feature: merging multiple resource into one.
Like:

createStringResource((code) => import(`./i18n/${code}.json`), (code) => import(`./i18n/${code}.js`))

Such feature can help us to reuse some common strings.

That's a needed feature: merging multiple resource into one. Like: ```js createStringResource((code) => import(`./i18n/${code}.json`), (code) => import(`./i18n/${code}.js`)) ``` Such feature can help us to reuse some common strings.
Rubicon marked this conversation as resolved
Rubicon reviewed 2024-09-26 09:33:44 +00:00
@ -31,0 +44,4 @@
const [strings] = createStringResource(
(code) => import(`./i18n/${code}.json`),
);
const t = translator(strings, resolveTemplate);
Author
Owner

I hope we can use one call to create this instead of two. This use will be very common.

I hope we can use one call to create this instead of two. This use will be very common.
Rubicon marked this conversation as resolved
Rubicon added 1 commit 2024-09-26 11:37:43 +00:00
Rubicon added 1 commit 2024-09-26 11:43:04 +00:00
Rubicon added 1 commit 2024-09-27 06:16:21 +00:00
Rubicon changed title from WIP: I18N support to I18N support 2024-09-27 06:16:25 +00:00
Rubicon added 1 commit 2024-09-27 06:18:36 +00:00
Rubicon merged commit 69f7f37a2c into master 2024-09-27 06:20:32 +00:00
Rubicon deleted branch feat-i18n 2024-09-27 06:20:32 +00:00
Sign in to join this conversation.
No description provided.