From b173dd8c4e2fc1847ee260daf546a7115791a416 Mon Sep 17 00:00:00 2001 From: albert Date: Mon, 9 Nov 2020 07:43:27 +0100 Subject: [PATCH] refactor: rename startI18nClient --- src/client.ts | 6 +++--- src/services/i18n.ts | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/client.ts b/src/client.ts index 882ccef..c164fca 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,9 +1,9 @@ import * as sapper from "@sapper/app"; import "carbon-components-svelte/css/g10.css"; -import { startClient } from "./services/i18n.js"; +import { startI18nClient } from "services/i18n"; -startClient(); +startI18nClient(); sapper.start({ - target: document.getElementById("sapper"), + target: document.getElementById("sapper") }); diff --git a/src/services/i18n.ts b/src/services/i18n.ts index 17f5e46..d2c9909 100644 --- a/src/services/i18n.ts +++ b/src/services/i18n.ts @@ -11,7 +11,6 @@ import { getCookie, setCookie } from "modules/cookie"; const INIT_OPTIONS: ConfigureOptions = { fallbackLocale: "en", - initialLocale: null, loadingDelay: 200, formats: { number: { @@ -43,7 +42,7 @@ $locale.subscribe((locale: string) => { if (typeof window !== "undefined") setCookie("locale", locale); }); -export const startClient = () => { +export const startI18nClient = () => { init({ ...INIT_OPTIONS, initialLocale: getCookie("locale") || getLocaleFromNavigator(),