@@ -13,8 +13,8 @@ import HygieneIcon from "../../static/images/hand-washing.svg";
1313import MaskIcon from "../../static/images/mask.svg" ;
1414import VentilationIcon from "../../static/images/fresh-air.svg" ;
1515import RegionalIcon from "../../static/images/checklist.svg" ;
16- import { ActionTexts } from "../../static/texts/ActionTexts" ;
1716import { NavigationTitle } from "app-config/components/NavigationTitle" ;
17+ import { useTranslation } from "react-i18next" ;
1818
1919const useStyles = makeStyles ( {
2020 teaser : {
@@ -35,11 +35,14 @@ const useStyles = makeStyles({
3535 textAlign : "left" ,
3636 fontWeight : "bold" ,
3737 } ,
38+ multiLineText : {
39+ whiteSpace : "break-spaces" ,
40+ } ,
3841} ) ;
3942
4043const CountyTeaser = ( { county, url } : { county : string ; url : string } ) : JSX . Element => {
4144 const classes = useStyles ( ) ;
42- const teaser = ` ${ ActionTexts . COUNTY_TEASER_1 } ${ county } ${ ActionTexts . COUNTY_TEASER_2 } ` ;
45+ const { t } = useTranslation ( "translation" ) ;
4346
4447 return (
4548 < Button href = { url } target = "_blank" disableRipple >
@@ -48,7 +51,7 @@ const CountyTeaser = ({ county, url }: { county: string; url: string }): JSX.Ele
4851 < Grid container direction = "row" alignItems = "center" spacing = { 2 } >
4952 < Grid item xs = { 10 } >
5053 < Typography variant = "body1" className = { classes . leftText } >
51- { teaser }
54+ { t ( "basic-recommendations.county- teaser" , { county } ) }
5255 </ Typography >
5356 </ Grid >
5457 < Grid item xs = { 2 } >
@@ -63,11 +66,13 @@ const CountyTeaser = ({ county, url }: { county: string; url: string }): JSX.Ele
6366
6467const FinalTeaser = ( ) : JSX . Element => {
6568 const classes = useStyles ( ) ;
69+ const { t } = useTranslation ( "translation" ) ;
70+
6671 return (
6772 < Card className = { classes . teaser } >
6873 < CardContent >
69- < Typography variant = "body1" className = { classes . leftText } >
70- { ActionTexts . FINAL_TEASER }
74+ < Typography variant = "body1" className = { ` ${ classes . leftText } ${ classes . multiLineText } ` } >
75+ { t ( "basic-recommendations.final-teaser" ) }
7176 </ Typography >
7277 </ CardContent >
7378 </ Card >
@@ -76,16 +81,18 @@ const FinalTeaser = (): JSX.Element => {
7681
7782const Intro = ( ) : JSX . Element => {
7883 const classes = useStyles ( ) ;
84+ const { t } = useTranslation ( "translation" ) ;
85+
7986 return (
8087 < Grid container direction = "column" spacing = { 4 } >
8188 < Grid item >
8289 < Typography variant = "body1" className = { classes . leftText } >
83- { ActionTexts . INTRO_TEASER_1 }
90+ { t ( "basic-recommendations.intro-teaser-1" ) }
8491 </ Typography >
8592 </ Grid >
8693 < Grid item >
8794 < Typography variant = "body1" className = { classes . subHeader } >
88- { ActionTexts . INTRO_TEASER_2 }
95+ { t ( "basic-recommendations.intro-teaser-2" ) }
8996 </ Typography >
9097 </ Grid >
9198 </ Grid >
@@ -94,6 +101,8 @@ const Intro = (): JSX.Element => {
94101
95102const ContactSection = ( ) : JSX . Element => {
96103 const classes = useStyles ( ) ;
104+ const { t } = useTranslation ( "translation" ) ;
105+
97106 return (
98107 < div >
99108 < Grid container direction = "row" >
@@ -102,19 +111,21 @@ const ContactSection = (): JSX.Element => {
102111 </ Grid >
103112 < Grid item xs = { 9 } >
104113 < Typography variant = "h1" className = { classes . leftText } >
105- { ActionTexts . CONTACT_HEADLINE }
114+ { t ( "basic-recommendations.contact.headline" ) }
106115 </ Typography >
107116 </ Grid >
108117 </ Grid >
109- < Typography variant = "body1" className = { classes . leftText } >
110- { ActionTexts . CONTACT_TEXT }
118+ < Typography variant = "body1" className = { ` ${ classes . leftText } ${ classes . multiLineText } ` } >
119+ { t ( "basic-recommendations.contact.text" ) }
111120 </ Typography >
112121 </ div >
113122 ) ;
114123} ;
115124
116125const DistanceSection = ( ) : JSX . Element => {
117126 const classes = useStyles ( ) ;
127+ const { t } = useTranslation ( "translation" ) ;
128+
118129 return (
119130 < div >
120131 < Grid container direction = "row" >
@@ -123,19 +134,21 @@ const DistanceSection = (): JSX.Element => {
123134 </ Grid >
124135 < Grid item xs = { 9 } >
125136 < Typography variant = "h1" className = { classes . leftText } >
126- { ActionTexts . DISTANCE_HEADLINE }
137+ { t ( "basic-recommendations.distance.headline" ) }
127138 </ Typography >
128139 </ Grid >
129140 </ Grid >
130- < Typography variant = "body1" className = { classes . leftText } >
131- { ActionTexts . DISTANCE_TEXT }
141+ < Typography variant = "body1" className = { ` ${ classes . leftText } ${ classes . multiLineText } ` } >
142+ { t ( "basic-recommendations.distance.text" ) }
132143 </ Typography >
133144 </ div >
134145 ) ;
135146} ;
136147
137148const MaskSection = ( ) : JSX . Element => {
138149 const classes = useStyles ( ) ;
150+ const { t } = useTranslation ( "translation" ) ;
151+
139152 return (
140153 < div >
141154 < Grid container direction = "row" >
@@ -144,19 +157,21 @@ const MaskSection = (): JSX.Element => {
144157 </ Grid >
145158 < Grid item xs = { 9 } >
146159 < Typography variant = "h1" className = { classes . leftText } >
147- { ActionTexts . MASK_HEADLINE }
160+ { t ( "basic-recommendations.mask.headline" ) }
148161 </ Typography >
149162 </ Grid >
150163 </ Grid >
151- < Typography variant = "body1" className = { classes . leftText } >
152- { ActionTexts . MASK_TEXT }
164+ < Typography variant = "body1" className = { ` ${ classes . leftText } ${ classes . multiLineText } ` } >
165+ { t ( "basic-recommendations.mask.text" ) }
153166 </ Typography >
154167 </ div >
155168 ) ;
156169} ;
157170
158171const VentilationSection = ( ) : JSX . Element => {
159172 const classes = useStyles ( ) ;
173+ const { t } = useTranslation ( ) ;
174+
160175 return (
161176 < div >
162177 < Grid container direction = "row" >
@@ -165,19 +180,21 @@ const VentilationSection = (): JSX.Element => {
165180 </ Grid >
166181 < Grid item xs = { 9 } >
167182 < Typography variant = "h1" className = { classes . leftText } >
168- { ActionTexts . VENTILATION_HEADLINE }
183+ { t ( "basic-recommendations.ventilation.headline" ) }
169184 </ Typography >
170185 </ Grid >
171186 </ Grid >
172- < Typography variant = "body1" className = { classes . leftText } >
173- { ActionTexts . VENTILATION_TEXT }
187+ < Typography variant = "body1" className = { ` ${ classes . leftText } ${ classes . multiLineText } ` } >
188+ { t ( "basic-recommendations.ventilation.text" ) }
174189 </ Typography >
175190 </ div >
176191 ) ;
177192} ;
178193
179194const HygieneSection = ( ) : JSX . Element => {
180195 const classes = useStyles ( ) ;
196+ const { t } = useTranslation ( ) ;
197+
181198 return (
182199 < div >
183200 < Grid container direction = "row" >
@@ -186,19 +203,20 @@ const HygieneSection = (): JSX.Element => {
186203 </ Grid >
187204 < Grid item xs = { 9 } >
188205 < Typography variant = "h1" className = { classes . leftText } >
189- { ActionTexts . HYGIENE_HEADLINE }
206+ { t ( "basic-recommendations.hygiene.headline" ) }
190207 </ Typography >
191208 </ Grid >
192209 </ Grid >
193- < Typography variant = "body1" className = { classes . leftText } >
194- { ActionTexts . HYGIENE_TEXT }
210+ < Typography variant = "body1" className = { ` ${ classes . leftText } ${ classes . multiLineText } ` } >
211+ { t ( "basic-recommendations.hygiene.text" ) }
195212 </ Typography >
196213 </ div >
197214 ) ;
198215} ;
199216
200217const RegionalSection = ( ) : JSX . Element => {
201218 const classes = useStyles ( ) ;
219+ const { t } = useTranslation ( ) ;
202220 return (
203221 < div >
204222 < Grid container direction = "row" >
@@ -207,12 +225,12 @@ const RegionalSection = (): JSX.Element => {
207225 </ Grid >
208226 < Grid item xs = { 9 } >
209227 < Typography variant = "h1" className = { classes . leftText } >
210- { ActionTexts . REGIONAL_HEADLINE }
228+ { t ( "basic-recommendations.regional.headline" ) }
211229 </ Typography >
212230 </ Grid >
213231 </ Grid >
214- < Typography variant = "body1" className = { classes . leftText } >
215- { ActionTexts . REGIONAL_TEXT }
232+ < Typography variant = "body1" className = { ` ${ classes . leftText } ${ classes . multiLineText } ` } >
233+ { t ( "basic-recommendations.regional.text" ) }
216234 </ Typography >
217235 </ div >
218236 ) ;
@@ -245,12 +263,13 @@ function loadDistrictData(location): DistrictData | undefined {
245263export const BasicRecommendations = ( ) : JSX . Element => {
246264 const location = useLocation ( ) ;
247265 const districtData = loadDistrictData ( location ) ;
266+ const { t } = useTranslation ( "translation" ) ;
248267
249268 return (
250269 < >
251270 < main className = "sections" >
252271 < section >
253- < NavigationTitle title = { ActionTexts . TITLE } backToExpandedFeatureInfo = { true } />
272+ < NavigationTitle title = { t ( "basic-recommendations.title" ) } backToExpandedFeatureInfo = { true } />
254273 </ section >
255274 < section >
256275 { districtData !== undefined ? (
0 commit comments