Skip to content

Commit

Permalink
Let me guess: sveltekit-i18n was not been tested for this use case
Browse files Browse the repository at this point in the history
  • Loading branch information
qgustavor committed May 26, 2024
1 parent eafeefb commit 09dd750
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/AppHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$: ({ route } = $page.data)
function changeLocale (locale) {
window.location = `/mkv-extract/${locale}${route.slice(15)}`
window.location = `/mkv-extract/${locale}${route}`
}
let theme = 'g90'
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const load = async ({ url, params }) => {
const { pathname } = url

const lang = params.lang ?? (pathname.match(/\/(en|pt)\//)?.[0] || 'en')
const route = pathname.replace(new RegExp(`/${lang}/`), '/')
const route = pathname.replace(new RegExp(`/mkv-extract/${lang}/`), '/')

await setLocale(lang)
await setRoute(route)
Expand Down

0 comments on commit 09dd750

Please sign in to comment.