Skip to content

Commit

Permalink
Remove locale.get on server
Browse files Browse the repository at this point in the history
  • Loading branch information
jarda-svoboda committed Jul 12, 2023
1 parent ee52360 commit 989bdb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions examples/component-scoped-csr/src/routes/+layout.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { locale, loadTranslations } from '$lib/translations';
import { loadTranslations } from '$lib/translations';

/** @type {import('@sveltejs/kit').Load} */
export const load = async ({ url }) => {
const { pathname } = url;

const defaultLocale = 'en'; // get from cookie / user session etc...

const initLocale = locale.get() || defaultLocale;
const initLocale = 'en'; // get from cookie / user session etc...

await loadTranslations(initLocale, pathname); // keep this just before the `return`

Expand Down
6 changes: 2 additions & 4 deletions examples/fallback-locale/src/routes/+layout.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { locale, loadTranslations } from '$lib/translations';
import { loadTranslations } from '$lib/translations';

/** @type {import('@sveltejs/kit').Load} */
export const load = async ({ url }) => {
const { pathname } = url;

const defaultLocale = 'cs'; // get from cookie, user session, ...

const initLocale = locale.get() || defaultLocale;
const initLocale = 'cs'; // get from cookie, user session, ...

await loadTranslations(initLocale, pathname); // keep this just before the `return`

Expand Down

0 comments on commit 989bdb0

Please sign in to comment.