diff --git a/src/app/App.tsx b/src/app/App.tsx index 25aecb4..6e6e7ba 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -15,6 +15,7 @@ import { useAppConfig } from 'hooks/useAppConfig' import { AuthProvider } from 'hooks/useAuth' import { CorrectionProvider } from 'hooks/useCorrection' import { FormProvider } from 'hooks/useForm' +import { LocalizationProvider } from 'hooks/useLocalization' import { ResponseProvider } from 'hooks/useResponse' import { StoredFormProvider } from 'hooks/useStoredForm' import { BrowserRouter as Router, Route, Routes } from 'react-router-dom' @@ -23,31 +24,36 @@ export const App = () => { const { basename } = useAppConfig() return ( - - - - - - - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - - - - - - - - + + + + + + + + + } /> + } /> + } /> + } + /> + } /> + } /> + } /> + } /> + } /> + } /> + + + + + + + + + ) } diff --git a/src/app/pages/Instructions.tsx b/src/app/pages/Instructions.tsx index 653bfc1..abe3ae4 100644 --- a/src/app/pages/Instructions.tsx +++ b/src/app/pages/Instructions.tsx @@ -1,42 +1,28 @@ +import { useLocalizationContext } from 'hooks/useLocalization' import { Link } from 'react-router-dom' -export const Instructions = () => ( -
-
-
-

Instructions

-
    -
  1. - Please fill out each question to the best of your ability, and - submit the survey before the beginning of the quarter you are - reporting your needs for. -
  2. -
  3. - Please only consider your organisation's total needs for the quarter - in question that you don't already have covered. -
  4. -
  5. - It is okay to use estimates, and we understand that conditions & - needs change! We are only looking for a rough understanding of your - needs. -
  6. -
  7. - If your organisation operates in multiple regions, please fill out - the survey multiple times. Please submit it once per region that you - operate in, so we can keep the needs data separate. -
  8. -
  9. - If you want to submit an assessment for a different quarter, please - create a separate submission. -
  10. -
+export const Instructions = () => { + const { localizeAppString } = useLocalizationContext() + return ( +
+
+
+

{localizeAppString('instructions_title')}

+
    +
  1. {localizeAppString('instructions_1')}
  2. +
  3. {localizeAppString('instructions_2')}
  4. +
  5. {localizeAppString('instructions_3')}
  6. +
  7. {localizeAppString('instructions_4')}
  8. +
  9. {localizeAppString('instructions_5')}
  10. +
-

- - Continue - -

-
-
-
-) +

+ + {localizeAppString('instructions_button')} + +

+
+
+
+ ) +} diff --git a/src/components/LanguageSelector.tsx b/src/components/LanguageSelector.tsx new file mode 100644 index 0000000..9ce9171 --- /dev/null +++ b/src/components/LanguageSelector.tsx @@ -0,0 +1,34 @@ +import { useLocalizationContext } from 'hooks/useLocalization' +import { FunctionComponent } from 'react' +import { appStrings, LanguageCodeKeys } from 'schema/localizationTypes' + +type LangValuesForDropdown = { + code: LanguageCodeKeys + displayName: string +} + +export const LanguageSelector: FunctionComponent = () => { + const { languageCode, setLanguageCode } = useLocalizationContext() + const languageValues: LangValuesForDropdown[] = Array.from( + appStrings.entries(), + ).map(([langKey, appStringEntry]) => ({ + code: langKey, + displayName: appStringEntry.language, + })) + + return ( + + ) +} diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 4541245..a254873 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,4 +1,5 @@ import { ExpiresCountdown } from 'components/ExpiresCountdown' +import { LanguageSelector } from 'components/LanguageSelector' import { useAppConfig } from 'hooks/useAppConfig' import { useAuth } from 'hooks/useAuth' import { useState } from 'react' @@ -102,6 +103,9 @@ export const Navbar = () => {