i18next / i18next-gitbook

165 stars 172 forks source link

add support for svelte framework: svelte-i18next #194

Closed NishuGoel closed 2 years ago

NishuGoel commented 2 years ago

Adds support for svelte framework as the svelte-i18next wrapper does the i18next implementation for svelte framework.

GitHub: https://github.com/NishuGoel/svelte-i18next NPM: https://www.npmjs.com/package/svelte-i18next

Checklist (for documentation change)

adrai commented 2 years ago

Cool...

Would be nice if there was some sort of Suspense (fallback UI) until the translations are loaded, when using a backend like i18next-http-backend. This way some debug warnings would be prevented... (debug: true)

image

@NishuGoel for example svelte-i18n is offering an isLoading flag: https://github.com/kaisermann/svelte-i18n/blob/b9a9f46170583de6949c270b4e14651bfee4e472/docs/Locale.md#isloading react-i18next is using Suspense or a ready flag: https://react.i18next.com/latest/usetranslation-hook#not-using-suspense The important part is to not call t() before the translations are loaded.