Skip to content

Commit

Permalink
Merge pull request #638 from codeforboston/tbardini/i18n-portuguese-r…
Browse files Browse the repository at this point in the history
…eview

Portuguese i18n Language Review - Public View
  • Loading branch information
thiagobardini authored Oct 16, 2024
2 parents 8209697 + d1e887b commit 70fdb9b
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 124 deletions.
2 changes: 0 additions & 2 deletions frontend/front/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"i18n-ally.localesPaths": ["./src/pages/Public/locales"],
"i18n-ally.defaultNamespace": "translation",
"i18n-ally.sourceLanguage": "english",
"i18n-ally.keystyle": "nested"
}
2 changes: 1 addition & 1 deletion frontend/front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"react-redux": "^8.0.2",
"react-router-dom": "6",
"react-scripts": "5.0.1",
"use-debounce": "^10.0.2",
"use-debounce": "^10.0.4",
"web-vitals": "^2.1.0"
},
"scripts": {
Expand Down
4 changes: 0 additions & 4 deletions frontend/front/src/pages/Public/.vscode/settings.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { forwardRef } from "react";
import { useTranslation } from "react-i18next";
import { Stack, Button, Box } from "@mui/material";
import { HeatPumpAddressField } from "../../../components/SurveyComponent/HeatPumpAddressField";
import { useForm } from "react-hook-form";
Expand All @@ -16,6 +17,8 @@ export const AddressValidatorComponent = forwardRef(
) => {
const navigate = useNavigate();

const { t } = useTranslation();

const { handleSubmit, control } = useForm({
defaultValues: {
address: {
Expand All @@ -38,7 +41,7 @@ export const AddressValidatorComponent = forwardRef(
<Box mx={{ margin: "1em 0" }}>
<HeatPumpAddressField
control={control}
label={"Enter the address where you're interested in a heat pump:"}
label={t("public.survey.text3")}
/>
</Box>
<Stack direction="row" justifyContent="center" spacing={2} mb={5}>
Expand Down
21 changes: 7 additions & 14 deletions frontend/front/src/pages/Public/Pages/SurveyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,8 @@ export const SurveyPage = () => {
justifyContent="center"
data-testid="publicSurveyInfoMessage"
>
<p>
Fill out this form to record your interest in installing a heat pump
for your home.
</p>
<p>
An ULHPA representative will contact you with more information about
the installation process.
</p>
<p>{t("public.survey.text1")}</p>
<p>{t("public.survey.text2")}</p>
</Stack>
<HeatPumpFade show={step === STEP_ADDRESS}>
<AddressValidatorComponent
Expand All @@ -127,13 +121,11 @@ export const SurveyPage = () => {
<ThanksForSubmission />
</HeatPumpSlide>

<Snackbar open={createHomeError}>
<Alert severity="error">
There was an error submitting your address. Please try again later.
</Alert>
<Snackbar open={!!createHomeError}>
<Alert severity="error">{t("public.survey.alert1")}</Alert>
</Snackbar>
<Snackbar open={surveyVisitError}>
<Alert severity="error">{"Error submitting survey."}</Alert>
<Snackbar open={!!surveyVisitError}>
<Alert severity="error">{t("public.survey.alert2")}</Alert>
</Snackbar>
</>
),
Expand All @@ -146,6 +138,7 @@ export const SurveyPage = () => {
isSurveyVisitLoading,
step,
surveyVisitError,
t,
]
);

Expand Down
7 changes: 6 additions & 1 deletion frontend/front/src/pages/Public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@
"survey": {
"heading1BlueBgGround": "Take the Survey",
"under-construction": "Public Survey is Currently Under Development!",
"work-in-progress": "UNDER CONSTRUCTION"
"work-in-progress": "UNDER CONSTRUCTION",
"text1": "Fill out this form to record your interest in installing a heat pump for your home.",
"text2": "An ULHPA representative will contact you with more information about the installation process.",
"alert1": "There was an error submitting your address. Please try again later.",
"alert2": "Error submitting survey.",
"text3": "Enter the address where you're interested in a heat pump:"
},
"benefits-heat-pump": {
"cardBenefits": {
Expand Down
7 changes: 6 additions & 1 deletion frontend/front/src/pages/Public/locales/es-419.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@
"survey": {
"heading1BlueBgGround": "Realice la encuesta",
"under-construction": "¡La encuesta pública está actualmente en desarrollo!",
"work-in-progress": "BAJO CONSTRUCCIÓN"
"work-in-progress": "BAJO CONSTRUCCIÓN",
"text1": "Complete este formulario para dejar constancia de su interés en instalar una bomba de calor para su hogar.",
"text2": "Un representante de ULHPA se comunicará con usted para brindarle más información sobre el proceso de instalación.",
"alert1": "Hubo un error al enviar su dirección. \nInténtelo de nuevo más tarde.",
"alert2": "Error al enviar la encuesta.",
"text3": "Introduce la dirección donde estás interesado en una bomba de calor:"
},
"benefits-heat-pump": {
"cardBenefits": {
Expand Down
7 changes: 6 additions & 1 deletion frontend/front/src/pages/Public/locales/ht.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@
"survey": {
"heading1BlueBgGround": "Pran Sondaj la",
"under-construction": "Sondaj Piblik la ap Devlopman kounye a!",
"work-in-progress": "Sou konstriksyon"
"work-in-progress": "Sou konstriksyon",
"text1": "Ranpli fòm sa a pou anrejistre enterè w genyen nan enstale yon ponp chalè pou kay ou.",
"text2": "Yon reprezantan ULHPA ap ​​kontakte w pou w jwenn plis enfòmasyon sou pwosesis enstalasyon an.",
"alert1": "Te gen yon erè lè w te voye adrès ou a. \nTanpri eseye ankò pita.",
"alert2": "Erè nan soumèt sondaj la.",
"text3": "Antre adrès kote w enterese nan yon ponp chalè:"
},
"benefits-heat-pump": {
"cardBenefits": {
Expand Down
Loading

0 comments on commit 70fdb9b

Please sign in to comment.