Skip to content

Commit

Permalink
Add translation fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
RunarVestmann committed Nov 28, 2024
1 parent e2d531c commit fc46488
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/web/components/LanguageToggler/LanguageToggler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,11 @@ export const LanguageToggler = ({
<DialogPrompt
baseId={dialogId}
initialVisibility={true}
title={gn('switchToEnglishModalTitle')}
description={gn('switchToEnglishModalText')}
title={gn('switchToEnglishModalTitle', 'Translation not available')}
description={gn(
'switchToEnglishModalText',
'The page you are viewing does not have an English translation yet',
)}
ariaLabel="Confirm switching to english"
disclosureElement={Disclosure}
onConfirm={() => {
Expand Down
7 changes: 7 additions & 0 deletions apps/web/screens/Organization/Standalone/Level1Sitemap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
QueryGetOrganizationPageArgs,
QueryGetOrganizationPageStandaloneSitemapLevel1Args,
} from '@island.is/web/graphql/schema'
import useContentfulId from '@island.is/web/hooks/useContentfulId'
import { StandaloneLayout } from '@island.is/web/layouts/organization/standalone'
import type { Screen, ScreenContext } from '@island.is/web/types'
import { CustomNextError } from '@island.is/web/units/errors'
Expand All @@ -25,6 +26,11 @@ import {

const GRID_COLUMN_SPAN: SpanType = ['1/1', '1/1', '1/1', '1/2', '1/3']

const LanguageToggleSetup = (props: { ids: string[] }) => {
useContentfulId(...props.ids)
return null
}

type StandaloneLevel1SitemapScreenContext = ScreenContext & {
organizationPage?: Query['getOrganizationPage']
}
Expand All @@ -50,6 +56,7 @@ const StandaloneLevel1Sitemap: Screen<
title: `${categoryTitle} | ${organizationPage.title}`,
}}
>
<LanguageToggleSetup ids={[organizationPage.id]} />
<GridContainer>
<GridRow>
<GridColumn span={['9/9', '9/9', '7/9']} offset={['0', '0', '1/9']}>
Expand Down

0 comments on commit fc46488

Please sign in to comment.