Replies: 3 comments 1 reply
-
type Nested = Record<string, Nested | string>;
[
template: (key: string, params?: Record<string, string>, defaultValue?: string) => string,
actions: {
add(lang: string, table: Nested): void;
locale: (lang?: string) => string;
dict: (lang: string) => Record<string, Nested>;
}
] |
Beta Was this translation helpful? Give feedback.
1 reply
-
https://primitives.solidjs.community/package/i18n is currently on stage 3... should this status be reconsidered? 🤔 |
Beta Was this translation helpful? Give feedback.
0 replies
-
An overhaul: #510 |
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
-
I've been playing around with typescript-eslint in solid-site and it complains that template solidI18n returns any instead of a string (which makes all operations with it untyped).
I think we should expect that the translation is just a deeply nested object with strings as leaves, and change the translate function to only return a string
The only downside I can see to this is not allowing easy dynamic arrays. For example, in solid-site we currently have an array for each of the nav items. However, I believe this shouldn't be done with the i18n provider, and instead done with some other service if necessary.
Beta Was this translation helpful? Give feedback.
All reactions