From 2cd82a2fb1070a934e0a238c523481560bc88d3d Mon Sep 17 00:00:00 2001 From: Andreas Ellewsen <andreas@ellewsen.no> Date: Wed, 22 Jun 2022 14:15:37 +0200 Subject: [PATCH] Add english responsible text --- frontend/.env | 1 + frontend/src/appConfig.ts | 2 ++ frontend/src/routes/components/footer.tsx | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/.env b/frontend/.env index f88bc76d..6033d809 100644 --- a/frontend/.env +++ b/frontend/.env @@ -9,6 +9,7 @@ REACT_APP_SUPPORT_URL=https://example.org REACT_APP_SUPPORT_URL_EN=https://example.org/en REACT_APP_RESPONSIBLE_ORGANIZATION='Seksjon for integrasjon og elektroniske identiteter (INT)' +REACT_APP_RESPONSIBLE_ORGANIZATION_EN='Department for System Integration and Identity Management (INT)' REACT_APP_RESPONSIBLE_ORGANIZATION_LINK='https://www.usit.uio.no/om/organisasjon/bnt/usitint/' REACT_APP_DISABLE_NIN_VERIFICATION='false' diff --git a/frontend/src/appConfig.ts b/frontend/src/appConfig.ts index 63f8b64c..32047507 100644 --- a/frontend/src/appConfig.ts +++ b/frontend/src/appConfig.ts @@ -41,6 +41,8 @@ export const enableIgaCheck: boolean = env.REACT_APP_ENABLE_IGA_CHECK === 'true' /* Footer content */ export const responsibleOrganization: string = env.REACT_APP_RESPONSIBLE_ORGANIZATION as string +export const responsibleOrganizationEn: string = + env.REACT_APP_RESPONSIBLE_ORGANIZATION_EN as string /* no links */ export const itRulesLink: string = env.REACT_APP_IT_RULES_LINK as string diff --git a/frontend/src/routes/components/footer.tsx b/frontend/src/routes/components/footer.tsx index c2d737e8..3b04be49 100644 --- a/frontend/src/routes/components/footer.tsx +++ b/frontend/src/routes/components/footer.tsx @@ -5,6 +5,7 @@ import { Link } from '@mui/material' import { appInst, responsibleOrganization, + responsibleOrganizationEn, responsibleOrganizationLink, responsibleOrganizationLinkEn, itRulesLink, @@ -87,6 +88,8 @@ function Footer() { return link || '' } + const getResponsibleOrganization = () => i18n.language === 'en' ? responsibleOrganizationEn : responsibleOrganization + const getItRulesLink = () => getLink(itRulesLinkEn, itRulesLink) const getTechnicalSupportLink = () => getLink(technicalSupportLinkEn, technicalSupportLink) @@ -127,7 +130,7 @@ function Footer() { {t('footer:link.responsibleOrganization.header')} </LinkHeader> <StyledLink href={getResponsibleOrganizationLink()}> - {responsibleOrganization} + {getResponsibleOrganization()} </StyledLink> </LinkSection> </LinkContainer> -- GitLab