Skip to content

Why are AST transforms required for the sdk-js in sveltekit? #837

Discussion options

You must be logged in to vote

Then you would need to use it like this:

<h1>{await i('welcome')}</h1>

And it would probably introduce more problems than it solves, because people will always use the function in a wrong way ^^
This alone should be reason enough to not do it.

But the real reason is:

the whole easy to use solution relies on the AST transformation we make. There are 10+ different ways how i('welcome') can be used (different files, different contexts). A user would need to set this up himself and needs to know where he needs to use which import. At that point we wouln't need yet another i18n library and everyone should just use typesafe-i18n.

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
9 replies
@samuelstroschein
Comment options

@benjaminpreiss
Comment options

@samuelstroschein
Comment options

@ivanhofer
Comment options

Answer selected by samuelstroschein
@samuelstroschein
Comment options

@ivanhofer
Comment options

@samuelstroschein
Comment options

@ivanhofer
Comment options

Comment options

You must be logged in to vote
2 replies
@samuelstroschein
Comment options

@benjaminpreiss
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: inlang/paraglide-js Related to source-code/sdk-js.
3 participants