Skip to content

Commit a3ad15f

Browse files
authored
Add Spanish and Chinese translations (#807)
* Final copy updates * Add Spanish translations * Add Chinese translations * Fix translation errors in frontend * Update Components page following type updates * Update CHANGELOG
1 parent 273991a commit a3ad15f

19 files changed

Lines changed: 421 additions & 324 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5353
- Add client feedback copy updates [#793](https://github.com/azavea/echo-locator/pull/793)
5454
- Add transit routing architecture ADR [#804](https://github.com/azavea/echo-locator/pull/804)
5555
- Add neighborhood csv submission instructions [#801](https://github.com/azavea/echo-locator/pull/801)
56+
- Add Spanish and Mandarin translations [#807](https://github.com/azavea/echo-locator/pull/807)
5657

5758
### Changed
5859

src/frontend/public/locales/en/translation.json

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@
4141
"otherTitle": "Other recommended neighborhoods",
4242
"otherTitleLegend": "Other",
4343
"tooFarTitle": "Not a match",
44-
"tooFarDisclaimer": "These neighborhoods are out of reach with your selected transit option, meaning commute times exceeding 1 hour"
44+
"tooFarDisclaimer": "These neighborhoods are excluded by the filters set in your profile",
45+
"groupedCountZipCodes": "zip codes",
46+
"groupedLoadMore": "Load more",
47+
"eccBenefits": "ECC Benefits",
48+
"min": "min",
49+
"over2Hours": "Over 2 hr"
4550
},
4651
"photoCredit": "Photo by {{artist}}. ",
4752
"photoSource": "Source.",
@@ -62,8 +67,14 @@
6267
"schoolChoice": "School choice options",
6368
"schoolsSafetyCard": {
6469
"header": "Schools & Safety",
65-
"schoolsLabel": "Schools",
66-
"safetyLabel": "Safety"
70+
"schools": "Schools",
71+
"safety": "Safety",
72+
"commute": "Commute",
73+
"high": "High",
74+
"above": "Above Avg",
75+
"average": "Average",
76+
"below": "Below Avg",
77+
"low": "Low"
6778
},
6879
"findUnitsLink": "Go to <strong>Find Units</strong> to learn more",
6980
"aboutAreaSection": {
@@ -136,7 +147,7 @@
136147
"header": "Your Profile",
137148
"stepBedroom": {
138149
"question": "How many bedrooms does your voucher have?",
139-
"description": "Reach out to your BHA Housing Coordinator if you're unsure."
150+
"description": "Reach out to your BHA Housing Specialist if you're unsure."
140151
},
141152
"stepImportance": {
142153
"question": "What is important to you?",
@@ -188,7 +199,10 @@
188199
"bodyText": "Edit your settings and add filters using the buttons at the top",
189200
"showMyRecommendations": "Show my recommendations",
190201
"listNeighborhoods": "List all neighborhoods",
191-
"showTopTen": "Show Top 10"
202+
"showTopTen": "Show Top 10",
203+
"next": "Next",
204+
"details": "Details",
205+
"prev": "Prev"
192206
},
193207
"filterModal": {
194208
"dialogHeading": "Filter recommendations",
@@ -201,7 +215,8 @@
201215
"regionMapCaption": "Based on a map by",
202216
"echoLink": "Learn more about ECHO",
203217
"regionsFilterLabel": "Filter by region selections",
204-
"eccFilter": "Only recommend Expanded Choice Communities (ECC)"
218+
"eccFilter": "Only recommend Expanded Choice Communities (ECC)",
219+
"eccFilterDescription": "Moving to an ECC area could qualify you for financial assistance to help with your security deposit, broker fees, and moving expenses."
205220
},
206221
"editTripsModal": {
207222
"dialogHeading": "Choose a trip",

src/frontend/public/locales/es/translation.json

Lines changed: 143 additions & 128 deletions
Large diffs are not rendered by default.

src/frontend/public/locales/zh/translation.json

Lines changed: 135 additions & 120 deletions
Large diffs are not rendered by default.

src/frontend/src/components/EditFiltersModal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const EditFiltersModal = ({ isMobile = false }) => {
149149
customImageClassName="w-full"
150150
customCaption={
151151
<>
152-
CC BY-SA 3.0. $
152+
CC BY-SA 3.0.{" "}
153153
{t("filterModal.regionMapCaption")}{" "}
154154
<Link
155155
href={PROTONK_URL}
@@ -213,7 +213,9 @@ const EditFiltersModal = ({ isMobile = false }) => {
213213
ecc: isSelected,
214214
})
215215
}
216-
description={`Select to only recommend neighborhoods that are Expanded Choice Communities (ECC)`}
216+
description={t(
217+
"filterModal.eccFilterDescription"
218+
)}
217219
footer={
218220
<Link
219221
href={BHA_URL}

src/frontend/src/components/EditWizard/StepTrips.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ const StepTrips = ({
8787
>
8888
<div>
8989
<h2 className="text-xl font-bold text-gray-900">
90-
{destination.purpose}
90+
{t([
91+
"destinationPurposes." +
92+
destination.purpose,
93+
])}
9194
</h2>
9295
<p className="max-w-40 flex flex-wrap font-normal text-gray-600 text-sm">
9396
{destination.location.label}

src/frontend/src/components/NeighborhoodCard/NeighborhoodCard.styles.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ export const cardStyles = tv({
1313
zip: "text-rg text-gray-500",
1414
tagsContainer: "flex flex-wrap gap-2",
1515
tag: " h-[21px] flex items-center gap-2 rounded-[var(--spacing-2)] border border-gray-300 px-2 py-1 text-xs font-bold text-[#006512]",
16-
statsContainer: "flex flex-start gap-5 self-stretch -mt-2",
17-
statItem: "flex flex-1 flex-col px-0 py-3 align-start",
16+
statsContainer:
17+
"flex flex-start gap-5 self-stretch -mt-2 overflow-hidden",
18+
statItem: "flex flex-1 max-w-[33.33%] flex-col px-0 py-3 align-start",
1819
navContainer:
1920
"flex align-center self-stretch gap-3 border-t border-gray-300 p-3 bg-gray-100",
2021
},
@@ -37,5 +38,13 @@ export const cardStyles = tv({
3738
root: "relative",
3839
},
3940
},
41+
isPopup: {
42+
true: {
43+
root: "w-fit",
44+
},
45+
false: {
46+
root: "w-auto",
47+
},
48+
},
4049
},
4150
});

src/frontend/src/components/NeighborhoodCard/NeighborhoodCard.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Button from "components/base/Button/Button";
1111
import Meter from "components/base/Meter/Meter";
1212
import Range from "components/base/Range/Range";
1313
import SchoolMeter from "components/SchoolMeter";
14+
import { useTranslation } from "react-i18next";
1415
import type { Stats } from "src/libs/formatNeighborhoodDataByCard";
1516
import { cardStyles } from "./NeighborhoodCard.styles";
1617

@@ -57,7 +58,12 @@ const NeighborhoodCard = ({
5758
statsContainer,
5859
statItem,
5960
navContainer,
60-
} = cardStyles({ hasImage: !!imageUrl, ...listViewStyling });
61+
} = cardStyles({
62+
hasImage: !!imageUrl,
63+
isPopup: isPopup,
64+
...listViewStyling,
65+
});
66+
const { t } = useTranslation();
6167

6268
const hasTag = isTopTen || hasECC;
6369
const { favorites } = useAppSelector(selectUserProfile);
@@ -106,13 +112,15 @@ const NeighborhoodCard = ({
106112
{isTopTen && (
107113
<div className={tag()}>
108114
<FlagIcon className="h-4 w-4 fill-[#50935D]" />
109-
<span>Top 10</span>
115+
<span>{t("discoverNeighborhoods.topTen")}</span>
110116
</div>
111117
)}
112118
{hasECC && (
113119
<div className={tag()}>
114120
<SquareDollarIcon className="h-[13px] w-[13px] -ml-[1px] mr-[1px] fill-[#50935D]" />
115-
<span>ECC Benefits</span>
121+
<span>
122+
{t("discoverNeighborhoods.eccBenefits")}
123+
</span>
116124
</div>
117125
)}
118126
</div>
@@ -142,7 +150,7 @@ const NeighborhoodCard = ({
142150
<ArrowLeftIcon className="font-normal h-[14px] w-[14px] text-black" />
143151
}
144152
>
145-
Prev
153+
{t("top10Tour.prev")}
146154
</Button>
147155
)}
148156
{onDetails && (
@@ -151,7 +159,7 @@ const NeighborhoodCard = ({
151159
className="flex-1"
152160
onPress={onDetails}
153161
>
154-
Details
162+
{t("top10Tour.details")}
155163
</Button>
156164
)}
157165
{onNext && (
@@ -163,7 +171,7 @@ const NeighborhoodCard = ({
163171
<ArrowRightIcon className="font-normal h-[14px] w-[14px] text-black" />
164172
}
165173
>
166-
Next
174+
{t("top10Tour.next")}
167175
</Button>
168176
)}
169177
</div>

src/frontend/src/components/NeighborhoodsList/NeighborhoodsList.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { useState } from "react";
22

3-
import type { NeighborhoodDetails } from "reducers/neighborhoods/types";
4-
import formatNeighborhoodDataByViewType from "libs/formatNeighborhoodDataByCard";
53
import Button from "components/base/Button/Button";
4+
import formatNeighborhoodDataByViewType from "libs/formatNeighborhoodDataByCard";
5+
import type { NeighborhoodDetails } from "reducers/neighborhoods/types";
66

7-
import { listStyles } from "./NeighborhoodsList.styles";
7+
import { useTranslation } from "react-i18next";
88
import ClickableNeighborhoodCard from "../NeighborhoodCard/ClickableNeighborhoodCard";
9+
import { listStyles } from "./NeighborhoodsList.styles";
910

1011
interface Props {
1112
neighborhoodDetailsMap: NeighborhoodDetails;
@@ -34,6 +35,7 @@ const NeighborhoodList = ({
3435
groupCount,
3536
button,
3637
} = listStyles({ isMobile: isMobile, isGroup: isGroup });
38+
const { t } = useTranslation();
3739

3840
// Display 10 Neighborhood cards per page.
3941
// If it's a grouped-by-neighborhood-name list,
@@ -58,7 +60,8 @@ const NeighborhoodList = ({
5860
<div className={groupContainer()}>
5961
<p className={groupTitle()}>{groupName}</p>
6062
<p className={groupCount()}>
61-
{neighborhoodList.length} zip codes
63+
{neighborhoodList.length}{" "}
64+
{t("discoverNeighborhoods.groupedCountZipCodes")}
6265
</p>
6366
</div>
6467
)}
@@ -99,7 +102,7 @@ const NeighborhoodList = ({
99102
className={button()}
100103
onClick={handleLoadMore}
101104
>
102-
Load More
105+
{t("discoverNeighborhoods.groupedLoadMore")}
103106
</Button>
104107
)}
105108
</div>

src/frontend/src/components/SchoolMeter.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ const SchoolMeter = ({
2929
return isSchoolChoice ? (
3030
<div className="flex flex-col gap-2 w-full">
3131
<div className={labelContainer()}>
32-
<AriaLabel className={mainLabel()}>{props.label}</AriaLabel>
32+
<AriaLabel className={mainLabel()}>
33+
{t([
34+
"neighborhoodDetail.schoolsSafetyCard." +
35+
props.labelKey,
36+
])}
37+
</AriaLabel>
3338
</div>
3439
<Link
3540
href={schoolChoiceLink}

0 commit comments

Comments
 (0)