Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make i18n translator resolver full generic #591

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

BierDav
Copy link
Contributor

@BierDav BierDav commented Mar 24, 2024

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

Make a few types more specific especially Scopes
Copy link

changeset-bot bot commented Mar 24, 2024

🦋 Changeset detected

Latest commit: 5fa818c

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

Copy link
Member

@thetarnav thetarnav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are too many changes to the scope/chained/proxy functionality.
Please just limit it to adding the generic for parameters when necessary.

packages/i18n/src/index.ts Outdated Show resolved Hide resolved
packages/i18n/src/index.ts Outdated Show resolved Hide resolved
packages/i18n/src/index.ts Outdated Show resolved Hide resolved
packages/i18n/src/index.ts Outdated Show resolved Hide resolved
@BierDav BierDav requested a review from thetarnav March 24, 2024 21:45
@BierDav
Copy link
Contributor Author

BierDav commented Mar 24, 2024

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 BierDav closed this Apr 4, 2024
@BierDav BierDav deleted the add-generic-template-args branch April 4, 2024 09:53
@thetarnav
Copy link
Member

thetarnav commented Apr 4, 2024

@BierDav can you fix this one as well? :)

@BierDav BierDav restored the add-generic-template-args branch April 4, 2024 16:25
@BierDav BierDav reopened this Apr 4, 2024
@BierDav
Copy link
Contributor Author

BierDav commented Apr 4, 2024

Of course

@thetarnav
Copy link
Member

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?

@BierDav
Copy link
Contributor Author

BierDav commented Jun 13, 2024

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.

@marvin-j97
Copy link

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)

@BierDav
Copy link
Contributor Author

BierDav commented Nov 8, 2024

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.

@BierDav
Copy link
Contributor Author

BierDav commented Nov 18, 2024

@thetarnav is this ready to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants