-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use handle hook instead of layout load to get cookie
- Loading branch information
1 parent
ea1f31c
commit 62611dd
Showing
6 changed files
with
31 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { getTranslator } from '$lib/i18n/index.js'; | ||
import { getSupportedLocale, defaultLocale } from '$lib/i18n/locales'; | ||
|
||
export async function load({ params, data }) { | ||
export async function load({ params }) { | ||
const locale = getSupportedLocale(params?.lang); // will use default locale if no lang param | ||
const t = await getTranslator(locale); | ||
const base = locale === defaultLocale ? '/' : `/${locale}/`; | ||
const userSettings = data.userSettings; | ||
return { locale, t, base, userSettings }; | ||
return { locale, t, base }; | ||
} |