solid-primitives
solid-primitives copied to clipboard
Make i18n translator resolver full generic
Make a few types more specific especially Scopes. Now we get proper types for available scopes and added support for nested scopes such as for example app.test
🦋 Changeset detected
Latest commit: 5fa818c9baedb339829bc5ea374541769fdac0d1
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @solid-primitives/i18n | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
There are too many changes to the scope/chained/proxy functionality. Please just limit it to adding the generic for parameters when necessary.
I know, that's because of the now nicely working scope api. To get all the types right was really a challange and involved hours of hard work, so please can we also merge this 👉👈
@BierDav can you fix this one as well? :)
Of course
Everything seems to be working as before. on solid-site too. I added a little test for the generic resolver types. Could you add tests for the improved functionality of scopes?
Sorry oversaw the pr. I've added a test that should ensure that nested translation works, the other part with the types could also be checked by typechecking the test files, don't know if that is already done or not.
Is there anything else needed for this feature? The templates are pretty limited as of now, compared to some other i18n libraries where you can e.g. pluralization in the templates, like: no apples | one apple | {count} apples (vue i18n)
This is not supported out of the box, but you can implement your own resolver which would allow you to support that syntax. This is even possible with the current implementation, no need for this pr.
@thetarnav is this ready to merge?