Can we use interpolation, pluralization and formatters with SvelteKit and inlang-sdk yet? #1133
Replies: 4 comments 15 replies
-
Hi @aakash14goplani 👋,
interpolation = yes, pluralization = no, formatters = no. The SDK is in alpha (@inlang/website can someone mention that on the website?). Pluralization and formatters are coming soonish. If you need them now, you should stick with typesafe-i18n.
No need to integrate typesafe-i18n 'into the SDK'. The SDK is an alternative to typesafe-i18n but inlang can work with either typesafe-i18n, the inlang SDK, or many other i18n libraries. @ivanhofer, I forked the reproduction with a minimal typesafe-i18n plugin. The error stays identical. Seems like a bug in the typesafe-i18n plugin? See https://stackblitz.com/edit/sveltekit-i18n-inlang-sdk-snn8ys?file=src%2Flib%2Fi18n%2Fhi%2Findex.ts |
Beta Was this translation helpful? Give feedback.
-
Hello @samuelstroschein Thanks for super-quick reply. Can you please explain me how would I implement interpolation by considering below example: en.json {
"hi": "Hello Mr. You're visitor number {n}"
} +page.svelte <p>{i('hi', { n: 4 })}</p> <!-- This does not works for me --> |
Beta Was this translation helpful? Give feedback.
-
Also @samuelstroschein , one last query, why are we not supporting node versions below 18? |
Beta Was this translation helpful? Give feedback.
-
@ivanhofer - I was able to complete the implementation post adding Just one feedback from my end, I came to know about this SDK after reading your Reddit post. In that post, you have mentioned to follow example which personally I didn't found helpful as compared with the latest one that you shared today! Taking this learning, I'll write a blogpost soon mentioning step-by-step approach required in setting SDK with SvelteKit and its limitations (for now) |
Beta Was this translation helpful? Give feedback.
-
Hello @ivanhofer @samuelstroschein @NilsJacobsen
Can we implement interpolation, pluralization and formatters with SvelteKit and inlang-sdk yet?
I am experimenting with inlang-sdk and SvelteKit and encountered few setbacks for which I was not able to find relevant information on internet.
I was not able to integrate typesafe-i18n into SDK, error encountered:
Since typesafe-i18n integration was not possible, is there any alternative to implement pluralization, interpolation and formatting (date / time / currency ) within inlang-sdk?
Minimal reproducible example: https://stackblitz.com/edit/sveltekit-i18n-inlang-sdk?file=inlang.config.js
Beta Was this translation helpful? Give feedback.
All reactions