diff --git a/apps/official/components/CovMapFeatureInfo.tsx b/apps/official/components/CovMapFeatureInfo.tsx index 5c5ee017..d01d6f57 100644 --- a/apps/official/components/CovMapFeatureInfo.tsx +++ b/apps/official/components/CovMapFeatureInfo.tsx @@ -24,6 +24,7 @@ import ContactsLowIcon from "../static/images/contacts-low.svg"; import ContactsMediumIcon from "../static/images/contacts-medium.svg"; import SymptomsLowIcon from "../static/images/symptoms-low.svg"; import { usePathPreservingQueryChange } from "app-config/components/customHistoryHooks"; +import { useTranslation } from "react-i18next"; const useStyles = makeStyles((theme) => ({ action: { @@ -148,19 +149,21 @@ export const CovMapFeatureInfo = ({ rawData }: FeatureInfoProps) => { ); const ContactsIcon = ({ score }: { score: ContactScore }) => { + const { t } = useTranslation("translation"); + switch (score) { case ContactScore.Low: return (
- reduziert + {t("contacts-indicator.reduced")}
); case ContactScore.Medium: return (
- erhöht + {t("contacts-indicator.increased")}
); default: diff --git a/apps/official/components/basic-recommendations/BasicRecommendations.tsx b/apps/official/components/basic-recommendations/BasicRecommendations.tsx index 33d45dde..df6dd7e7 100644 --- a/apps/official/components/basic-recommendations/BasicRecommendations.tsx +++ b/apps/official/components/basic-recommendations/BasicRecommendations.tsx @@ -13,8 +13,8 @@ import HygieneIcon from "../../static/images/hand-washing.svg"; import MaskIcon from "../../static/images/mask.svg"; import VentilationIcon from "../../static/images/fresh-air.svg"; import RegionalIcon from "../../static/images/checklist.svg"; -import { ActionTexts } from "../../static/texts/ActionTexts"; import { NavigationTitle } from "app-config/components/NavigationTitle"; +import { useTranslation } from "react-i18next"; const useStyles = makeStyles({ teaser: { @@ -35,11 +35,14 @@ const useStyles = makeStyles({ textAlign: "left", fontWeight: "bold", }, + multiLineText: { + whiteSpace: "break-spaces", + }, }); const CountyTeaser = ({ county, url }: { county: string; url: string }): JSX.Element => { const classes = useStyles(); - const teaser = `${ActionTexts.COUNTY_TEASER_1}${county}${ActionTexts.COUNTY_TEASER_2}`; + const { t } = useTranslation("translation"); return ( ); diff --git a/src/components/LazyError.tsx b/src/components/LazyError.tsx index 26641bed..d250ecc5 100644 --- a/src/components/LazyError.tsx +++ b/src/components/LazyError.tsx @@ -1,14 +1,16 @@ import { useEffect } from "react"; +import { useTranslation } from "react-i18next"; import { AppApi } from "src/state/app"; import { useThunkDispatch } from "src/useThunkDispatch"; export const LazyError = () => { const dispatch = useThunkDispatch(); + const { t } = useTranslation("common"); useEffect(() => { dispatch( AppApi.setSnackbarMessage({ - text: "Check you network connection and refresh the app/page.", + text: t("lazy-error"), type: "error", duration: 30000, }), diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx index 39524f69..1a408996 100644 --- a/src/components/NavBar.tsx +++ b/src/components/NavBar.tsx @@ -141,7 +141,7 @@ export const NavBar = () => { }); } catch (err) { clipboard.writeText("https://" + window.location.hostname); - dispatch(AppApi.setSnackbarMessage({ text: "Link in Zwischenablage kopiert", type: "info" })); + dispatch(AppApi.setSnackbarMessage({ text: t("common:copied-to-clipboard"), type: "info" })); } }; diff --git a/src/components/WelcomeInfo.tsx b/src/components/WelcomeInfo.tsx index 787eb0b1..67de5ff9 100644 --- a/src/components/WelcomeInfo.tsx +++ b/src/components/WelcomeInfo.tsx @@ -8,9 +8,11 @@ import { AppApi } from "../state/app"; import { State } from "../state"; import { useThunkDispatch } from "../useThunkDispatch"; import { config } from "app-config/index"; +import { useTranslation } from "react-i18next"; export const WelcomeInfo = () => { const dispatch = useThunkDispatch(); + const { t } = useTranslation("common"); const currentVisual = useSelector((state: State) => state.app.currentVisual); const infoDialogs = useSelector((state: State) => state.app.infoDialogs); const InfoComponent = config.visuals[currentVisual].InfoComponent; @@ -32,7 +34,7 @@ export const WelcomeInfo = () => { {InfoComponent && } diff --git a/src/components/WelcomeStepsModal/WelcomeModal1.tsx b/src/components/WelcomeStepsModal/WelcomeModal1.tsx index 50e9cb76..a7bfff4f 100644 --- a/src/components/WelcomeStepsModal/WelcomeModal1.tsx +++ b/src/components/WelcomeStepsModal/WelcomeModal1.tsx @@ -3,6 +3,7 @@ import { Typography } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; import { useCommonWelcomeModalStyles } from "./useCommonWelcomeModalStyles"; import { FullWidthFixedAspectImage } from "./FullWidthFixedAspectImage"; +import { useTranslation } from "react-i18next"; const useStyles = makeStyles(() => ({ listItemDiv: { @@ -17,6 +18,7 @@ export const WelcomeModal1: React.FC = () => { ...useCommonWelcomeModalStyles(), ...useStyles(), }; + const { t } = useTranslation("common"); const listIcon = ( { return ( <> - Willkommen bei der CovMap + {t("welcome.title")}
{listIcon} - - Entwickelt von Ärzten der Charité - Universitätsmedizin Berlin - + {t("welcome.info-1")}
{listIcon} - Regionale Risikoeinschätzung zum Coronavirus + {t("welcome.info-2")}
{listIcon} - Informationen zu allgemeinen Schutzmaßnahmen + {t("welcome.info-3")}
{listIcon} - Links zu aktuellen Verhaltensregeln aller Landkreise + {t("welcome.info-4")}
Charité Berlin diff --git a/src/components/WelcomeStepsModal/WelcomeModal2.tsx b/src/components/WelcomeStepsModal/WelcomeModal2.tsx index 25d7f8c0..fb99e6ca 100644 --- a/src/components/WelcomeStepsModal/WelcomeModal2.tsx +++ b/src/components/WelcomeStepsModal/WelcomeModal2.tsx @@ -2,23 +2,22 @@ import React from "react"; import { Typography } from "@material-ui/core"; import { useCommonWelcomeModalStyles } from "./useCommonWelcomeModalStyles"; import { FullWidthFixedAspectImage } from "./FullWidthFixedAspectImage"; +import { useTranslation } from "react-i18next"; export const WelcomeModal2: React.FC = () => { const classes = useCommonWelcomeModalStyles(); + const { t } = useTranslation("common"); return ( <> - Was ist die CovMap? + {t("welcome.what-is-it.title")}
Welcome
- - Die CovMap möchte Risikogebiete so zeitnah wie möglich erkennen. Dazu ziehen wir die offiziellen Fallzahlen, - sowie ein von uns entwickeltes Vorhersagemodell basierend auf Kontakten und Symptomen heran. - + {t("welcome.what-is-it.text")}
); diff --git a/src/components/WelcomeStepsModal/WelcomeModal3.tsx b/src/components/WelcomeStepsModal/WelcomeModal3.tsx index 8f7c00fc..0c767c02 100644 --- a/src/components/WelcomeStepsModal/WelcomeModal3.tsx +++ b/src/components/WelcomeStepsModal/WelcomeModal3.tsx @@ -2,28 +2,27 @@ import React from "react"; import { Typography } from "@material-ui/core"; import { useCommonWelcomeModalStyles } from "./useCommonWelcomeModalStyles"; import { FullWidthFixedAspectImage } from "./FullWidthFixedAspectImage"; +import { useTranslation } from "react-i18next"; export const WelcomeModal3: React.FC = () => { const classes = useCommonWelcomeModalStyles(); + const { t } = useTranslation("common"); return ( <> - Was zeigt mir die CovMap an? + {t("welcome.what-does-it-show.title")}
Welcome
- - Auf der Karte kannst du ganz einfach erkennen, wo sich momentane Risikogebiete in Deutschland und in Deiner - Region befinden. - + {t("welcome.what-does-it-show.text")} - Grün = normales Risiko + {t("welcome.what-does-it-show.normal-risk")} - Orange = mittleres Risiko - Rot = hohes Risiko + {t("welcome.what-does-it-show.medium-risk")} + {t("welcome.what-does-it-show.high-risk")}
); diff --git a/src/components/WelcomeStepsModal/WelcomeModalPostalCode.tsx b/src/components/WelcomeStepsModal/WelcomeModalPostalCode.tsx index c77d4df8..c8bc0902 100644 --- a/src/components/WelcomeStepsModal/WelcomeModalPostalCode.tsx +++ b/src/components/WelcomeStepsModal/WelcomeModalPostalCode.tsx @@ -10,6 +10,7 @@ import { Link, useHistory } from "react-router-dom"; import { WelcomeModalStep } from "./welcomeStepsConfig"; import { useSelector } from "react-redux"; import { State } from "src/state"; +import { Trans, useTranslation } from "react-i18next"; function isValidPostalCode(text: string) { return /^[0-9]{5}$/.test(text); @@ -33,6 +34,7 @@ const useStyles = makeStyles(() => ({ export const WelcomeModalPostalCode: React.FC = () => { const classes = { ...useCommonWelcomeModalStyles(), ...useStyles() }; + const { t } = useTranslation("common"); const dispatch = useThunkDispatch(); const history = useHistory(); const postCode = useSelector((state: State) => state.app.intro.postCode); @@ -74,15 +76,13 @@ export const WelcomeModalPostalCode: React.FC = () => { return ( <> - - Für Dein regionales Risiko brauchen wir noch die Postleitzahl Deines Wohnortes - + {t("welcome.regional-risk.title")} {
- Ja, ich habe die Datenschutzerklärung zur - Kenntnis genommen und willige ein. + + part-0 part-1 part-2 +
@@ -108,7 +109,7 @@ export const WelcomeModalPostalCode: React.FC = () => { color="primary" onClick={submit} > - Jetzt starten + {t("welcome.regional-risk.start")} @@ -119,7 +120,7 @@ export const WelcomeModalPostalCode: React.FC = () => { variant="contained" onClick={onSkip} > - Ohne Postleitzahl weiter + {t("welcome.regional-risk.continue-without-post-code")} diff --git a/src/components/WelcomeStepsModal/WelcomeStepsModal.tsx b/src/components/WelcomeStepsModal/WelcomeStepsModal.tsx index e4b93c13..159e52c5 100644 --- a/src/components/WelcomeStepsModal/WelcomeStepsModal.tsx +++ b/src/components/WelcomeStepsModal/WelcomeStepsModal.tsx @@ -9,6 +9,7 @@ import { State } from "../../state"; import { StepConfig, welcomeStepsConfig } from "./welcomeStepsConfig"; import { MobileDotsStepper } from "./MobileDotsStepper"; import { useCommonWelcomeModalStyles } from "./useCommonWelcomeModalStyles"; +import { useTranslation } from "react-i18next"; function getStepConfig(stepName?: string): StepConfig | undefined { return welcomeStepsConfig.find(({ name }) => name === stepName); @@ -19,6 +20,7 @@ export const WelcomeStepsModal: React.FC<{ subPage?: string }> = (props) => { const theme = useTheme(); const fullScreen = useMediaQuery(theme.breakpoints.down("sm")); const history = useHistory(); + const { t } = useTranslation("common"); const userPostalCode = useSelector((state: State) => state.app.userPostalCode); @@ -38,7 +40,7 @@ export const WelcomeStepsModal: React.FC<{ subPage?: string }> = (props) => { component={Link} to={currentStepConfig.next} > - Weiter + {t("welcome.continue")} ) : null; @@ -52,7 +54,7 @@ export const WelcomeStepsModal: React.FC<{ subPage?: string }> = (props) => { component={Link} to={currentStepConfig.skip} > - Überspringen + {t("welcome.skip")} ) : null; diff --git a/static/locales/de/common.json b/static/locales/de/common.json index 88c2299e..c95b8a95 100644 --- a/static/locales/de/common.json +++ b/static/locales/de/common.json @@ -12,5 +12,41 @@ "share-button-twitter": "Auf Twitter teilen", "share-description-error-details": "Klicke hier für Fehlerdetails" }, - "no data for selected timeframe": "Keine Daten für den ausgewählten Zeitraum." + "no data for selected timeframe": "Keine Daten für den ausgewählten Zeitraum.", + "welcome": { + "title": "Willkommen bei der CovMap", + "info-1": "Entwickelt von Ärzten der Charité - Universitätsmedizin Berlin", + "info-2": "Regionale Risikoeinschätzung zum Coronavirus", + "info-3": "Informationen zu allgemeinen Schutzmaßnahmen", + "info-4": "Links zu aktuellen Verhaltensregeln aller Landkreise", + "what-is-it": { + "title": "Was ist die CovMap?", + "text": "Die CovMap möchte Risikogebiete so zeitnah wie möglich erkennen. Dazu ziehen wir die offiziellen Fallzahlen, sowie ein von uns entwickeltes Vorhersagemodell basierend auf Kontakten und Symptomen heran." + }, + "what-does-it-show": { + "title": "Was zeigt mir die CovMap an?", + "text": "Auf der Karte kannst du ganz einfach erkennen, wo sich momentane Risikogebiete in Deutschland und in Deiner Region befinden.", + "normal-risk": "Grün = normales Risiko", + "medium-risk": "Orange = mittleres Risiko", + "high-risk": "Rot = hohes Risiko" + }, + "regional-risk": { + "title": "Für Dein regionales Risiko brauchen wir noch die Postleitzahl Deines Wohnortes", + "invalid-post-code": "Bitte valide PLZ eingeben", + "accept-privacy": "Ja, ich habe die <1>Datenschutzerklärung zur Kenntnis genommen und willige ein.", + "start": "Jetzt starten", + "continue-without-post-code": "Ohne Postleitzahl weiter" + }, + "continue": "Weiter", + "skip": "Überspringen" + }, + "install-promt": { + "text-1": "Diese App kann auf deinem Geraet installiert werden.", + "text-2": "Tappe den Button unten um dich zu entscheiden!", + "confirm": "Alles klar!", + "cancel": "Nee danke." + }, + "lazy-error": "Überprüfe Deine Netzwerkverbindung und aktualisiere die App.", + "copied-to-clipboard": "Link in Zwischenablage kopiert", + "close": "Schließen" } diff --git a/static/locales/en/common.json b/static/locales/en/common.json index 15b46189..68dd67aa 100644 --- a/static/locales/en/common.json +++ b/static/locales/en/common.json @@ -12,5 +12,6 @@ "share-button-twitter": "Share on Twitter", "share-description-error-details": "Click for error details" }, - "no data for selected timeframe": "No data available for the selected date." + "no data for selected timeframe": "No data available for the selected date.", + "lazy-error": "Check you network connection and refresh the app/page." }