Skip to content

Commit

Permalink
fix: add translations for breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Valur committed Oct 22, 2024
1 parent 28f6a63 commit 514a905
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/web/screens/OfficialJournalOfIceland/OJOIAdvert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const OJOIAdvertPage: CustomScreen<OJOIAdvertProps> = ({

const breadcrumbItems = [
{
title: 'Ísland.is',
title: formatMessage(m.breadcrumb.frontpage),
href: linkResolver('homepage', [], locale).href,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ const OJOICasesInProgressPage: CustomScreen<OJOICasesInProgressProps> = ({

const breadcrumbItems = [
{
title: 'Ísland.is',
title: formatMessage(m.breadcrumb.frontpage),
href: linkResolver('homepage', [], locale).href,
},
{
title: organization?.title ?? '',
href: baseUrl,
},
{
title: 'Mál í vinnslu',
title: formatMessage(m.casesInProgress.title),
},
]

Expand Down
4 changes: 2 additions & 2 deletions apps/web/screens/OfficialJournalOfIceland/OJOICategories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ const OJOICategoriesPage: CustomScreen<OJOICategoriesProps> = ({

const breadcrumbItems = [
{
title: 'Ísland.is',
title: formatMessage(m.breadcrumb.frontpage),
href: linkResolver('homepage', [], locale).href,
},
{
title: organization?.title ?? '',
href: baseUrl,
},
{
title: 'Málaflokkar',
title: formatMessage(m.categories.breadcrumbTitle),
},
]

Expand Down
2 changes: 1 addition & 1 deletion apps/web/screens/OfficialJournalOfIceland/OJOIHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const OJOIHomePage: CustomScreen<OJOIHomeProps> = ({

const breadcrumbItems = [
{
title: 'Ísland.is',
title: formatMessage(m.breadcrumb.frontpage),
href: linkResolver('homepage', [], locale).href,
},
{
Expand Down
4 changes: 2 additions & 2 deletions apps/web/screens/OfficialJournalOfIceland/OJOISearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ const OJOISearchPage: CustomScreen<OJOISearchProps> = ({

const breadcrumbItems = [
{
title: 'Ísland.is',
title: formatMessage(m.breadcrumb.frontpage),
href: linkResolver('homepage', [], locale).href,
},
{
title: organization?.title ?? '',
href: baseUrl,
},
{
title: 'Leitarniðurstöður',
title: formatMessage(m.search.breadcrumbTitle),
},
]

Expand Down
14 changes: 14 additions & 0 deletions apps/web/screens/OfficialJournalOfIceland/messages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { defineMessages } from 'react-intl'

export const m = {
breadcrumb: defineMessages({
frontpage: {
id: 'web.ojoi.breadcrumb.frontpage',
defaultMessage: 'Ísland.is',
},
}),
general: defineMessages({
seeMore: {
id: 'web.ojoi:general.seeMore',
Expand Down Expand Up @@ -59,6 +65,10 @@ export const m = {
defaultMessage:
'Ekki náðist samband við vefþjónustur Stjórnartíðinda, reynið aftur síðar.',
},
breadcrumbTitle: {
id: 'web.ojoi:search.breadcrumbTitle',
defaultMessage: 'Leitarniðurstöður',
},
title: {
id: 'web.ojoi:search.title',
defaultMessage: 'Leit í Stjórnartíðindum',
Expand Down Expand Up @@ -167,6 +177,10 @@ export const m = {
}),

categories: defineMessages({
breadcrumbTitle: {
id: 'web.ojoi:categories.breadcrumbTitle',
defaultMessage: 'Málaflokkar',
},
title: {
id: 'web.ojoi:categories.title',
defaultMessage: 'Málaflokkar Stjórnartíðinda',
Expand Down

0 comments on commit 514a905

Please sign in to comment.