From 580a021d9b056c4c96c67f411ee5d21bbf2e8f87 Mon Sep 17 00:00:00 2001 From: Remko Date: Tue, 3 Oct 2023 16:50:57 +0200 Subject: [PATCH 1/7] Added text changes and bugfix --- pwa/src/services/getNameFromBijlageArray.ts | 1 + pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx | 2 +- .../tableResultsTemplate/TableResultsTemplate.tsx | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pwa/src/services/getNameFromBijlageArray.ts b/pwa/src/services/getNameFromBijlageArray.ts index 103472fc..65cb1376 100644 --- a/pwa/src/services/getNameFromBijlageArray.ts +++ b/pwa/src/services/getNameFromBijlageArray.ts @@ -1,3 +1,4 @@ export const getBijlageTitleFromURL = (url: string, bijlagen: any[]): string | undefined => { + if (bijlagen === undefined) return undefined; return bijlagen.find((bijlage) => bijlage.URL_Bijlage === url)?.Titel_Bijlage; }; diff --git a/pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx b/pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx index 7b6243c1..5525693e 100644 --- a/pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx +++ b/pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx @@ -13,7 +13,7 @@ export const JumbotronTemplate: React.FC = () => { Woo-publicaties van {process.env.GATSBY_ORGANISATION_NAME} - Op deze pagina vind u de Woo-publicaties van {process.env.GATSBY_ORGANISATION_NAME} + Op deze pagina vindt u de Woo-publicaties van {process.env.GATSBY_ORGANISATION_NAME} diff --git a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx index 0b939e4f..278146ff 100644 --- a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx +++ b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx @@ -34,7 +34,7 @@ export const TableResultsTemplate: React.FC = ({ requ {requests.map((request) => ( navigate(request.id)}> - {request.Titel !== "" ? request.Titel : "Geen titel beschikbaar"} + {request.Titel ?? "Geen titel beschikbaar"} {request.Categorie ?? "-"} {request.Publicatiedatum @@ -51,7 +51,7 @@ export const TableResultsTemplate: React.FC = ({ requ ? translateDate(i18n.language, request.Besluitdatum) : "Geen besluitdatum beschikbaar"} - {request.Besluit !== "" ? request.Besluit : "Geen besluit beschikbaar"} + {request.Besluit ?? "Geen besluit beschikbaar"} ))} From 08234c663fc6c0d9ed725605ed742bc8c95d3a30 Mon Sep 17 00:00:00 2001 From: Remko Date: Fri, 6 Oct 2023 10:40:49 +0200 Subject: [PATCH 2/7] added part of requested changes --- .../CardsResultsTemplate.tsx | 1 - .../templateParts/footer/FooterTemplate.tsx | 18 ++++--- .../TableResultsTemplate.tsx | 22 ++------ .../WOOItemDetailTemplate.tsx | 51 ++++++++----------- 4 files changed, 34 insertions(+), 58 deletions(-) diff --git a/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx b/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx index 6dbf4a06..59321fd3 100644 --- a/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx +++ b/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx @@ -22,7 +22,6 @@ export const CardsResultsTemplate: React.FC = ({ requ navigate(request.id)}> - {" "} {request.Publicatiedatum ? translateDate(i18n.language, request.Publicatiedatum) : "N.v.t."} diff --git a/pwa/src/templates/templateParts/footer/FooterTemplate.tsx b/pwa/src/templates/templateParts/footer/FooterTemplate.tsx index 500bd659..8d5a8ee8 100644 --- a/pwa/src/templates/templateParts/footer/FooterTemplate.tsx +++ b/pwa/src/templates/templateParts/footer/FooterTemplate.tsx @@ -11,14 +11,16 @@ export const FooterTemplate: React.FC = () => {
- - process.env.GATSBY_FOOTER_LOGO_HREF ? open(process.env.GATSBY_FOOTER_LOGO_HREF) : navigate("/") - } - src={process.env.GATSBY_FOOTER_LOGO_URL} - alt={"Footer-logo"} - /> + {process.env.GATSBY_FOOTER_LOGO_URL !== "false" && ( + + process.env.GATSBY_FOOTER_LOGO_HREF ? open(process.env.GATSBY_FOOTER_LOGO_HREF) : navigate("/") + } + src={process.env.GATSBY_FOOTER_LOGO_URL} + alt={"Footer-logo"} + /> + )}
diff --git a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx index 278146ff..0e12ff27 100644 --- a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx +++ b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx @@ -23,35 +23,21 @@ export const TableResultsTemplate: React.FC = ({ requ - Woo-verzoek - Categorie + Onderwerp Publicatiedatum - Ontvangstdatum - Besluitdatum - Besluit + Samenvatting {requests.map((request) => ( navigate(request.id)}> - {request.Titel ?? "Geen titel beschikbaar"} - {request.Categorie ?? "-"} + {request.Titel ?? "Geen onderwerp beschikbaar"} {request.Publicatiedatum ? translateDate(i18n.language, request.Publicatiedatum) : "Geen publicatiedatum beschikbaar"} - - {request.Ontvangstdatum - ? translateDate(i18n.language, request.Ontvangstdatum) - : "Geen ontvanstdatum beschikbaar"} - - - {request.Besluitdatum - ? translateDate(i18n.language, request.Besluitdatum) - : "Geen besluitdatum beschikbaar"} - - {request.Besluit ?? "Geen besluit beschikbaar"} + {request.Samenvatting ?? "Geen samenvatting beschikbaar"} ))} diff --git a/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx b/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx index 56a305a7..c9029d72 100644 --- a/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx +++ b/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx @@ -109,13 +109,6 @@ export const WOOItemDetailTemplate: React.FC = ({ wo )} - {getItems.data.Besluit && ( - - {t("Besluit")} - {getItems.data.Besluit} - - )} - {getItems.data?.embedded?.Themas && ( {t("Thema's")} @@ -131,7 +124,7 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {getItems.data.URL_informatieverzoek && ( - {t("Bijlage informatieverzoek")} + {t("Informatieverzoek")} {getBijlageTitleFromURL( @@ -143,35 +136,31 @@ export const WOOItemDetailTemplate: React.FC = ({ wo )} - {getItems.data.URL_inventarisatielijst && ( + {(getItems.data.Besluit || getItems.data.URL_besluit) && ( - {t("Bijlage inventarisatielijst")} + {t("Besluit")} - - {getBijlageTitleFromURL( - getItems.data.URL_inventarisatielijst, - getItems.data?.embedded?.Bijlagen, - ) ?? getPDFName(getItems.data.URL_inventarisatielijst)} - - <> - {console.log( - getBijlageTitleFromURL( - getItems.data.URL_inventarisatielijst, - getItems.data?.embedded?.Bijlagen, - ), - )} - + {getItems.data.Besluit} + {getItems.data.Besluit && getItems.data.URL_besluit && ","}{" "} + {getItems.data.URL_besluit && ( + + {getBijlageTitleFromURL(getItems.data.URL_besluit, getItems.data?.embedded?.Bijlagen) ?? + getPDFName(getItems.data.URL_besluit)} + + )} )} - {getItems.data.URL_besluit && ( + {getItems.data.URL_inventarisatielijst && ( - {t("Bijlage besluit")} + {t("Inventarisatielijst")} - - {getBijlageTitleFromURL(getItems.data.URL_besluit, getItems.data?.embedded?.Bijlagen) ?? - getPDFName(getItems.data.URL_besluit)} + + {getBijlageTitleFromURL( + getItems.data.URL_inventarisatielijst, + getItems.data?.embedded?.Bijlagen, + ) ?? getPDFName(getItems.data.URL_inventarisatielijst)} @@ -185,8 +174,8 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {getItems.data?.embedded?.Bijlagen.map((bijlage: any, idx: number) => ( {bijlage.Titel_Bijlage} From ead6920aa2ddb8665e15d61f924ada9802388441 Mon Sep 17 00:00:00 2001 From: Remko Date: Fri, 6 Oct 2023 14:04:52 +0200 Subject: [PATCH 3/7] added part of WCAG requirements and added translations --- pwa/gatsby-config.js | 6 +++ .../ParsedHTML/ParsedHTML.module.css | 7 ---- pwa/src/components/ParsedHTML/ParsedHTML.tsx | 42 ------------------- .../ResultsDisplaySwitch.tsx | 8 +++- pwa/src/layout/Head.tsx | 14 +++++-- pwa/src/styling/global.css | 9 ++++ .../jumbotronTemplate/JumbotronTemplate.tsx | 9 +++- .../CardsResultsTemplate.tsx | 8 ++-- .../templateParts/filters/FiltersTemplate.tsx | 17 +++++--- .../templateParts/footer/FooterTemplate.tsx | 19 +++++++-- .../templateParts/header/HeaderTemplate.tsx | 8 ++-- .../TableResultsTemplate.tsx | 14 +++---- .../WOOItemDetailTemplate.tsx | 31 +++++++------- pwa/src/translations/en.ts | 36 +++++++++++++++- pwa/src/translations/nl.ts | 36 +++++++++++++++- 15 files changed, 167 insertions(+), 97 deletions(-) delete mode 100644 pwa/src/components/ParsedHTML/ParsedHTML.module.css delete mode 100644 pwa/src/components/ParsedHTML/ParsedHTML.tsx diff --git a/pwa/gatsby-config.js b/pwa/gatsby-config.js index 72472fa9..80e8e9da 100644 --- a/pwa/gatsby-config.js +++ b/pwa/gatsby-config.js @@ -28,6 +28,12 @@ module.exports = { separator: ".", }, autoGenHomeLabel: "Home", + crumbLabelUpdates: [ + { + pathname: "/[id]", + crumbLabel: "Details page", + }, + ], }, }, ], diff --git a/pwa/src/components/ParsedHTML/ParsedHTML.module.css b/pwa/src/components/ParsedHTML/ParsedHTML.module.css deleted file mode 100644 index 92ad9a26..00000000 --- a/pwa/src/components/ParsedHTML/ParsedHTML.module.css +++ /dev/null @@ -1,7 +0,0 @@ -.container { - margin-block-start: var(--utrecht-space-block-3xl); -} - -.container > div > article > *:not(:last-child) { - margin-block-end: var(--utrecht-space-block-lg); -} diff --git a/pwa/src/components/ParsedHTML/ParsedHTML.tsx b/pwa/src/components/ParsedHTML/ParsedHTML.tsx deleted file mode 100644 index eb3da884..00000000 --- a/pwa/src/components/ParsedHTML/ParsedHTML.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from "react"; -import * as styles from "./ParsedHTML.module.css"; -import Parser from "html-react-parser"; -import Skeleton from "react-loading-skeleton"; -import { Alert } from "@utrecht/component-library-react/dist/css-module"; -import { UseQueryResult } from "react-query"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faWarning } from "@fortawesome/free-solid-svg-icons"; -import clsx from "clsx"; -import { useHtmlParser } from "../../hooks/htmlParser/useHtmlParser"; - -interface ParsedHTMLProps { - contentQuery: UseQueryResult; - location: string; - layoutClassName?: string; -} - -export const ParsedHTML: React.FC = ({ contentQuery, location, layoutClassName }) => { - const { options } = useHtmlParser(location); - - if (contentQuery.isLoading) - return ( -
- -
- ); - - if (contentQuery.isError) - return ( -
- } type="error"> - Oops, something went wrong retrieving the .md file from GitHub. - -
- ); - - return ( -
- {Parser(contentQuery.data, options)} -
- ); -}; diff --git a/pwa/src/components/resultsDisplaySwitch/ResultsDisplaySwitch.tsx b/pwa/src/components/resultsDisplaySwitch/ResultsDisplaySwitch.tsx index ae1a137b..cd09666e 100644 --- a/pwa/src/components/resultsDisplaySwitch/ResultsDisplaySwitch.tsx +++ b/pwa/src/components/resultsDisplaySwitch/ResultsDisplaySwitch.tsx @@ -5,6 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faGripVertical, faTable } from "@fortawesome/free-solid-svg-icons"; import { useDisplayContext } from "../../context/displays"; import { Button, ButtonGroup } from "@utrecht/component-library-react/dist/css-module"; +import { useTranslation } from "react-i18next"; interface ResultsDisplaySwitchProps { displayKey: string; // should implement with an unique key @@ -13,6 +14,7 @@ interface ResultsDisplaySwitchProps { const ResultsDisplaySwitch: React.FC = ({ layoutClassName, displayKey }) => { const { setDisplay, isActive } = useDisplayContext(); + const { t } = useTranslation(); return ( @@ -20,16 +22,18 @@ const ResultsDisplaySwitch: React.FC = ({ layoutClass appearance={isActive(displayKey, "cards") ? "primary-action-button" : "secondary-action-button"} className={styles.button} onClick={() => setDisplay({ [displayKey]: "cards" })} + discription={t("Show cards")} > - Tegels + {t("Cards")} ); diff --git a/pwa/src/layout/Head.tsx b/pwa/src/layout/Head.tsx index 4b30e7b6..24fb43ad 100644 --- a/pwa/src/layout/Head.tsx +++ b/pwa/src/layout/Head.tsx @@ -4,19 +4,27 @@ import "../styling/index.css"; import { Helmet } from "react-helmet"; import { getPageTitle } from "../services/getPageTitle"; import { useGatsbyContext } from "../context/gatsby"; +import { useTranslation } from "react-i18next"; export const Head: React.FC = () => { const { gatsbyContext } = useGatsbyContext(); + const { t } = useTranslation(); + + const translatedCrumbs = gatsbyContext.pageContext?.breadcrumb.crumbs.map((crumb: any) => ({ + ...crumb, + crumbLabel: t(_.upperFirst(crumb.crumbLabel)), + })); return ( - {`Woo | ${ - getPageTitle(gatsbyContext.pageContext?.breadcrumb.crumbs, gatsbyContext.location) ?? "Error" - }`} + {`Woo | ${getPageTitle(translatedCrumbs, gatsbyContext.location) ?? "Error"}`} ); diff --git a/pwa/src/styling/global.css b/pwa/src/styling/global.css index 31ab09cb..e49edc47 100644 --- a/pwa/src/styling/global.css +++ b/pwa/src/styling/global.css @@ -9,3 +9,12 @@ html, body { margin: 0; } + +.utrecht-link { + display: flex; + align-items: center; +} + +.utrecht-link > svg { + margin-inline-end: var(--utrecht-icon-gap); +} diff --git a/pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx b/pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx index 5525693e..35aed429 100644 --- a/pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx +++ b/pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx @@ -2,18 +2,23 @@ import * as React from "react"; import * as styles from "./JumbotronTemplate.module.css"; import { Heading2, Paragraph, Page, PageContent } from "@utrecht/component-library-react/dist/css-module"; import { CardWrapper } from "@conduction/components/lib/components/card"; +import { useTranslation } from "react-i18next"; export const JumbotronTemplate: React.FC = () => { + const { t } = useTranslation(); + return (
- Woo-publicaties van {process.env.GATSBY_ORGANISATION_NAME} + + {t("Woo-publications of")} {process.env.GATSBY_ORGANISATION_NAME} + - Op deze pagina vindt u de Woo-publicaties van {process.env.GATSBY_ORGANISATION_NAME} + {t("On this page you will find the Woo-publications of")} {process.env.GATSBY_ORGANISATION_NAME}
diff --git a/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx b/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx index 59321fd3..eca5443d 100644 --- a/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx +++ b/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx @@ -1,8 +1,6 @@ import * as React from "react"; import * as styles from "./CardsResultsTemplate.module.css"; import { Heading2, Paragraph } from "@utrecht/component-library-react/dist/css-module"; -import { faClock } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { translateDate } from "../../../services/dateFormat"; import { useTranslation } from "react-i18next"; import { navigate } from "gatsby"; @@ -13,7 +11,7 @@ interface CardsResultsTemplateProps { } export const CardsResultsTemplate: React.FC = ({ requests }) => { - const { i18n } = useTranslation(); + const { t, i18n } = useTranslation(); return ( <> @@ -22,10 +20,10 @@ export const CardsResultsTemplate: React.FC = ({ requ navigate(request.id)}> - {request.Publicatiedatum ? translateDate(i18n.language, request.Publicatiedatum) : "N.v.t."} + {request.Publicatiedatum ? translateDate(i18n.language, request.Publicatiedatum) : t("N/A")} - {request.Titel ?? "Geen titel beschikbaar"} + {request.Titel ?? t("No title available")} diff --git a/pwa/src/templates/templateParts/filters/FiltersTemplate.tsx b/pwa/src/templates/templateParts/filters/FiltersTemplate.tsx index 70e2300f..3f2d4428 100644 --- a/pwa/src/templates/templateParts/filters/FiltersTemplate.tsx +++ b/pwa/src/templates/templateParts/filters/FiltersTemplate.tsx @@ -9,6 +9,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faMagnifyingGlass, faSpinner } from "@fortawesome/free-solid-svg-icons"; import { generateYearsArray } from "../../../data/years"; import { TEMP_PUBLICATION_TYPES } from "../../../data/PublicationType"; +import { useTranslation } from "react-i18next"; interface FiltersTemplateProps { isLoading: boolean; @@ -16,6 +17,7 @@ interface FiltersTemplateProps { export const FiltersTemplate: React.FC = ({ isLoading }) => { const { filters, setFilters } = useFiltersContext(); + const { t } = useTranslation(); const filterTimeout = React.useRef(null); const { @@ -49,27 +51,30 @@ export const FiltersTemplate: React.FC = ({ isLoading }) = return (
- - + - option.value === filters.Categorie)} isClearable {...{ register, errors, control }} /> diff --git a/pwa/src/templates/templateParts/footer/FooterTemplate.tsx b/pwa/src/templates/templateParts/footer/FooterTemplate.tsx index 8d5a8ee8..950062b2 100644 --- a/pwa/src/templates/templateParts/footer/FooterTemplate.tsx +++ b/pwa/src/templates/templateParts/footer/FooterTemplate.tsx @@ -1,12 +1,14 @@ import * as React from "react"; import * as styles from "./FooterTemplate.module.css"; - import { PageFooter, Link } from "@utrecht/component-library-react/dist/css-module"; import { navigate } from "gatsby-link"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCode } from "@fortawesome/free-solid-svg-icons"; +import { useTranslation } from "react-i18next"; export const FooterTemplate: React.FC = () => { + const { t } = useTranslation(); + return (
@@ -23,7 +25,12 @@ export const FooterTemplate: React.FC = () => { )}
- + {" "} with{" "} @@ -31,11 +38,17 @@ export const FooterTemplate: React.FC = () => { className={styles.link} href="https://github.com/ConductionNL/woo-website-template/graphs/contributors" target="_blank" + name={t("Link to github contributors page")} > ❤️ {" "} by{" "} - + Conduction.
diff --git a/pwa/src/templates/templateParts/header/HeaderTemplate.tsx b/pwa/src/templates/templateParts/header/HeaderTemplate.tsx index 6e094129..c39c8cbb 100644 --- a/pwa/src/templates/templateParts/header/HeaderTemplate.tsx +++ b/pwa/src/templates/templateParts/header/HeaderTemplate.tsx @@ -1,15 +1,17 @@ import * as React from "react"; import * as styles from "./HeaderTemplate.module.css"; - +import clsx from "clsx"; import { PageHeader } from "@utrecht/component-library-react/dist/css-module"; import { navigate } from "gatsby"; -import clsx from "clsx"; +import { useTranslation } from "react-i18next"; interface HeaderTemplateProps { layoutClassName: string; } export const HeaderTemplate: React.FC = ({ layoutClassName }) => { + const { t } = useTranslation(); + return (
@@ -18,7 +20,7 @@ export const HeaderTemplate: React.FC = ({ layoutClassName className={styles.image} onClick={() => navigate("/")} src={process.env.GATSBY_HEADER_LOGO_URL} - alt={"Navbar-logo"} + alt={t("Navbar-Logo")} />
diff --git a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx index 0e12ff27..85272347 100644 --- a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx +++ b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx @@ -17,27 +17,27 @@ interface TableResultsTemplateProps { } export const TableResultsTemplate: React.FC = ({ requests }) => { - const { i18n } = useTranslation(); + const { t, i18n } = useTranslation(); return (
- Onderwerp - Publicatiedatum - Samenvatting + {t("Subject")} + {t("Publication date")} + {t("Summary")} {requests.map((request) => ( navigate(request.id)}> - {request.Titel ?? "Geen onderwerp beschikbaar"} + {request.Titel ?? t("No subject available")} {request.Publicatiedatum ? translateDate(i18n.language, request.Publicatiedatum) - : "Geen publicatiedatum beschikbaar"} + : t("No publication date available")} - {request.Samenvatting ?? "Geen samenvatting beschikbaar"} + {request.Samenvatting ?? t("No summary available")} ))} diff --git a/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx b/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx index c9029d72..f8bdc2a4 100644 --- a/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx +++ b/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx @@ -11,6 +11,7 @@ import { UnorderedList, UnorderedListItem, Link, + Icon, } from "@utrecht/component-library-react/dist/css-module"; import { translateDate } from "../../services/dateFormat"; import { useTranslation } from "react-i18next"; @@ -39,53 +40,53 @@ export const WOOItemDetailTemplate: React.FC = ({ wo
navigate("/")}> - Terug naar home + {t("Back to homepage")}
{getItems.isSuccess && ( <> - {getItems.data.Titel !== "" ? getItems.data.Titel : "Geen titel beschikbaar"} + {getItems.data.Titel !== "" ? getItems.data.Titel : t("No title available")}
{getItems.data.ID && ( - {t("Kenmerk")} + {t("Feature")} {isUUID(getItems.data.ID) ? getItems.data.Object_ID : getItems.data.ID} )} {getItems.data.Titel && ( - {t("Categorie")} + {t("Category")} {getItems.data.Categorie ?? "-"} )} {getItems.data.Samenvatting && ( - {t("Samenvatting")} + {t("Summary")} {getItems.data.Samenvatting} )} {getItems.data.Beschrijving && ( - {t("Beschrijving")} + {t("Description")} {getItems.data.Beschrijving} )} {getItems.data.Termijnoverschrijding && ( - {t("Termijnoverschrijding")} + {t("Exceeding the term")} {getItems.data.Termijnoverschrijding} )} {getItems.data.Publicatiedatum && ( - {t("Publicatiedatum")} + {t("Publication date")} {getItems.data.Publicatiedatum ? translateDate(i18n.language, getItems.data.Publicatiedatum) @@ -96,7 +97,7 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {getItems.data.Ontvangstdatum && ( - {t("Ontvangstdatum")} + {t("Received date")} {translateDate(i18n.language, getItems.data.Ontvangstdatum) ?? "-"} @@ -104,14 +105,14 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {getItems.data.Besluitdatum && ( - {t("Besluitdatum")} + {t("Decision date")} {translateDate(i18n.language, getItems.data.Besluitdatum) ?? "-"} )} {getItems.data?.embedded?.Themas && ( - {t("Thema's")} + {t("Themes")} {getItems.data?.embedded?.Themas.map((thema: any, idx: number) => ( @@ -124,7 +125,7 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {getItems.data.URL_informatieverzoek && ( - {t("Informatieverzoek")} + {t("Information request")} {getBijlageTitleFromURL( @@ -138,7 +139,7 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {(getItems.data.Besluit || getItems.data.URL_besluit) && ( - {t("Besluit")} + {t("Decision")} {getItems.data.Besluit} {getItems.data.Besluit && getItems.data.URL_besluit && ","}{" "} @@ -154,7 +155,7 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {getItems.data.URL_inventarisatielijst && ( - {t("Inventarisatielijst")} + {t("Inventory list")} {getBijlageTitleFromURL( @@ -168,7 +169,7 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {getItems.data?.embedded?.Bijlagen && ( - {t("Bijlagen")} + {t("Attachments")} {getItems.data?.embedded?.Bijlagen.map((bijlage: any, idx: number) => ( diff --git a/pwa/src/translations/en.ts b/pwa/src/translations/en.ts index 3c4bcdc4..dbca55b2 100644 --- a/pwa/src/translations/en.ts +++ b/pwa/src/translations/en.ts @@ -1 +1,35 @@ -export const en = {}; +export const en = { + Search: "Search", + Year: "Year", + Category: "Category", + Cards: "Cards", + Table: "Table", + Feature: "Feature", + Summary: "Summary", + Description: "Description", + Themes: "Themes", + Attachments: "Attachments", + Decision: "Decision", + Subject: "Subject", + "N/A": "N/A", + "Details page": "Details page", + "Back to homepage": "Back to homepage", + "Woo-publications of": "Woo-publications of", + "On this page you will find the Woo-publications of": "On this page you will find the Woo-publications of", + "Information request": "Information request", + "Inventory list": "Inventory list", + "Exceeding the term": "Exceeding the term", + "Publication date": "Publication date", + "Received date": "Received date", + "Decision date": "Decision date", + "Show cards": "Show cards", + "Show table": "Show table", + "Link to github repository": "Link to github repository", + "Link to github contributors page": "Link to github contributors page", + "Link to conduction website": "Link to conduction website", + "No title available": "No title available", + "No subject available": "No subject available", + "No publication date available": "No publication date available", + "No summary available": "No summary available", + "Navbar-Logo": "Navbar-Logo", +}; diff --git a/pwa/src/translations/nl.ts b/pwa/src/translations/nl.ts index ae404377..d8c67dcf 100644 --- a/pwa/src/translations/nl.ts +++ b/pwa/src/translations/nl.ts @@ -1 +1,35 @@ -export const nl = {}; +export const nl = { + Search: "Zoeken", + Year: "Jaar", + Category: "Categorie", + Cards: "Tegels", + Table: "Tabel", + Feature: "Kenmerk", + Summary: "Samenvatting", + Description: "Beschrijving", + Themes: "Thema's", + Attachments: "Bijlagen", + Decision: "Besluit", + Subject: "Onderwerp", + "N/A": "N.v.t", + "Details page": "Detailpagina", + "Back to homepage": "Terug naar home", + "Woo-publications of": "Woo-publicaties van", + "On this page you will find the Woo-publications of": "Op deze pagina vindt u de Woo-publicaties van", + "Information request": "Informatieverzoek", + "Inventory list": "Inventarisatielijst", + "Exceeding the term": "Termijnoverschrijding", + "Publication date": "Publicatiedatum", + "Received date": "Ontvangstdatum", + "Decision date": "Besluitdatum", + "Show cards": "Toon tegels", + "Show table": "Toon tabel", + "Link to github repository": "Link naar github repository", + "Link to github contributors page": "Link naar github bijdragers pagina", + "Link to conduction website": "Link naar conduction website", + "No title available": "Geen titel beschikbaar", + "No subject available": "Geen onderwerp beschikbaar", + "No publication date available": "Geen publicatiedatum beschikbaar", + "No summary available": "Geen samenvatting beschikbaar", + "Navbar-Logo": "Navigatie-Logo" +}; From 37fc1d71c35fce4603b28a3af7abddc413e9bc55 Mon Sep 17 00:00:00 2001 From: Remko Date: Fri, 6 Oct 2023 15:02:37 +0200 Subject: [PATCH 4/7] updated conduction-themes package --- pwa/package-lock.json | 61 +++++++++---------- pwa/package.json | 6 +- pwa/src/layout/Head.tsx | 4 +- pwa/src/styling/global.css | 5 -- pwa/src/styling/index.css | 2 + .../header/HeaderTemplate.module.css | 18 ++++++ .../templateParts/header/HeaderTemplate.tsx | 17 +++++- .../WOOItemDetailTemplate.module.css | 5 ++ 8 files changed, 75 insertions(+), 43 deletions(-) diff --git a/pwa/package-lock.json b/pwa/package-lock.json index e34daf0b..857fd625 100644 --- a/pwa/package-lock.json +++ b/pwa/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@conduction/components": "2.2.8", - "@conduction/theme": "1.0.36", + "@conduction/theme": "1.0.44", "@fortawesome/fontawesome-svg-core": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/react-fontawesome": "^0.1.18", @@ -87,6 +87,18 @@ "typescript": "^4.6.3" } }, + "../../conduction-theme": { + "name": "@conduction/theme", + "version": "1.0.44", + "license": "ISC", + "dependencies": { + "@nl-design-system-unstable/rotterdam-design-tokens": "^1.0.0-alpha.100" + } + }, + "../../conduction-theme/node_modules/@nl-design-system-unstable/rotterdam-design-tokens": { + "version": "1.0.0-alpha.111", + "license": "SEE LICENSE IN LICENSE.md" + }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "license": "MIT", @@ -1998,8 +2010,7 @@ }, "node_modules/@conduction/components": { "version": "2.2.8", - "resolved": "https://registry.npmjs.org/@conduction/components/-/components-2.2.8.tgz", - "integrity": "sha512-eaCLSm2giu+kCNlC6+H+gqZkehIeIFxOVGz/MYfhHBTP+lRulV1C258jQXpK8DjxXY65XHKruNVYrgi2ZEyYpA==", + "license": "ISC", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.2.0", "@fortawesome/free-solid-svg-icons": "^6.2.0", @@ -2018,8 +2029,7 @@ }, "node_modules/@conduction/components/node_modules/@fortawesome/react-fontawesome": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.0.tgz", - "integrity": "sha512-uHg75Rb/XORTtVt7OS9WoK8uM276Ufi7gCzshVWkUJbHhh3svsUUeqXerrM96Wm7fRiDzfKRwSoahhMIkGAYHw==", + "license": "MIT", "dependencies": { "prop-types": "^15.8.1" }, @@ -2030,13 +2040,11 @@ }, "node_modules/@conduction/components/node_modules/memoize-one": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", - "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==" + "license": "MIT" }, "node_modules/@conduction/components/node_modules/react-select": { "version": "5.3.2", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.3.2.tgz", - "integrity": "sha512-W6Irh7U6Ha7p5uQQ2ZnemoCQ8mcfgOtHfw3wuMzG6FAu0P+CYicgofSLOq97BhjMx8jS+h+wwWdCBeVVZ9VqlQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.0", "@emotion/cache": "^11.4.0", @@ -2052,12 +2060,8 @@ } }, "node_modules/@conduction/theme": { - "version": "1.0.36", - "resolved": "https://registry.npmjs.org/@conduction/theme/-/theme-1.0.36.tgz", - "integrity": "sha512-RQN6ukFxuPGm98z0DbeYnVd5XI+CEyVWZ3Y+OVId6rGlGssRbzqkcLIskOwPtCG8Ef/8GWPdz0tsNY52Po7oTQ==", - "dependencies": { - "@nl-design-system-unstable/rotterdam-design-tokens": "^1.0.0-alpha.100" - } + "resolved": "../../conduction-theme", + "link": true }, "node_modules/@emotion/babel-plugin": { "version": "11.11.0", @@ -3668,8 +3672,7 @@ }, "node_modules/@popperjs/core": { "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -5678,8 +5681,7 @@ }, "node_modules/classnames": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", - "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + "license": "MIT" }, "node_modules/clean-stack": { "version": "2.2.0", @@ -13604,8 +13606,7 @@ }, "node_modules/react-datepicker": { "version": "4.18.0", - "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-4.18.0.tgz", - "integrity": "sha512-0MYt3HmLbHVk1sw4v+RCbLAVg5TA3jWP7RyjZbo53PC+SEi+pjdgc92lB53ai/ENZaTOhbXmgni9GzvMrorMAw==", + "license": "MIT", "dependencies": { "@popperjs/core": "^2.11.8", "classnames": "^2.2.6", @@ -13784,8 +13785,7 @@ }, "node_modules/react-onclickoutside": { "version": "6.13.0", - "resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.13.0.tgz", - "integrity": "sha512-ty8So6tcUpIb+ZE+1HAhbLROvAIJYyJe/1vRrrcmW+jLsaM+/powDRqxzo6hSh9CuRZGSL1Q8mvcF5WRD93a0A==", + "license": "MIT", "funding": { "type": "individual", "url": "https://github.com/Pomax/react-onclickoutside/blob/master/FUNDING.md" @@ -13807,8 +13807,7 @@ }, "node_modules/react-popper": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-2.3.0.tgz", - "integrity": "sha512-e1hj8lL3uM+sgSR4Lxzn5h1GxBlpa4CQz0XLF8kx4MDrDRWY0Ena4c97PUeSX9i5W3UAfDP0z0FXCTQkoXUl3Q==", + "license": "MIT", "dependencies": { "react-fast-compare": "^3.0.1", "warning": "^4.0.2" @@ -13908,8 +13907,7 @@ }, "node_modules/react-tabs": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/react-tabs/-/react-tabs-6.0.2.tgz", - "integrity": "sha512-aQXTKolnM28k3KguGDBSAbJvcowOQr23A+CUJdzJtOSDOtTwzEaJA+1U4KwhNL9+Obe+jFS7geuvA7ICQPXOnQ==", + "license": "MIT", "dependencies": { "clsx": "^2.0.0", "prop-types": "^15.5.0" @@ -13920,16 +13918,14 @@ }, "node_modules/react-tabs/node_modules/clsx": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", - "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/react-tooltip": { "version": "5.21.4", - "resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.21.4.tgz", - "integrity": "sha512-LZsllEbiu63zNwuCalq3gIFcBu2Xf0I0fMg7uuF7/5ROo5//uHe8Sum7v9L1Rtp6IozcoU9YAjkNUZdrxutsNg==", + "license": "MIT", "dependencies": { "@floating-ui/dom": "^1.0.0", "classnames": "^2.3.0" @@ -16077,8 +16073,7 @@ }, "node_modules/warning": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", - "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "license": "MIT", "dependencies": { "loose-envify": "^1.0.0" } diff --git a/pwa/package.json b/pwa/package.json index 3194d1c1..d54b56eb 100644 --- a/pwa/package.json +++ b/pwa/package.json @@ -4,7 +4,9 @@ "private": true, "description": "Product Website Template", "author": "Conduction", - "keywords": ["gatsby"], + "keywords": [ + "gatsby" + ], "scripts": { "develop": "gatsby develop", "start": "gatsby develop", @@ -23,7 +25,7 @@ }, "dependencies": { "@conduction/components": "2.2.8", - "@conduction/theme": "1.0.36", + "@conduction/theme": "1.0.44", "@fortawesome/fontawesome-svg-core": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/react-fontawesome": "^0.1.18", diff --git a/pwa/src/layout/Head.tsx b/pwa/src/layout/Head.tsx index 24fb43ad..6250b0e8 100644 --- a/pwa/src/layout/Head.tsx +++ b/pwa/src/layout/Head.tsx @@ -8,7 +8,7 @@ import { useTranslation } from "react-i18next"; export const Head: React.FC = () => { const { gatsbyContext } = useGatsbyContext(); - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const translatedCrumbs = gatsbyContext.pageContext?.breadcrumb.crumbs.map((crumb: any) => ({ ...crumb, @@ -18,7 +18,7 @@ export const Head: React.FC = () => { return ( svg { margin-inline-end: var(--utrecht-icon-gap); } diff --git a/pwa/src/styling/index.css b/pwa/src/styling/index.css index a46ecdac..7ac1d5bc 100644 --- a/pwa/src/styling/index.css +++ b/pwa/src/styling/index.css @@ -11,6 +11,8 @@ @import "../../node_modules/@conduction/theme/municipalities/noordwijk-design-tokens/dist/index.css"; @import "../../node_modules/@conduction/theme/municipalities/noaberkracht-design-tokens/dist/index.css"; @import "../../node_modules/@conduction/theme/municipalities/rotterdam-design-tokens/dist/index.css"; +@import "../../node_modules/@conduction/theme/municipalities/open-webconcept-design-tokens/dist/index.css"; +@import "../../node_modules/@conduction/theme/municipalities/dimpact-design-tokens/dist/index.css"; /* Design Tokens maintained by Frameless */ @import "../../node_modules/@utrecht/design-tokens/dist/theme.css"; diff --git a/pwa/src/templates/templateParts/header/HeaderTemplate.module.css b/pwa/src/templates/templateParts/header/HeaderTemplate.module.css index 69b4929f..a15a4f11 100644 --- a/pwa/src/templates/templateParts/header/HeaderTemplate.module.css +++ b/pwa/src/templates/templateParts/header/HeaderTemplate.module.css @@ -4,6 +4,8 @@ max-inline-size: var(--utrecht-page-max-inline-size); padding-inline-start: var(--utrecht-page-margin-inline-start); padding-inline-end: var(--utrecht-page-margin-inline-end); + display: flex; + justify-content: space-between; } .imageContainer { @@ -22,3 +24,19 @@ .image:hover { cursor: pointer; } + +.languageSelectContainer { + align-self: center; +} + +.languageSelect { + user-select: none; +} + +.languageSelect:hover:not(.languageSelectDisabled) { + cursor: pointer; +} + +.languageSelectDisabled { + opacity: 50%; +} diff --git a/pwa/src/templates/templateParts/header/HeaderTemplate.tsx b/pwa/src/templates/templateParts/header/HeaderTemplate.tsx index c39c8cbb..15a69675 100644 --- a/pwa/src/templates/templateParts/header/HeaderTemplate.tsx +++ b/pwa/src/templates/templateParts/header/HeaderTemplate.tsx @@ -10,7 +10,7 @@ interface HeaderTemplateProps { } export const HeaderTemplate: React.FC = ({ layoutClassName }) => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); return ( @@ -23,6 +23,21 @@ export const HeaderTemplate: React.FC = ({ layoutClassName alt={t("Navbar-Logo")} /> +
+ i18n.changeLanguage("nl")} + > + NL + {" "} + /{" "} + i18n.changeLanguage("en")} + > + EN + +
); diff --git a/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.module.css b/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.module.css index 7cacd458..7c344cd7 100644 --- a/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.module.css +++ b/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.module.css @@ -36,6 +36,11 @@ cursor: pointer; } +.backLink { + display: flex; + align-items: center; +} + .tableBody { border: var(--utrecht-table-body-border); } From 0002be14dbb1d4d033267fe8e6d39a449991ae8c Mon Sep 17 00:00:00 2001 From: Remko Date: Fri, 6 Oct 2023 15:25:54 +0200 Subject: [PATCH 5/7] build fix --- pwa/package-lock.json | 32 ++++++++++++++------------------ pwa/static/.env.development | 4 ++-- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/pwa/package-lock.json b/pwa/package-lock.json index 857fd625..a07f8f3e 100644 --- a/pwa/package-lock.json +++ b/pwa/package-lock.json @@ -87,18 +87,6 @@ "typescript": "^4.6.3" } }, - "../../conduction-theme": { - "name": "@conduction/theme", - "version": "1.0.44", - "license": "ISC", - "dependencies": { - "@nl-design-system-unstable/rotterdam-design-tokens": "^1.0.0-alpha.100" - } - }, - "../../conduction-theme/node_modules/@nl-design-system-unstable/rotterdam-design-tokens": { - "version": "1.0.0-alpha.111", - "license": "SEE LICENSE IN LICENSE.md" - }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "license": "MIT", @@ -2010,7 +1998,8 @@ }, "node_modules/@conduction/components": { "version": "2.2.8", - "license": "ISC", + "resolved": "https://registry.npmjs.org/@conduction/components/-/components-2.2.8.tgz", + "integrity": "sha512-eaCLSm2giu+kCNlC6+H+gqZkehIeIFxOVGz/MYfhHBTP+lRulV1C258jQXpK8DjxXY65XHKruNVYrgi2ZEyYpA==", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.2.0", "@fortawesome/free-solid-svg-icons": "^6.2.0", @@ -2029,7 +2018,8 @@ }, "node_modules/@conduction/components/node_modules/@fortawesome/react-fontawesome": { "version": "0.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.0.tgz", + "integrity": "sha512-uHg75Rb/XORTtVt7OS9WoK8uM276Ufi7gCzshVWkUJbHhh3svsUUeqXerrM96Wm7fRiDzfKRwSoahhMIkGAYHw==", "dependencies": { "prop-types": "^15.8.1" }, @@ -2040,11 +2030,13 @@ }, "node_modules/@conduction/components/node_modules/memoize-one": { "version": "5.2.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", + "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==" }, "node_modules/@conduction/components/node_modules/react-select": { "version": "5.3.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.3.2.tgz", + "integrity": "sha512-W6Irh7U6Ha7p5uQQ2ZnemoCQ8mcfgOtHfw3wuMzG6FAu0P+CYicgofSLOq97BhjMx8jS+h+wwWdCBeVVZ9VqlQ==", "dependencies": { "@babel/runtime": "^7.12.0", "@emotion/cache": "^11.4.0", @@ -2060,8 +2052,12 @@ } }, "node_modules/@conduction/theme": { - "resolved": "../../conduction-theme", - "link": true + "version": "1.0.44", + "resolved": "https://registry.npmjs.org/@conduction/theme/-/theme-1.0.44.tgz", + "integrity": "sha512-JjtSAOVT7WLnGqO87Mu8WXRf0NtT0UIZvk/+fSiqOESag67p3zN97rJsHSJjwMwpeL5uXBAgdTViqdFSJYoUNA==", + "dependencies": { + "@nl-design-system-unstable/rotterdam-design-tokens": "^1.0.0-alpha.100" + } }, "node_modules/@emotion/babel-plugin": { "version": "11.11.0", diff --git a/pwa/static/.env.development b/pwa/static/.env.development index c58bbd25..73ccde57 100644 --- a/pwa/static/.env.development +++ b/pwa/static/.env.development @@ -9,14 +9,14 @@ GATSBY_NL_DESIGN_THEME_CLASSNAME=conduction-theme # Header GATSBY_FAVICON_URL="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICAgICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgICAgd2lkdGg9IjcxLjAwMDAwMHB0IiBoZWlnaHQ9IjcwLjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgNzEuMDAwMDAwIDcwLjAwMDAwMCIKICAgICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCiAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMDAwMCw3MC4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiCiAgICAgICBmaWxsPSIjNDM3NkZDIiBzdHJva2U9Im5vbmUiPgogICAgICAgIDxwYXRoIGQ9Ik0yMTggNTkyIGwtMTM3IC03NyAwIC0xNjUgMCAtMTY1IDEzMSAtNzQgYzcyIC00MSAxMzcgLTc0IDE0MyAtNzQgNgowIDcwIDMzIDE0MyA3NCBsMTMxIDc0IDEgMTY1IDAgMTY1IC02OCAzNyBjLTM3IDIxIC05OSA1NiAtMTM3IDc3IGwtNzEgNDAKLTEzNiAtNzd6IG0yOTUgLTg1IGw1NyAtMzIgMCAtMTI1IDAgLTEyNSAtMTA2IC02MCBjLTU4IC0zMyAtMTA4IC02MCAtMTExCi01OSAtMyAwIC01MiAyNyAtMTA5IDYwIGwtMTAzIDU5IDAgMTI1IDAgMTI1IDEwNyA2MSAxMDcgNjIgNTAgLTI5IGMyNyAtMTYKNzYgLTQ0IDEwOCAtNjJ6Ii8+CiAgICAgICAgPHBhdGggZD0iTTI3OCA0NzIgbC02OCAtMzcgMCAtODUgMCAtODUgNzMgLTM5IDczIC0zOSA2MiAzNCBjMzQgMTggNjIgMzcgNjIKNDEgMCA0IC0xNCAxNSAtMzEgMjMgLTI4IDE1IC0zMyAxNSAtNTQgMSAtMzEgLTIwIC00NiAtMjAgLTg0IDIgLTI3IDE1IC0zMQoyMiAtMzEgNjIgMCA0MCA0IDQ3IDMxIDYzIDM4IDIxIDUzIDIxIDg0IDEgMjEgLTE0IDI2IC0xNCA1NCAxIDE3IDggMzEgMTkgMzEKMjMgMCA4IC0xMTMgNzIgLTEyNiA3MiAtNSAwIC0zOSAtMTcgLTc2IC0zOHoiLz4KICAgIDwvZz4KPC9zdmc+Cg==" -GATSBY_HEADER_LOGO_URL=https://conduction.nl/wp-content/uploads/2021/07/cropped-conductionlogo-1.png +GATSBY_HEADER_LOGO_URL="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='155' height='88' viewBox='0 0 155 88' class='logo__svg' role='img' aria-hidden='true'%3E%3Ctitle id='site-logo-title'%3EGemeente Epe%3C/title%3E%3Cdesc id='site-logo-desc'%3ELogo dat naar de hoofdpagina leidt%3C/desc%3E%3Cpath fill='%23231f20' class='logo__svg--letters-path' d='M7.7,74.621h5.957v8.144a16.255,16.255,0,0,1-5.594.8C4.916,83.57,0,82.137,0,75.642c0-3.715,2.325-7.754,8.767-7.754A16.751,16.751,0,0,1,13.2,68.5l-.242,2.975a9.753,9.753,0,0,0-3.875-.847c-4.19,0-5.013,3.453-5.013,5.169,0,2.824,1.453,5.038,4.48,5.038a3.46,3.46,0,0,0,1.381-.217V77.184H7.7ZM19.69,76.684c0-.607,0-2.781,1.962-2.781,1.574,0,1.985,1.347,1.985,2.781Zm7.435,1.043c0-5.909-4.335-5.909-5.473-5.909a5.478,5.478,0,0,0-5.6,5.8c0,3.454,1.962,5.865,6.394,5.865a13.084,13.084,0,0,0,4-.653l-.073-2.583a8.557,8.557,0,0,1-3.56.89c-2.156,0-3.124-1.238-3.124-2.585h7.435Zm15.96-1.389c0-1.3-.605-1.782-1.453-1.782a1.445,1.445,0,0,0-1.574,1.586v7.167H36.231V76.338c0-1.434-.7-1.782-1.332-1.782-1.259,0-1.7.977-1.7,2.411v6.342H29.377V74.36a19.59,19.59,0,0,0-.1-2.368h3.488c.048.5.1,1.13.1,1.891h.049a3.461,3.461,0,0,1,3.56-2.065,3.212,3.212,0,0,1,3.27,1.891,3.434,3.434,0,0,1,3.463-1.891c2.786,0,3.706,1.826,3.706,4.085v7.406H43.085Zm9.809.346c0-.607,0-2.781,1.961-2.781,1.575,0,1.987,1.347,1.987,2.781Zm7.435,1.043c0-5.909-4.335-5.909-5.474-5.909a5.478,5.478,0,0,0-5.594,5.8c0,3.454,1.962,5.865,6.394,5.865a13.084,13.084,0,0,0,4-.653l-.073-2.583a8.553,8.553,0,0,1-3.56.89c-2.155,0-3.124-1.238-3.124-2.585h7.435Zm5.57-1.043c0-.607,0-2.781,1.962-2.781,1.574,0,1.986,1.347,1.986,2.781Zm7.435,1.043c0-5.909-4.335-5.909-5.473-5.909a5.478,5.478,0,0,0-5.6,5.8c0,3.454,1.962,5.865,6.394,5.865a13.079,13.079,0,0,0,4-.653l-.072-2.583a8.561,8.561,0,0,1-3.561.89c-2.155,0-3.124-1.238-3.124-2.585h7.435Zm9.228-1.389c0-1.412-.7-1.782-1.478-1.782-1.235,0-1.67.955-1.67,2.411v6.342H75.587V74.36a19.8,19.8,0,0,0-.1-2.368h3.487c.049.5.1,1.13.1,1.891h.048a3.463,3.463,0,0,1,3.561-2.065c2.785,0,3.7,1.826,3.7,4.085v7.406H82.562Zm5.5-4.346h2.18V69.669l3.73-1.064v3.387h2.47V74.4h-2.47v5.19c0,1.108.557,1.412,1.283,1.412a3.133,3.133,0,0,0,1.261-.239v2.411a10.072,10.072,0,0,1-2.665.305c-1.986,0-3.706-.869-3.706-3.345V74.4H88.059Zm13.733,4.692c0-.607,0-2.781,1.961-2.781,1.575,0,1.986,1.347,1.986,2.781Zm7.434,1.043c0-5.909-4.335-5.909-5.473-5.909a5.479,5.479,0,0,0-5.595,5.8c0,3.454,1.961,5.865,6.395,5.865a13.089,13.089,0,0,0,4-.653l-.074-2.583a8.544,8.544,0,0,1-3.559.89c-2.156,0-3.124-1.238-3.124-2.585h7.434Zm8.815-9.578H127.8V70.8h-5.933v3.39h5.642v2.648h-5.642V80.66h6.223v2.649H118.041Zm19.885,9.491c0,1.8-.146,3.5-1.841,3.5-1.551,0-1.913-1.694-1.913-3.5,0-1.3.339-3.345,1.913-3.345C137.828,74.3,137.926,76.467,137.926,77.64ZM130.345,88h3.827V81.637h.048a3.278,3.278,0,0,0,3.245,1.846c3.173,0,4.432-2.52,4.432-5.561,0-3.6-1.6-6.1-4.432-6.1a3.607,3.607,0,0,0-3.439,1.978h-.048a15.517,15.517,0,0,0-.1-1.8h-3.632a23.955,23.955,0,0,1,.1,2.542Zm17.22-11.316c0-.607,0-2.781,1.962-2.781,1.574,0,1.986,1.347,1.986,2.781ZM155,77.727c0-5.909-4.335-5.909-5.473-5.909a5.479,5.479,0,0,0-5.6,5.8c0,3.454,1.963,5.865,6.394,5.865a13.091,13.091,0,0,0,4-.653l-.072-2.583a8.569,8.569,0,0,1-3.561.89c-2.156,0-3.124-1.238-3.124-2.585H155Z'%3E%3C/path%3E%3Cpath fill='%2300539f' class='logo__svg--deer-path' d='M102.234,38.54l.11-.063c-.038-7.534-2.5-14.87-6.094-21.718v-.248l8.5-2.678-.6-2.989-7.8-.437A8.7,8.7,0,0,0,99.4,7.557l-1.809-1c-1.073,1.529-3.054,3.053-6.7,3.053-9.735,0-15.672-7.5-17.153-9.614L71.754.783c.956,1.481,5.885,8.486,14.6,10.413l-6.025,3.031,6,.436L87.5,25.622l-39.711-.006.054,2.164c1.447-.083,3.011-.042,3.975,1a4.948,4.948,0,0,1,.5,5.167,37.313,37.313,0,0,1-2.967,5.109c-9.037,2-16.871,5-22.686,8.82l2.466,3.062c5.771-3.791,13.73-6.721,22.965-8.591l.005,0v0a126.7,126.7,0,0,1,26.561-2.336c17.5.231,34.074,3.822,44.985,9.683l2.119-3.266A83.593,83.593,0,0,0,102.234,38.54Z'%3E%3C/path%3E%3Cpath fill='%23d5a10f' class='logo__svg--emblem-path' d='M115.353,41.321c.036.224.068.458.1.684-.8-.273-1.615-.532-2.44-.787.3-.845.732-1.635,1.208-1.58C114.809,39.706,115.217,40.479,115.353,41.321Zm-82.624-.978c1.1,1.09,2.674,2.585,2.982,2.873q1.681-.684,3.475-1.308a12.483,12.483,0,0,1-.321-2.475,19.928,19.928,0,0,1,.363-3.388.927.927,0,0,0-.272-1.069.535.535,0,0,0-.794.159,19.482,19.482,0,0,0-1.382,2.411s-.136.492-.333.477-.075-.5-.061-.591a16.765,16.765,0,0,1,1.588-4.866c1.284-2.562,1.1-1.971,1.194-2.3s.226-1.046-.485-.849-.694.243-.785.106.121-.349.257-.606a16.566,16.566,0,0,1,3.4-3.684s.757-.591.438-1.015-.68-.152-.906-.122-.363.106-.438-.03.1-.576.544-.849a42.561,42.561,0,0,0,5.244-3.9c.862-1,1.33-1.622.968-2.077s-1.345-.379-2.086.091a24.753,24.753,0,0,0-3.31,2.926,9.567,9.567,0,0,1-1.375,1.379c-.151.061-.378.167-.181-.182s.5-.924.226-1.121-.65-.273-1.33.182a11.369,11.369,0,0,0-3.37,3.986,17.766,17.766,0,0,0-.877,2.744c-.03.137-.332.561-.453.076a7.037,7.037,0,0,1-.181-1.152c-.016-.212-.046-.561-.318-.606a.919.919,0,0,0-.967.5c-.257.47-1.633,3.683-1.149,6.033a23.4,23.4,0,0,0,.877,3.532c.151.364.257.531.106.622a1,1,0,0,1-.877-.318c-.227-.258-.71-.9-.8-1.032s-.439-.454-.756-.227a2,2,0,0,0-.242,1.85A12.089,12.089,0,0,0,32.729,40.343ZM114.5,23.213c.44.273.62.712.545.849s-.212.06-.439.03-.588-.3-.906.122.438,1.015.438,1.015a16.609,16.609,0,0,1,3.4,3.684c.136.257.347.47.256.606s-.075.091-.785-.106-.576.515-.484.849-.092-.258,1.194,2.3a16.744,16.744,0,0,1,1.587,4.866c.014.091.136.576-.061.591s-.332-.477-.332-.477a19.61,19.61,0,0,0-1.382-2.411.535.535,0,0,0-.794-.159.928.928,0,0,0-.273,1.069,20.012,20.012,0,0,1,.364,3.388,14.049,14.049,0,0,1-.418,2.912q1.629.579,3.176,1.206c.134-.115.273-.222.34-.283.166-.152,1.873-1.773,3.037-2.925a12.07,12.07,0,0,0,2.388-3.82,2,2,0,0,0-.241-1.85c-.318-.227-.665.091-.756.227s-.574.774-.8,1.032a1,1,0,0,1-.878.318c-.15-.091-.044-.258.107-.622a23.621,23.621,0,0,0,.876-3.532c.485-2.35-.892-5.563-1.149-6.033a.919.919,0,0,0-.967-.5c-.272.045-.3.394-.316.606a7.1,7.1,0,0,1-.183,1.152c-.12.485-.423.061-.452-.076a17.581,17.581,0,0,0-.878-2.744,11.368,11.368,0,0,0-3.369-3.986c-.681-.455-1.058-.38-1.33-.182s.03.773.225,1.121-.03.243-.18.182a9.567,9.567,0,0,1-1.375-1.379,24.815,24.815,0,0,0-3.31-2.926c-.742-.47-1.723-.545-2.086-.091s.1,1.077.967,2.077A42.561,42.561,0,0,0,114.5,23.213Zm5.79,20.62q1.323.553,2.579,1.144a20.9,20.9,0,0,0,2.438-2.3c.3-.378.832-1.485.513-1.819s-1.48.622-2.388,1.334A15.2,15.2,0,0,1,120.288,43.833Zm-2.025,5.045c-.274.076-1.332.348-1.981.47s-3.128.273-3.416.287-.287.076-.3-.167.166-.211.166-.211.982-.274,2.508-.713a34.4,34.4,0,0,0,3.383-1.219q-3.251-1.358-6.921-2.491a10.7,10.7,0,0,1-.791,1.534,7.909,7.909,0,0,1-3.037,2.365c-.636.228-.25-.341-.25-.341s.18-.227.522-.682a10.755,10.755,0,0,0,1.019-2.387,1.742,1.742,0,0,0-.107-1.257c-.209-.057-.425-.11-.635-.166a1.173,1.173,0,0,0-.39.444,20.853,20.853,0,0,1-9.3,6.458c-6.849,2.465-14.532,3.2-20.964,3.267-6.4-.073-14.02-.821-20.814-3.267a20.848,20.848,0,0,1-9.3-6.458s-.362-.749-.861-.432-.317,1.115-.272,1.411a10.716,10.716,0,0,0,1.02,2.387c.34.455.522.682.522.682s.386.569-.25.341a7.9,7.9,0,0,1-3.038-2.365,12.548,12.548,0,0,1-.971-1.958,69.708,69.708,0,0,0-7.355,2.653,35.7,35.7,0,0,0,4,1.481c1.526.439,2.509.713,2.509.713s.181-.031.165.211-.014.182-.3.167-2.766-.167-3.415-.287-1.708-.394-1.981-.47-.694-.167-.846.273.968,1.136,1.224,1.273A28.168,28.168,0,0,0,44.73,52.8a92,92,0,0,0,9.944,1.7s.529,0,.529.226-.3.213-.529.228-2.145.075-2.539.061-2.765-.212-3.052-.258-1.18-.061-1.134.228.257.7,1.013.864,6.544,1.106,7.737,1.182,6.485.318,6.772.318.876.379.03.41-3.2.091-3.2.091-.439.014-.439.242.258.3.514.334,3.764.546,3.764.546,6.59.818,7.375.894c.577.055,3.637.235,6.175.3,0,0,.606.028.917.018.087,0,.261-.01.261-.01,2.328-.089,4.8-.259,5.316-.308.786-.076,7.376-.894,7.376-.894s3.507-.516,3.763-.546.515-.107.515-.334-.439-.242-.439-.242-2.358-.061-3.2-.091-.257-.41.03-.41,5.577-.242,6.772-.318,6.981-1.016,7.737-1.182.967-.577,1.012-.864-.846-.273-1.134-.228-2.658.243-3.053.258-2.311-.046-2.538-.061-.529,0-.529-.228.529-.226.529-.226a91.957,91.957,0,0,0,9.944-1.7,28.13,28.13,0,0,0,6.923-2.379c.257-.137,1.375-.834,1.224-1.273S118.534,48.8,118.263,48.878ZM32.438,44.657q1.155-.55,2.376-1.067a13.562,13.562,0,0,1-2.553-1.4c-.907-.712-2.071-1.667-2.388-1.334s.212,1.441.514,1.819A20.028,20.028,0,0,0,32.438,44.657Zm9.034-5.019c-.589.068-1,.841-1.133,1.683-.01.067-.021.137-.031.206q1.092-.363,2.22-.7C42.24,40.146,41.872,39.592,41.472,39.638Z'%3E%3C/path%3E%3C/svg%3E" #Jumbotron GATSBY_ORGANISATION_NAME=Conduction GATSBY_JUMBOTRON_IMAGE_URL=https://www.conduction.nl/wp-content/uploads/2021/07/cropped-Conduction_HOME_0000_afb1-1.png # Footer -GATSBY_FOOTER_LOGO_URL="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICAgICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgICAgd2lkdGg9IjcxLjAwMDAwMHB0IiBoZWlnaHQ9IjcwLjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgNzEuMDAwMDAwIDcwLjAwMDAwMCIKICAgICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCiAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMDAwMCw3MC4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiCiAgICAgICBmaWxsPSIjNDM3NkZDIiBzdHJva2U9Im5vbmUiPgogICAgICAgIDxwYXRoIGQ9Ik0yMTggNTkyIGwtMTM3IC03NyAwIC0xNjUgMCAtMTY1IDEzMSAtNzQgYzcyIC00MSAxMzcgLTc0IDE0MyAtNzQgNgowIDcwIDMzIDE0MyA3NCBsMTMxIDc0IDEgMTY1IDAgMTY1IC02OCAzNyBjLTM3IDIxIC05OSA1NiAtMTM3IDc3IGwtNzEgNDAKLTEzNiAtNzd6IG0yOTUgLTg1IGw1NyAtMzIgMCAtMTI1IDAgLTEyNSAtMTA2IC02MCBjLTU4IC0zMyAtMTA4IC02MCAtMTExCi01OSAtMyAwIC01MiAyNyAtMTA5IDYwIGwtMTAzIDU5IDAgMTI1IDAgMTI1IDEwNyA2MSAxMDcgNjIgNTAgLTI5IGMyNyAtMTYKNzYgLTQ0IDEwOCAtNjJ6Ii8+CiAgICAgICAgPHBhdGggZD0iTTI3OCA0NzIgbC02OCAtMzcgMCAtODUgMCAtODUgNzMgLTM5IDczIC0zOSA2MiAzNCBjMzQgMTggNjIgMzcgNjIKNDEgMCA0IC0xNCAxNSAtMzEgMjMgLTI4IDE1IC0zMyAxNSAtNTQgMSAtMzEgLTIwIC00NiAtMjAgLTg0IDIgLTI3IDE1IC0zMQoyMiAtMzEgNjIgMCA0MCA0IDQ3IDMxIDYzIDM4IDIxIDUzIDIxIDg0IDEgMjEgLTE0IDI2IC0xNCA1NCAxIDE3IDggMzEgMTkgMzEKMjMgMCA4IC0xMTMgNzIgLTEyNiA3MiAtNSAwIC0zOSAtMTcgLTc2IC0zOHoiLz4KICAgIDwvZz4KPC9zdmc+Cg==" +GATSBY_FOOTER_LOGO_URL="false" GATSBY_FOOTER_LOGO_HREF=https://conduction.nl/ #OIDN From b5a56017fb69ef6ac8509ada3b212329d0abdc84 Mon Sep 17 00:00:00 2001 From: Remko Date: Fri, 6 Oct 2023 15:53:40 +0200 Subject: [PATCH 6/7] updated conduction-themes package --- pwa/package-lock.json | 8 ++++---- pwa/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pwa/package-lock.json b/pwa/package-lock.json index a07f8f3e..3ba00ff1 100644 --- a/pwa/package-lock.json +++ b/pwa/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@conduction/components": "2.2.8", - "@conduction/theme": "1.0.44", + "@conduction/theme": "1.0.45", "@fortawesome/fontawesome-svg-core": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/react-fontawesome": "^0.1.18", @@ -2052,9 +2052,9 @@ } }, "node_modules/@conduction/theme": { - "version": "1.0.44", - "resolved": "https://registry.npmjs.org/@conduction/theme/-/theme-1.0.44.tgz", - "integrity": "sha512-JjtSAOVT7WLnGqO87Mu8WXRf0NtT0UIZvk/+fSiqOESag67p3zN97rJsHSJjwMwpeL5uXBAgdTViqdFSJYoUNA==", + "version": "1.0.45", + "resolved": "https://registry.npmjs.org/@conduction/theme/-/theme-1.0.45.tgz", + "integrity": "sha512-h+RcKStBOilUj3xkxg8xE82aDkBzkBiI7MtvuoGOeKkOdAJ/I/UECAjebP85601JMO6A3N8RIkwNCTuOFPtUTQ==", "dependencies": { "@nl-design-system-unstable/rotterdam-design-tokens": "^1.0.0-alpha.100" } diff --git a/pwa/package.json b/pwa/package.json index d54b56eb..59acb0d4 100644 --- a/pwa/package.json +++ b/pwa/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "@conduction/components": "2.2.8", - "@conduction/theme": "1.0.44", + "@conduction/theme": "1.0.45", "@fortawesome/fontawesome-svg-core": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/react-fontawesome": "^0.1.18", From 2cf434dfd30a53562735b2796d32a81776c288dd Mon Sep 17 00:00:00 2001 From: Remko Date: Fri, 6 Oct 2023 17:02:35 +0200 Subject: [PATCH 7/7] added language options --- pwa/src/data/languageOptions.ts | 276 ++++++++++++++++++++++++++++++++ pwa/src/layout/Head.tsx | 7 +- 2 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 pwa/src/data/languageOptions.ts diff --git a/pwa/src/data/languageOptions.ts b/pwa/src/data/languageOptions.ts new file mode 100644 index 00000000..81ff57e3 --- /dev/null +++ b/pwa/src/data/languageOptions.ts @@ -0,0 +1,276 @@ +export const languageOptions = [ + { label: "ZA", value: "af-ZA" }, + { label: "AL", value: "sq-AL" }, + { label: "DZ", value: "ar-DZ" }, + { label: "BH", value: "ar-BH" }, + { label: "EG", value: "ar-EG" }, + { label: "IQ", value: "ar-IQ" }, + { label: "JO", value: "ar-JO" }, + { label: "KW", value: "ar-KW" }, + { label: "LB", value: "ar-LB" }, + { label: "LY", value: "ar-LY" }, + { label: "MA", value: "ar-MA" }, + { label: "OM", value: "ar-OM" }, + { label: "QA", value: "ar-QA" }, + { label: "SA", value: "ar-SA" }, + { label: "SY", value: "ar-SY" }, + { label: "TN", value: "ar-TN" }, + { label: "AE", value: "ar-AE" }, + { label: "YE", value: "ar-YE" }, + { label: "AM", value: "hy-AM" }, + { label: "AZ", value: "az-AZ" }, + { label: "AZ", value: "az-AZ" }, + { label: "ES", value: "eu-ES" }, + { label: "BY", value: "be-BY" }, + { label: "BG", value: "bg-BG" }, + { label: "ES", value: "ca-ES" }, + { label: "CN", value: "zh-CN" }, + { label: "HK", value: "zh-HK" }, + { label: "MO", value: "zh-MO" }, + { label: "SG", value: "zh-SG" }, + { label: "TW", value: "zh-TW" }, + { label: "CHS", value: "zh-CHS" }, + { label: "CHT", value: "zh-CHT" }, + { label: "HR", value: "hr-HR" }, + { label: "CZ", value: "cs-CZ" }, + { label: "DK", value: "da-DK" }, + { label: "MV", value: "div-MV" }, + { label: "BE", value: "nl-BE" }, + { label: "NL", value: "nl-NL" }, + { label: "AU", value: "en-AU" }, + { label: "BZ", value: "en-BZ" }, + { label: "CA", value: "en-CA" }, + { label: "CB", value: "en-CB" }, + { label: "IE", value: "en-IE" }, + { label: "JM", value: "en-JM" }, + { label: "NZ", value: "en-NZ" }, + { label: "PH", value: "en-PH" }, + { label: "ZA", value: "en-ZA" }, + { label: "TT", value: "en-TT" }, + { label: "GB", value: "en-GB" }, + { label: "US", value: "en-US" }, + { label: "ZW", value: "en-ZW" }, + { label: "EE", value: "et-EE" }, + { label: "FO", value: "fo-FO" }, + { label: "IR", value: "fa-IR" }, + { label: "FI", value: "fi-FI" }, + { label: "BE", value: "fr-BE" }, + { label: "CA", value: "fr-CA" }, + { label: "FR", value: "fr-FR" }, + { label: "LU", value: "fr-LU" }, + { label: "MC", value: "fr-MC" }, + { label: "CH", value: "fr-CH" }, + { label: "ES", value: "gl-ES" }, + { label: "GE", value: "ka-GE" }, + { label: "AT", value: "de-AT" }, + { label: "DE", value: "de-DE" }, + { label: "LI", value: "de-LI" }, + { label: "LU", value: "de-LU" }, + { label: "CH", value: "de-CH" }, + { label: "GR", value: "el-GR" }, + { label: "IN", value: "gu-IN" }, + { label: "IL", value: "he-IL" }, + { label: "IN", value: "hi-IN" }, + { label: "HU", value: "hu-HU" }, + { label: "IS", value: "is-IS" }, + { label: "ID", value: "id-ID" }, + { label: "IT", value: "it-IT" }, + { label: "CH", value: "it-CH" }, + { label: "JP", value: "ja-JP" }, + { label: "IN", value: "kn-IN" }, + { label: "KZ", value: "kk-KZ" }, + { label: "IN", value: "kok-IN" }, + { label: "KR", value: "ko-KR" }, + { label: "KZ", value: "ky-KZ" }, + { label: "LV", value: "lv-LV" }, + { label: "LT", value: "lt-LT" }, + { label: "MK", value: "mk-MK" }, + { label: "BN", value: "ms-BN" }, + { label: "MY", value: "ms-MY" }, + { label: "IN", value: "mr-IN" }, + { label: "MN", value: "mn-MN" }, + { label: "NO", value: "nb-NO" }, + { label: "NO", value: "nn-NO" }, + { label: "PL", value: "pl-PL" }, + { label: "BR", value: "pt-BR" }, + { label: "PT", value: "pt-PT" }, + { label: "IN", value: "pa-IN" }, + { label: "RO", value: "ro-RO" }, + { label: "RU", value: "ru-RU" }, + { label: "IN", value: "sa-IN" }, + { label: "SP", value: "sr-SP" }, + { label: "SP", value: "sr-SP" }, + { label: "SK", value: "sk-SK" }, + { label: "SI", value: "sl-SI" }, + { label: "AR", value: "es-AR" }, + { label: "BO", value: "es-BO" }, + { label: "CL", value: "es-CL" }, + { label: "CO", value: "es-CO" }, + { label: "CR", value: "es-CR" }, + { label: "DO", value: "es-DO" }, + { label: "EC", value: "es-EC" }, + { label: "SV", value: "es-SV" }, + { label: "GT", value: "es-GT" }, + { label: "HN", value: "es-HN" }, + { label: "MX", value: "es-MX" }, + { label: "NI", value: "es-NI" }, + { label: "PA", value: "es-PA" }, + { label: "PY", value: "es-PY" }, + { label: "PE", value: "es-PE" }, + { label: "PR", value: "es-PR" }, + { label: "ES", value: "es-ES" }, + { label: "UY", value: "es-UY" }, + { label: "VE", value: "es-VE" }, + { label: "KE", value: "sw-KE" }, + { label: "FI", value: "sv-FI" }, + { label: "SE", value: "sv-SE" }, + { label: "SY", value: "syr-SY" }, + { label: "IN", value: "ta-IN" }, + { label: "RU", value: "tt-RU" }, + { label: "IN", value: "te-IN" }, + { label: "TH", value: "th-TH" }, + { label: "TR", value: "tr-TR" }, + { label: "UA", value: "uk-UA" }, + { label: "PK", value: "ur-PK" }, + { label: "UZ", value: "uz-UZ" }, + { label: "UZ", value: "uz-UZ" }, + { label: "VN", value: "vi-VN" }, +]; + +export type TLanguageCodes = + | "ZA" + | "AL" + | "DZ" + | "BH" + | "EG" + | "IQ" + | "JO" + | "KW" + | "LB" + | "LY" + | "MA" + | "OM" + | "QA" + | "SA" + | "SY" + | "TN" + | "AE" + | "YE" + | "AM" + | "AZ" + | "AZ" + | "ES" + | "BY" + | "BG" + | "ES" + | "CN" + | "HK" + | "MO" + | "SG" + | "TW" + | "CHS" + | "CHT" + | "HR" + | "CZ" + | "DK" + | "MV" + | "BE" + | "NL" + | "AU" + | "BZ" + | "CA" + | "CB" + | "IE" + | "JM" + | "NZ" + | "PH" + | "ZA" + | "TT" + | "GB" + | "US" + | "ZW" + | "EE" + | "FO" + | "IR" + | "FI" + | "BE" + | "CA" + | "FR" + | "LU" + | "MC" + | "CH" + | "ES" + | "GE" + | "AT" + | "DE" + | "LI" + | "LU" + | "CH" + | "GR" + | "IN" + | "IL" + | "IN" + | "HU" + | "IS" + | "ID" + | "IT" + | "CH" + | "JP" + | "IN" + | "KZ" + | "IN" + | "KR" + | "KZ" + | "LV" + | "LT" + | "MK" + | "BN" + | "MY" + | "IN" + | "MN" + | "NO" + | "NO" + | "PL" + | "BR" + | "PT" + | "IN" + | "RO" + | "RU" + | "IN" + | "SP" + | "SP" + | "SK" + | "SI" + | "AR" + | "BO" + | "CL" + | "CO" + | "CR" + | "DO" + | "EC" + | "SV" + | "GT" + | "HN" + | "MX" + | "NI" + | "PA" + | "PY" + | "PE" + | "PR" + | "ES" + | "UY" + | "VE" + | "KE" + | "FI" + | "SE" + | "SY" + | "IN" + | "RU" + | "IN" + | "TH" + | "TR" + | "UA" + | "PK" + | "UZ" + | "UZ" + | "VN"; diff --git a/pwa/src/layout/Head.tsx b/pwa/src/layout/Head.tsx index 6250b0e8..969fe4ca 100644 --- a/pwa/src/layout/Head.tsx +++ b/pwa/src/layout/Head.tsx @@ -5,6 +5,7 @@ import { Helmet } from "react-helmet"; import { getPageTitle } from "../services/getPageTitle"; import { useGatsbyContext } from "../context/gatsby"; import { useTranslation } from "react-i18next"; +import { languageOptions } from "../data/languageOptions"; export const Head: React.FC = () => { const { gatsbyContext } = useGatsbyContext(); @@ -15,10 +16,14 @@ export const Head: React.FC = () => { crumbLabel: t(_.upperFirst(crumb.crumbLabel)), })); + const currentLanguage = languageOptions.find( + (language) => language.label === (i18n.language.toUpperCase() === "EN" ? "US" : i18n.language.toUpperCase()), + )?.value; + return (