diff options
| author | Adam Soltys <[email protected]> | 2023-05-02 14:09:51 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-05-02 14:09:51 -0700 |
| commit | 7f3dc05c74586f4777c4a51ebf2c831da91c6c0c (patch) | |
| tree | 687beb156c8654b1b4fc3a63955ece6c65a1844e /src/routes/+layout.server.js | |
| parent | 89b13556338c9a31e4d911decd4c67ce0fe6790b (diff) | |
| download | coinos-ui-7f3dc05c74586f4777c4a51ebf2c831da91c6c0c.tar.gz coinos-ui-7f3dc05c74586f4777c4a51ebf2c831da91c6c0c.zip | |
nfc wip
Diffstat (limited to 'src/routes/+layout.server.js')
| -rw-r--r-- | src/routes/+layout.server.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/routes/+layout.server.js b/src/routes/+layout.server.js new file mode 100644 index 00000000..53be7741 --- /dev/null +++ b/src/routes/+layout.server.js @@ -0,0 +1,8 @@ +import { loadTranslations, locale } from '$lib/translations'; +export const load = async ({ url }) => { + const { host, pathname } = url; + const defaultLocale = 'en'; // get from cookie, user session, ... + const initLocale = locale.get() || defaultLocale; // set default if no locale already set + await loadTranslations(initLocale, pathname); // keep this just before the `return` + return { host, pathname }; +}; |
