From eff132ecdee0b8bd5a210d49d905ec9bc7a11cff Mon Sep 17 00:00:00 2001 From: Marcin Jedras Date: Fri, 15 May 2020 17:54:20 +0200 Subject: [PATCH 1/3] Add translations for strings --- apps/public-reference/layouts/application.tsx | 4 ++-- .../pages/HousingCounselors.tsx | 4 ++-- apps/public-reference/pages/disclaimer.tsx | 4 ++-- apps/public-reference/pages/listing.tsx | 22 ++++++++++--------- apps/public-reference/pages/listings.tsx | 2 +- apps/public-reference/pages/privacy.tsx | 4 ++-- shared/ui-components/src/locales/general.json | 5 ++++- 7 files changed, 25 insertions(+), 20 deletions(-) diff --git a/apps/public-reference/layouts/application.tsx b/apps/public-reference/layouts/application.tsx index 6a0f43f2a7..92ebaec045 100644 --- a/apps/public-reference/layouts/application.tsx +++ b/apps/public-reference/layouts/application.tsx @@ -7,11 +7,11 @@ import { SiteFooter, FooterNav, FooterSection, - ExygyFooter, + ExygyFooter } from "@bloom-housing/ui-components" import SVG from "react-inlinesvg" -const Layout = (props) => ( +const Layout = props => (
{t("nav.siteTitle")} diff --git a/apps/public-reference/pages/HousingCounselors.tsx b/apps/public-reference/pages/HousingCounselors.tsx index 69bf8ff30a..cd166734b0 100644 --- a/apps/public-reference/pages/HousingCounselors.tsx +++ b/apps/public-reference/pages/HousingCounselors.tsx @@ -32,7 +32,7 @@ export default class extends Component { {t("pageTitle.housingCounselors")} - {this.props.counselors.map((c) => { + {this.props.counselors.map(c => { return (
{ })} {this.props.counselors.length == 0 && (
-

None found.

+

{t("t.noneFound")}

)} diff --git a/apps/public-reference/pages/disclaimer.tsx b/apps/public-reference/pages/disclaimer.tsx index 8d06c221ab..077fab1628 100644 --- a/apps/public-reference/pages/disclaimer.tsx +++ b/apps/public-reference/pages/disclaimer.tsx @@ -1,9 +1,9 @@ import Layout from "../layouts/application" -import { PageHeader, MarkdownSection } from "@bloom-housing/ui-components" +import { PageHeader, MarkdownSection, t } from "@bloom-housing/ui-components" import PageContent from "../page_content/disclaimer.mdx" export default () => { - const pageTitle = <>Endorsement Disclaimers + const pageTitle = <>{t("pageTitle.disclaimer")} return ( diff --git a/apps/public-reference/pages/listing.tsx b/apps/public-reference/pages/listing.tsx index 314d8d9b99..49856c01c8 100644 --- a/apps/public-reference/pages/listing.tsx +++ b/apps/public-reference/pages/listing.tsx @@ -28,7 +28,7 @@ import { getOccupancyDescription, groupNonReservedAndReservedSummaries, occupancyTable, - t, + t } from "@bloom-housing/ui-components" import Layout from "../layouts/application" @@ -43,7 +43,7 @@ export default class extends Component { try { const response = await axios.get(process.env.listingServiceUrl) - listing = response.data.listings.find((l) => l.id == listingId) + listing = response.data.listings.find(l => l.id == listingId) } catch (error) { console.log(error) } @@ -64,11 +64,11 @@ export default class extends Component { unitType: t("t.unitType"), minimumIncome: t("t.minimumIncome"), rent: t("t.rent"), - availability: t("t.availability"), + availability: t("t.availability") } const amiValues = listing.unitsSummarized.amiPercentages - .map((percent) => { + .map(percent => { const percentInt = parseInt(percent, 10) return percentInt }) @@ -87,14 +87,14 @@ export default class extends Component { const occupancyDescription = getOccupancyDescription(listing) const occupancyHeaders = { unitType: t("t.unitType"), - occupancy: t("t.occupancy"), + occupancy: t("t.occupancy") } const occupancyData = occupancyTable(listing) const pageTitle = `${listing.name} - ${t("nav.siteTitle")}` const metaDescription = t("pageDescription.listing", { regionName: t("region.name"), - listingName: listing.name, + listingName: listing.name }) const metaImage = listing.imageUrl @@ -141,7 +141,7 @@ export default class extends Component {

{listing.developer}

- View on Map + {t("t.viewOnMap")}

@@ -153,8 +153,8 @@ export default class extends Component {
{amiValues.length > 1 && - amiValues.map((percent) => { - const byAMI = listing.unitsSummarized.byAMI.find((item) => { + amiValues.map(percent => { + const byAMI = listing.unitsSummarized.byAMI.find(item => { return parseInt(item.percent, 10) == percent }) @@ -165,7 +165,9 @@ export default class extends Component { return ( <> -

{percent}% AMI Unit

+

+ {t("listings.percentAMIUnit", { percent: percent })} +

{ - const pageTitle = <>Privacy Policy + const pageTitle = <>{t("pageTitle.privacy")} return ( diff --git a/shared/ui-components/src/locales/general.json b/shared/ui-components/src/locales/general.json index 1e9b032b93..669bcf7fe7 100644 --- a/shared/ui-components/src/locales/general.json +++ b/shared/ui-components/src/locales/general.json @@ -103,6 +103,7 @@ "occupancyDescriptionSomeSro": "Occupancy for this building varies by unit type. SROs are limited to 1 person per unit, regardless of age. For all other unit types, occupancy limits do not count children under 6.", "people": "people", "person": "person", + "percentAMIUnit": "%{percent}% AMI Unit", "priorityUnits": "Priority Units", "priorityUnitsDescription": "This building has units set aside if any of the following apply to you or someone in your household:", "remainingUnitsAfterPreferenceConsideration": "After all preference holders have been considered, any remaining units will be available to qualified applicants.", @@ -214,6 +215,7 @@ "minimumIncome": "Minimum Income", "neighborhood": "Neighborhood", "none": "None", + "noneFound": "None found.", "occupancy": "Occupancy", "or": "or", "petsPolicy": "Pets Policy", @@ -225,7 +227,8 @@ "sqFeet": "sqft", "unitAmenities": "Unit Amenities", "unitFeatures": "Unit Features", - "unitType": "Unit Type" + "unitType": "Unit Type", + "viewOnMap": "View on Map" }, "welcome": { "allApplicationClosed": "All applications are currently closed, but you can view closed listings.", From 685844be10e717a6912b4cd6ba6b0607d336004d Mon Sep 17 00:00:00 2001 From: Marcin Jedras Date: Tue, 19 May 2020 22:34:13 +0200 Subject: [PATCH 2/3] Fix prettier offences --- apps/public-reference/layouts/application.tsx | 4 ++-- .../public-reference/pages/HousingCounselors.tsx | 2 +- apps/public-reference/pages/listing.tsx | 16 ++++++++-------- apps/public-reference/pages/listings.tsx | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/public-reference/layouts/application.tsx b/apps/public-reference/layouts/application.tsx index 92ebaec045..6a0f43f2a7 100644 --- a/apps/public-reference/layouts/application.tsx +++ b/apps/public-reference/layouts/application.tsx @@ -7,11 +7,11 @@ import { SiteFooter, FooterNav, FooterSection, - ExygyFooter + ExygyFooter, } from "@bloom-housing/ui-components" import SVG from "react-inlinesvg" -const Layout = props => ( +const Layout = (props) => (
{t("nav.siteTitle")} diff --git a/apps/public-reference/pages/HousingCounselors.tsx b/apps/public-reference/pages/HousingCounselors.tsx index cd166734b0..0a95eacce9 100644 --- a/apps/public-reference/pages/HousingCounselors.tsx +++ b/apps/public-reference/pages/HousingCounselors.tsx @@ -32,7 +32,7 @@ export default class extends Component { {t("pageTitle.housingCounselors")} - {this.props.counselors.map(c => { + {this.props.counselors.map((c) => { return (
{ try { const response = await axios.get(process.env.listingServiceUrl) - listing = response.data.listings.find(l => l.id == listingId) + listing = response.data.listings.find((l) => l.id == listingId) } catch (error) { console.log(error) } @@ -64,11 +64,11 @@ export default class extends Component { unitType: t("t.unitType"), minimumIncome: t("t.minimumIncome"), rent: t("t.rent"), - availability: t("t.availability") + availability: t("t.availability"), } const amiValues = listing.unitsSummarized.amiPercentages - .map(percent => { + .map((percent) => { const percentInt = parseInt(percent, 10) return percentInt }) @@ -87,14 +87,14 @@ export default class extends Component { const occupancyDescription = getOccupancyDescription(listing) const occupancyHeaders = { unitType: t("t.unitType"), - occupancy: t("t.occupancy") + occupancy: t("t.occupancy"), } const occupancyData = occupancyTable(listing) const pageTitle = `${listing.name} - ${t("nav.siteTitle")}` const metaDescription = t("pageDescription.listing", { regionName: t("region.name"), - listingName: listing.name + listingName: listing.name, }) const metaImage = listing.imageUrl @@ -153,8 +153,8 @@ export default class extends Component {
{amiValues.length > 1 && - amiValues.map(percent => { - const byAMI = listing.unitsSummarized.byAMI.find(item => { + amiValues.map((percent) => { + const byAMI = listing.unitsSummarized.byAMI.find((item) => { return parseInt(item.percent, 10) == percent }) diff --git a/apps/public-reference/pages/listings.tsx b/apps/public-reference/pages/listings.tsx index 3a917a7a2b..3d5f237b84 100644 --- a/apps/public-reference/pages/listings.tsx +++ b/apps/public-reference/pages/listings.tsx @@ -8,7 +8,7 @@ import { MetaTags, PageHeader, openDateState, - t + t, } from "@bloom-housing/ui-components" import { Listing } from "@bloom-housing/core" import Layout from "../layouts/application" From 0ad5d7fd64cdb8bafb5b7528443d5fa2c91bb295 Mon Sep 17 00:00:00 2001 From: Marcin Jedras Date: Tue, 19 May 2020 22:47:32 +0200 Subject: [PATCH 3/3] Test fix --- shared/ui-components/src/locales/general.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/ui-components/src/locales/general.json b/shared/ui-components/src/locales/general.json index 669bcf7fe7..4d32c78d83 100644 --- a/shared/ui-components/src/locales/general.json +++ b/shared/ui-components/src/locales/general.json @@ -189,7 +189,7 @@ }, "pageTitle": { "additionalResources": "More Housing Opportunities", - "disclaimer": "Disclaimer", + "disclaimer": "Endorsement Disclaimers", "housingCounselors": "Housing Counselors", "getAssistance": "Get Assistance", "rentalListings": "See Rentals",