Skip to content

Commit a31ebbe

Browse files
committed
Fix translation errors in frontend
1 parent b722727 commit a31ebbe

15 files changed

Lines changed: 67 additions & 35 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"groupedCountZipCodes": "zip codes",
4646
"groupedLoadMore": "Load more",
4747
"eccBenefits": "ECC Benefits",
48-
"commute": "Commute",
4948
"min": "min",
5049
"over2Hours": "Over 2 hr"
5150
},
@@ -68,8 +67,9 @@
6867
"schoolChoice": "School choice options",
6968
"schoolsSafetyCard": {
7069
"header": "Schools & Safety",
71-
"schoolsLabel": "Schools",
72-
"safetyLabel": "Safety",
70+
"schools": "Schools",
71+
"safety": "Safety",
72+
"commute": "Commute",
7373
"high": "High",
7474
"above": "Above Avg",
7575
"average": "Average",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"groupedCountZipCodes": "códigos postales",
4646
"groupedLoadMore": "Mostrar más",
4747
"eccBenefits": "Beneficios ECC",
48-
"commute": "Transporte",
4948
"min": "minutos",
5049
"over2Hours": "Over 2 hr"
5150
},
@@ -68,8 +67,9 @@
6867
"schoolChoice": "School choice options",
6968
"schoolsSafetyCard": {
7069
"header": "Escuelas y Seguridad",
71-
"schoolsLabel": "Escuelas",
72-
"safetyLabel": "Seguridad",
70+
"schools": "Escuelas",
71+
"safety": "Seguridad",
72+
"commute": "Transporte",
7373
"high": "Alto",
7474
"above": "Por encima del Promedio",
7575
"average": "Promedio",
@@ -199,7 +199,7 @@
199199
"bodyText": "Edita tus configuraciones y añade filtros usando los botones en la parte superior.",
200200
"showMyRecommendations": "Mostrar mis recomendaciones",
201201
"listNeighborhoods": "Lista de todos los vecindarios",
202-
"showTopTen": "Mostrar 10 mejores",
202+
"showTopTen": "Mostrar 10 Mejores",
203203
"next": "Siguiente",
204204
"details": "Detalles",
205205
"prev": "Anterior"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"groupedCountZipCodes": "個郵政編",
4646
"groupedLoadMore": "載入更多",
4747
"eccBenefits": "擴大選擇社區(ECC)補助",
48-
"commute": "通勤",
4948
"min": "分鐘",
5049
"over2Hours": "Over 2 hr"
5150
},
@@ -68,8 +67,9 @@
6867
"schoolChoice": "School choice options",
6968
"schoolsSafetyCard": {
7069
"header": "學校與安全",
71-
"schoolsLabel": "學校",
72-
"safetyLabel": "安全",
70+
"schools": "學校",
71+
"safety": "安全",
72+
"commute": "通勤",
7373
"high": "",
7474
"above": "高於平均",
7575
"average": "平均",

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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ const NeighborhoodCard = ({
5858
statsContainer,
5959
statItem,
6060
navContainer,
61-
} = cardStyles({ hasImage: !!imageUrl, ...listViewStyling });
61+
} = cardStyles({
62+
hasImage: !!imageUrl,
63+
isPopup: isPopup,
64+
...listViewStyling,
65+
});
6266
const { t } = useTranslation();
6367

6468
const hasTag = isTopTen || hasECC;

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}

src/frontend/src/components/YourTrips/YourTrips.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const YourTrips = ({
4141
(tripsFromDest: TripType[], dest: Destination) => [
4242
...tripsFromDest,
4343
{
44-
title: dest.purpose,
44+
title: t(["destinationPurposes." + dest.purpose]),
4545
subtitle: dest.location.label,
4646
neighborhoodZipcode: activeNeighborhood ?? "",
4747
destination: dest,

src/frontend/src/components/base/Meter/Meter.styles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { tv } from "tailwind-variants";
33
export const meterStyles = tv({
44
slots: {
55
root: "flex flex-col gap-3 w-full ",
6-
labelContainer: "flex flex-col",
6+
labelContainer: "flex flex-col w-full",
77
mainLabel: "text-sm text-gray-600",
8-
valueLabel: "text-sm font-bold text-black -mt-1 mb-[1px] text-nowrap",
8+
valueLabel:
9+
"text-sm font-bold text-black -mt-1 mb-[1px] text-nowrap truncate",
910
track: "absolute top-1 h-1 w-full rounded-[var(--spacing-1)] bg-gray-300",
1011
fill: "absolute h-[6px] rounded-[var(--spacing-1)]",
1112
thumb: "absolute rounded-[var(--spacing-1)] top-[3px] h-4 w-2 -translate-y-1/2 left-[calc(50%-2px)] bg-gray-500 border border-white",

src/frontend/src/components/base/Meter/Meter.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { meterStyles } from "./Meter.styles";
1010
type MeterStatus = "Low" | "Below Avg" | "Average" | "Above Avg" | "High";
1111

1212
export interface MeterProps extends AriaMeterProps {
13-
label: string;
13+
labelKey: string;
1414
showCategory?: boolean;
1515
}
1616

@@ -22,7 +22,7 @@ const getStatusFromValue = (value: number): MeterStatus => {
2222
return "High";
2323
};
2424

25-
const Meter = ({ label, showCategory = false, ...props }: MeterProps) => {
25+
const Meter = ({ labelKey, showCategory = false, ...props }: MeterProps) => {
2626
const { t } = useTranslation();
2727
const status = getStatusFromValue(props.value ?? 0);
2828
const { root, labelContainer, mainLabel, valueLabel, track, fill, thumb } =
@@ -35,7 +35,12 @@ const Meter = ({ label, showCategory = false, ...props }: MeterProps) => {
3535
{({ percentage }) => (
3636
<>
3737
<div className={labelContainer()}>
38-
<AriaLabel className={mainLabel()}>{label}</AriaLabel>
38+
<AriaLabel className={mainLabel()}>
39+
{t([
40+
"neighborhoodDetail.schoolsSafetyCard." +
41+
labelKey,
42+
])}
43+
</AriaLabel>
3944
{showCategory && (
4045
<AriaLabel className={valueLabel()}>
4146
{t([

0 commit comments

Comments
 (0)