Merged in fix/my-pages-menu-not-translated (pull request #2045)
fix: my pages menu not translated * fix: my pages menu not translated fix: able to pass lang to getIntl() Approved-by: Michael Zetterberg
This commit is contained in:
@@ -16,8 +16,8 @@ export async function getMessages(lang: Lang): Promise<Record<string, string>> {
|
|||||||
return (await import(`./dictionaries/${lang}.json`)).default
|
return (await import(`./dictionaries/${lang}.json`)).default
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getIntl() {
|
export async function getIntl(options?: { lang: Lang | undefined }) {
|
||||||
const lang = getLang()
|
const lang = options?.lang || getLang()
|
||||||
|
|
||||||
if (!instances[lang]) {
|
if (!instances[lang]) {
|
||||||
const messages = await getMessages(lang)
|
const messages = await getMessages(lang)
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ export const getPrimaryLinks = cache(
|
|||||||
lang: Lang
|
lang: Lang
|
||||||
userLoyalty: UserLoyalty
|
userLoyalty: UserLoyalty
|
||||||
}): Promise<MyPagesLink[]> => {
|
}): Promise<MyPagesLink[]> => {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl({ lang })
|
||||||
|
|
||||||
const showSASLink = isScandicXSASActive(userLoyalty)
|
const showSASLink = isScandicXSASActive(userLoyalty)
|
||||||
const [showTeamMemberLink] = await safeTry(showTeamMemberCard())
|
const [showTeamMemberLink] = await safeTry(showTeamMemberCard())
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export async function getSecondaryLinks({
|
|||||||
}: {
|
}: {
|
||||||
lang: Lang
|
lang: Lang
|
||||||
}): Promise<MyPagesLink[]> {
|
}): Promise<MyPagesLink[]> {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl({ lang })
|
||||||
const menuItems: MyPagesLink[] = [
|
const menuItems: MyPagesLink[] = [
|
||||||
{
|
{
|
||||||
type: "link",
|
type: "link",
|
||||||
|
|||||||
Reference in New Issue
Block a user