~/talk

Internationalization in SvelteKit and How to Prevent Mistakes

Talkat Svelte Summit Fall 2021 · on Saturday, 2021-11-20· [web-platform, javascript]
slides:none on file

Sets up typesafe-i18n in SvelteKit in under ten minutes, installing a generator that watches translation files and emits TypeScript types so missing keys or wrong interpolation types fail at compile time. Shows language detection from request headers via hooks getSession, a language-switcher that lazy-loads locales on demand, a dynamic /lang route with pushState and popstate handling, fixes for SSR URL-language mismatch and an HTML lang workaround, and notes the bundle is tiny (~1 KB) with source repos on GitHub.

AI-written summary · about

  1. 0:00Introduction to i18n
  2. 1:03Setting up the library
  3. 2:31Handling dynamic variables
  4. 3:42Benefits of type safety
  5. 4:20Auto-detecting user language
  6. 5:25Manual language switching
  7. 6:31Persisting language in URL
  8. 8:08Fixing SSR and routing
  9. 9:23Advanced features and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.