---
title: "Discussion on \"Internationalization in SvelteKit with typesafe-i18n\" | Hashnode"
description: "Discussion on \"Internationalization in SvelteKit with typesafe-i18n\". Internationalization in SvelteKit with typesafe-i18n, i18n in SvelteKit, Localization in SvelteKit, Translations in Sveltekit, typesafe-i18n"
url: "https://hashnode.com/posts/internationalization-in-sveltekit-with-typesafe-i18n/64c93ed98d4242e0d691bd7f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Internationalization in SvelteKit with typesafe-i18n](https://blog.aakashgoplani.in/internationalization-in-sveltekit-with-typesafe-i18n?utm_source=hashnode&utm_medium=feed)

Internationalization in SvelteKit with typesafe-i18n, i18n in SvelteKit, Localization in SvelteKit, Translations in Sveltekit, typesafe-i18n

Aug 1, 2023 · 14 min read · blog.aakashgoplani.in  
Read the article

-   [#sveltekit](https://hashnode.com/tag/sveltekit)
-   [#i18n](https://hashnode.com/tag/i18n)
-   [#internationalization](https://hashnode.com/tag/internationalization)
-   [#localization](https://hashnode.com/tag/localization)
-   [#typesafe-i18n](https://hashnode.com/tag/typesafe-i18n)

## Written by

[Aakash Goplani](https://hashnode.com/@aakashgoplani)

@aakashgoplani · Mumbai, India

  
[View profile](https://hashnode.com/@aakashgoplani)

Frontend Dev. Mostly Angular and Svelte.

Senior Frontend Dev. Mostly Angular and Svelte. I will be sharing my day-to-day learning experiences here with the community.

## Responses 2

Markdown supported · ⌘↵ to post

[Jannes Blobel](https://hashnode.com/@jannesblobel)

[Nov 6, 2023](https://hashnode.com/posts/internationalization-in-sveltekit-with-typesafe-i18n/64c93ed98d4242e0d691bd7f/comment/6548abf59575bde06d3aa763)

Hey [Aakash Goplani](https://hashnode.com/@aakashgoplani), I stumbled across your post about Typesafe and how to implement it.

It is a great-written article on how to use it. Unfortunately, the lib. will not be further maintained, as the maintainer has passed away. Ivan worked on a new lib at inlang. But he couldn't finish it either.

As the inlang team, we have decided to continue developing this library and dedicate an homage to him with the name paraglideJs. He was an enthusiastic paraglider.

[Patrick](https://hashnode.com/@Patrick91)

[Aug 12, 2023](https://hashnode.com/posts/internationalization-in-sveltekit-with-typesafe-i18n/64c93ed98d4242e0d691bd7f/comment/64d7f332102c3648a77c7bc5)

Thank you for your article.

I just implemented it in my SvelteKit app as described, with EN and DE and without a language switch, but with hooks.server.ts and +layout.ts

When I refresh a page, it shows (correctly) the DE translations for a split second, then it changes to en. I also update the html lang in my hook and notice that it's correct with DE. Therefore something is wrong with the client side. It always changes the locale to EN, no matter what I do. If I call setLocale() in a +page.svelte file manually, it changes to DE but it does not show a single DE translation. Do you have any clue?

[Aakash Goplani](https://hashnode.com/@aakashgoplani)

[Aug 12, 2023](https://hashnode.com/posts/internationalization-in-sveltekit-with-typesafe-i18n/64c93ed98d4242e0d691bd7f/comment/64d7f332102c3648a77c7bc5#reply-64d80894102c3648a77c7c8c)

Hello Patrick,

Are you using sessionstorage properly with key as "lang"?

You can refer section "4. Detect the locale on the client side" and "Locale Switching".

I know you are not switching locales but this section will give you idea on how to use session storage for persisting user locale.

[Patrick](https://hashnode.com/@Patrick91)

[Aug 12, 2023](https://hashnode.com/posts/internationalization-in-sveltekit-with-typesafe-i18n/64c93ed98d4242e0d691bd7f/comment/64d7f332102c3648a77c7bc5#reply-64d80f6fd459393b57af9ba5)

[Aakash Goplani](https://hashnode.com/@aakashgoplani) Thank you! I'm not using the session storage key (just want to use the browser detection for the moment) and detectLocale(sessionStorageDetector) will then use the fallback EN, so the || will never be called. I just removed it and it works now.
