Skip to content

Commit c922c4d

Browse files
authored
Merge pull request #1889 from jicruz96/partners-translation
extract translate-able text -- Partners page
2 parents 3674643 + 63c9c92 commit c922c4d

File tree

5 files changed

+73
-205
lines changed

5 files changed

+73
-205
lines changed

components/OurPartnersCardContent/OurPartnersCardContent.tsx

Lines changed: 0 additions & 118 deletions
This file was deleted.

components/OurTeam/Partners.tsx

Lines changed: 54 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,63 @@
1-
import { useTranslation } from "next-i18next"
2-
import styled from "styled-components"
1+
import { useTranslation, Trans } from "next-i18next"
32
import AboutPagesCard from "../AboutPagesCard/AboutPagesCard"
43
import { Col, Container, Row } from "../bootstrap"
5-
import {
6-
CodeForBostonCardContent,
7-
NuLawLabCardContent,
8-
OpenCollectiveContent
9-
} from "../OurPartnersCardContent/OurPartnersCardContent"
104
import { PageTitle, PageDescr } from "../shared/CommonComponents"
5+
import Image from "react-bootstrap/Image"
116

12-
export const OurPartners = () => {
13-
const { t } = useTranslation("common")
7+
const LocalizedContent = (props: {
8+
i18nKey: string
9+
linkClassName?: string
10+
}) => (
11+
<Trans
12+
i18nKey={props.i18nKey}
13+
ns="partners"
14+
components={{
15+
a: (
16+
<a
17+
href="value-overridden-by-partners-json"
18+
target="_blank"
19+
rel="noreferrer"
20+
className={props.linkClassName}
21+
/>
22+
)
23+
}}
24+
/>
25+
)
1426

27+
const PartnerContentCard = ({ src, org }: { src: string; org: string }) => {
28+
const { t } = useTranslation("partners")
29+
const orgTitle = t(`${org}.title`)
1530
return (
16-
<Container>
17-
<Row>
18-
<Col>
19-
<PageTitle>{t("partners.header")}</PageTitle>
20-
</Col>
21-
</Row>
22-
<Row>
23-
<Col className="py-3">
24-
<PageDescr>
25-
{t("partners.desc1")}
26-
<StyleLink
27-
href="https://www.nulawlab.org"
28-
target="_blank"
29-
rel="noopener noreferrer"
30-
>
31-
{" "}
32-
{t("partners.desc2")}
33-
</StyleLink>{" "}
34-
{t("partners.desc3")}
35-
<StyleLink
36-
href="https://www.bc.edu/bc-web/schools/law.html"
37-
target="_blank"
38-
rel="noopener noreferrer"
39-
>
40-
{" "}
41-
{t("partners.desc4")}
42-
</StyleLink>{" "}
43-
{t("partners.desc5")}{" "}
44-
<StyleLink
45-
href="https://cyber.harvard.edu/"
46-
target="_blank"
47-
rel="noopener noreferrer"
48-
>
49-
{t("partners.desc6")}
50-
</StyleLink>
51-
.
52-
</PageDescr>
53-
</Col>
54-
</Row>
55-
<Row>
56-
<Col>
57-
<AboutPagesCard title="NuLawLab">
58-
<NuLawLabCardContent />
59-
</AboutPagesCard>
60-
</Col>
61-
</Row>
62-
<Row>
63-
<Col>
64-
<AboutPagesCard title="Code for Boston">
65-
<CodeForBostonCardContent />
66-
</AboutPagesCard>
67-
</Col>
68-
</Row>
69-
<Row>
70-
<Col>
71-
<AboutPagesCard title="Partners in Democracy">
72-
<Row>
73-
<OpenCollectiveContent />
74-
</Row>
75-
</AboutPagesCard>
76-
</Col>
77-
</Row>
78-
</Container>
31+
<Row>
32+
<Col>
33+
<AboutPagesCard title={orgTitle}>
34+
<Row className="mb-3">
35+
<Col className="text-center align-self-center" md={3}>
36+
<Image fluid src={src} alt={t("logo", { org: orgTitle })} />
37+
</Col>
38+
<Col className="align-self-center" md={9}>
39+
<p className="lh-sm tracking-wide fs-5 pt-4 pt-md-0">
40+
<LocalizedContent i18nKey={`${org}.content`} />
41+
</p>
42+
</Col>
43+
</Row>
44+
</AboutPagesCard>
45+
</Col>
46+
</Row>
7947
)
8048
}
8149

82-
const StyleLink = styled.a`
83-
text-decoration: none;
84-
color: var(--bs-blue);
85-
`
50+
export const OurPartners = () => (
51+
<Container>
52+
<PageTitle>{useTranslation("partners").t("title")}</PageTitle>
53+
<PageDescr className="py-3">
54+
<LocalizedContent i18nKey="desc" linkClassName="text-decoration-none" />
55+
</PageDescr>
56+
<PartnerContentCard
57+
src="/northeastern_school_of_law_logo.svg"
58+
org="nulawlab"
59+
/>
60+
<PartnerContentCard src="/codeforbostonicon.png" org="codeforboston" />
61+
<PartnerContentCard src="/pid.png" org="pid" />
62+
</Container>
63+
)

pages/about/our-team.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ export const getStaticProps = createGetStaticTranslationProps([
1717
"auth",
1818
"common",
1919
"footer",
20-
"our-team"
20+
"our-team",
21+
"partners"
2122
])

public/locales/en/common.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,6 @@
9999
"noResults": "No Results",
100100
"noNewsUpdates": "There are no news updates for your current followed topics",
101101
"orgs": "Organizations",
102-
"partners": {
103-
"header": "Our Partners",
104-
"desc1": "The project is developed in partnership between the",
105-
"desc2": "NuLawLab",
106-
"desc3": "and scholars at",
107-
"desc4": "Boston College Law School",
108-
"desc5": "and",
109-
"desc6": "Harvard University's Berkman Klein Center for Internet & Society",
110-
"pid": "MAPLE is an initiative of Partners in Democracy - Education, a 501(c)(3) non profit organization. Partners In Democracy is building nationwide partnerships and exploring how we can drive democracy renovation efforts forward in states around the country — starting by focusing our efforts here at home in Massachusetts."
111-
},
112102
"pending_upgrade_warning": {
113103
"header": "Organization Request In Progress",
114104
"content": "Your request to be upgraded to an organization is currently in progress. You will be notified by email when your request has been reviewed."

public/locales/en/partners.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"title": "Our Partners",
3+
"logo": "{{org}} logo",
4+
"desc": "The project is developed in partnership between the <a href=\"https://www.nulawlab.org/\">NuLawLab</a> and scholars at <a href=\"https://www.bc.edu/bc-web/schools/law.html\">Boston College Law School</a> and <a href=\"https://cyber.harvard.edu/\">Harvard University's Berkman Klein Center for Internet & Society</a>.",
5+
"nulawlab": {
6+
"title": "NuLawLab",
7+
"content": "The <a href=\"https://www.nulawlab.org/\">NuLawLab</a> is the interdisciplinary innovation laboratory at <a href=\"https://law.northeastern.edu/\">Northeastern University School of Law</a>.<br/><br/>The Lab is a leader in the <a href=\"https://dl.designresearchsociety.org/drs-conference-papers/drs2022/editorials/32/\">global legal design movement</a> and incubates projects that advance the democratization of law."
8+
},
9+
"codeforboston": {
10+
"title": "Code for Boston",
11+
"content": "Code for Boston addresses local social and civic challenges through creative uses of technology. Despite the name, they are not solely focused on coding!<br/><br/>They foster relationships between government, nonprofit, academic, for-profit companies, residents, civic technologists, analysts, designers, and many more. <a href=\"https://github.com/codeforboston/maple/graphs/contributors\">Code for Boston's volunteer contributors</a> have led the technical implementation and development of this website and platform as an open source project (<a href=\"https://github.com/codeforboston/maple\">see our repository on GitHub</a>)."
12+
},
13+
"pid": {
14+
"title": "Partners in Democracy",
15+
"content": "MAPLE is an initiative of Partners in Democracy - Education, a 501(c)(3) non profit organization. Partners In Democracy is building nationwide partnerships and exploring how we can drive democracy renovation efforts forward in states around the country — starting by focusing our efforts here at home in Massachusetts."
16+
}
17+
}

0 commit comments

Comments
 (0)