diff --git a/apps/scandic-web/i18n/index.ts b/apps/scandic-web/i18n/index.ts index 6fdb994fb..8d72b208f 100644 --- a/apps/scandic-web/i18n/index.ts +++ b/apps/scandic-web/i18n/index.ts @@ -16,8 +16,8 @@ export async function getMessages(lang: Lang): Promise> { return (await import(`./dictionaries/${lang}.json`)).default } -export async function getIntl() { - const lang = getLang() +export async function getIntl(options?: { lang: Lang | undefined }) { + const lang = options?.lang || getLang() if (!instances[lang]) { const messages = await getMessages(lang) diff --git a/apps/scandic-web/server/routers/navigation/mypages/getPrimaryLinks.ts b/apps/scandic-web/server/routers/navigation/mypages/getPrimaryLinks.ts index 5f245938e..f1ab9e0c7 100644 --- a/apps/scandic-web/server/routers/navigation/mypages/getPrimaryLinks.ts +++ b/apps/scandic-web/server/routers/navigation/mypages/getPrimaryLinks.ts @@ -19,7 +19,8 @@ export const getPrimaryLinks = cache( lang: Lang userLoyalty: UserLoyalty }): Promise => { - const intl = await getIntl() + const intl = await getIntl({ lang }) + const showSASLink = isScandicXSASActive(userLoyalty) const [showTeamMemberLink] = await safeTry(showTeamMemberCard()) diff --git a/apps/scandic-web/server/routers/navigation/mypages/getSecondaryLinks.ts b/apps/scandic-web/server/routers/navigation/mypages/getSecondaryLinks.ts index d8f0d46ec..d57fce926 100644 --- a/apps/scandic-web/server/routers/navigation/mypages/getSecondaryLinks.ts +++ b/apps/scandic-web/server/routers/navigation/mypages/getSecondaryLinks.ts @@ -10,7 +10,7 @@ export async function getSecondaryLinks({ }: { lang: Lang }): Promise { - const intl = await getIntl() + const intl = await getIntl({ lang }) const menuItems: MyPagesLink[] = [ { type: "link",