Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
feat: implement dynamic language loading based on browser settings
Tonho8ef362644ae8
diff --git a/src/routes/+layout.ts b/src/routes/+layout.tsindex 9d248990..8fc56703 100644--- a/src/routes/+layout.ts+++ b/src/routes/+layout.ts@@ -1,5 +1,10 @@-// Tauri doesn't have a Node.js server to do proper SSR-// so we use adapter-static with a fallback to index.html to put the site in SPA mode-// See: https://svelte.dev/docs/kit/single-page-apps-// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info+import { loadTranslations, defaultLocale } from "$lib/i18n";+export const ssr = false;++export const load = async ({ url }) => {+ const browserLang = navigator.language || defaultLocale;+ const locale = browserLang.startsWith("en") ? "en" : "pt";+ await loadTranslations(locale, url.pathname);+ return {};+};