Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit a95c173

Browse files
committed
refactor: replace static strings with i18n
1 parent 7f8e96e commit a95c173

File tree

2 files changed

+65
-93
lines changed

2 files changed

+65
-93
lines changed
Lines changed: 38 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,40 @@
11
{
22
"title": "Developer DAO",
3-
"home": "Home",
4-
"projects": "Projects",
5-
"searchId": "Search $t(title) id",
6-
"description": "A $t(community) of builders who believe in collective ownership of the internet.",
7-
"loading": "Loading...",
8-
"error": "Error",
9-
"viewNftOpenSea": "View NFT on OpenSea",
10-
"viewOwnerEtherscan": "View owner on Etherscan",
11-
"developerTraits": "Developer traits",
12-
"failedLoadTraits": "Failed to load traits",
13-
"madeBy": "Made by the $t(title) $t(community): ",
14-
"organization": "organization",
15-
"repository": "Repository",
16-
"community": "community",
17-
"daoGithubOrg": "$t(title) GitHub $t(organization)",
18-
"daoGithubRepo": "$t(title) GitHub $t(repository)",
19-
"owner": "Owner:",
20-
"unclaimed": "Unclaimed",
21-
"enterDeveloperId": "Please enter a $t(title) id",
22-
"hosting": "Hosting by:",
23-
"copyLinkToNFT": "Copy link to NFT",
24-
"linkCopied": "Link copied to clipboard",
25-
"tokenUnavailable": "Token ID may not be available",
26-
"NFTMintSuccess": "Your NFT should now be in your wallet!",
27-
"TokenMintMessage": "Token Minted",
28-
"tokenIDPlaceholder": "Enter Token ID",
29-
"mintTokenText": "Mint your Token",
30-
"connectWalletText": "Connect Wallet",
31-
"ethereumDevNetworkPrompt": "Please Connect to the Ethereum Rinkeby Testnet",
32-
"ethereumNetworkPrompt": "Please Connect to the Ethereum Mainnet",
33-
"availableTokensText": "View the available Token IDs",
34-
"remainingTokensText": "{{remainingTokens}} tokens left / {{uniqueAddressCount}} devs joined",
35-
"mintPageHeader": "DEVS Token Minter",
36-
"projectsList": "A list of community projects created by the Developer DAO community.",
37-
"ddaoTokenSearch": "DDAO Token Search",
38-
"ddaoUnofficalFrontend": "Developer DAO Unofficial Frontend",
39-
"ddaoTokenVisualizer": "Developer DAO Token Visualizer",
40-
"ddaoPixelAvatars": "Developer DAO Pixel Avatars",
41-
"by": "by",
42-
"otherTokensOwnedByThisAddress": "Other Tokens owned by this address",
43-
"noOtherTokens": "No other tokens owned by this address",
44-
"userCancelTransaction": "Transaction Cancelled by User",
45-
"transactionSending": "Transaction Being Sent",
46-
"here": "here",
47-
"errorMinting": "Unable to Mint NFT",
48-
"disconnectWallet": "Disconnect Wallet",
49-
"etherscanMessage": "View your TX on Etherscan",
50-
"testnet": "Testnet",
51-
"glitterConfetti": "A man throwing glitter in a fabulous manner",
52-
"soldOut": "DEV Tokens are now sold out to our {{count}} community members"
53-
}
3+
"currentStatus": "Current Status",
4+
"season": "Season",
5+
"callout": "We're forming guilds, creating culture, strengthening our community, teaching & learning, and building cool shit together.",
6+
"calloutButton": "Read our Snapshot",
7+
"mission": {
8+
"title": "Mission",
9+
"body": "Developer DAO exists to accelerate the education and impact of a new wave of web3 builders."
10+
},
11+
"values": {
12+
"title": "Values",
13+
"transparency": {
14+
"title": "Transparency",
15+
"body": "open source everything, conversations in public, document and share journey"
16+
},
17+
"diversity": {
18+
"title": "Diversity and Inclusion",
19+
"body": "seek to foster as diverse a membership as possible and support everyone to contribute"
20+
},
21+
"responsibility": {
22+
"title": "Responsibility",
23+
"body": "as a self-governed community we rely on members to be personally responsible for their actions and commitments to the community"
24+
},
25+
"kindness": {
26+
"title": "Kindness and Empathy",
27+
"body": "we know that we are living in a complex, stressful, and diverse world and go out of our way to make people’s lives and days better through our interactions"
28+
}
29+
},
30+
"goals": {
31+
"title": "Goals",
32+
"body1": "Onboard, Education, & Support Web3 Developers",
33+
"body2": "Foster & Build Web3 Tools & Public Goods"
34+
},
35+
"membership": {
36+
"title": "How do I join?",
37+
"body": "Membership is temporarily closed but will be open again soon. Follow us on Twitter for updates!"
38+
},
39+
"socialLinkLabel": "Opens the Developer DAO {{platform}} in the current tab"
40+
}

frontend/src/pages/index.tsx

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ import { BsLightningCharge } from 'react-icons/bs';
2222
import { FaDiscord, FaGithub, FaTwitter } from 'react-icons/fa';
2323
import { GiCrownedHeart } from 'react-icons/gi';
2424
import Image from 'next/image';
25+
import { useTranslation } from 'react-i18next';
2526

2627
export default function IndexPage() {
28+
const { t } = useTranslation();
29+
2730
return (
2831
<Container>
2932
<Stack
@@ -39,82 +42,66 @@ export default function IndexPage() {
3942
}
4043
>
4144
<Heading as="h1" fontSize="xl">
42-
Developer DAO
45+
{t('title')}
4346
</Heading>
4447

4548
<Stack spacing={{ base: 10, md: 12 }}>
4649
<CurrentStatus />
4750

4851
<Stack spacing={6}>
4952
<Heading as="h2" fontSize="lg">
50-
Mission
53+
{t('mission.title')}
5154
</Heading>
52-
<Text>
53-
Developer DAO exists to accelerate the education and impact of a
54-
new wave of web3 builders.
55-
</Text>
55+
<Text>{t('mission.body')}</Text>
5656
</Stack>
5757

5858
<Stack spacing={6}>
5959
<Heading as="h2" fontSize="lg">
60-
Values
60+
{t('values.title')}
6161
</Heading>
6262
<UnorderedList spacing={3}>
6363
<ListItem>
6464
<Text as="span" fontWeight="bold">
65-
Transparency
65+
{t('values.transparency.title')}
6666
</Text>
67-
: open source everything, conversations in public, document and
68-
share journey
67+
: {t('values.transparency.body')}
6968
</ListItem>
7069
<ListItem>
7170
<Text as="span" fontWeight="bold">
72-
Diversity and Inclusion
71+
{t('values.diversity.title')}
7372
</Text>
74-
: seek to foster as diverse a membership as possible and support
75-
everyone to contribute
73+
: {t('values.diversity.body')}
7674
</ListItem>
7775
<ListItem>
7876
<Text as="span" fontWeight="bold">
79-
Responsibility
77+
{t('values.responsibility.title')}
8078
</Text>
81-
: as a self-governed community we rely on members to be
82-
personally responsible for their actions and commitments to the
83-
community
79+
: {t('values.responsibility.body')}
8480
</ListItem>
8581
<ListItem>
8682
<Text as="span" fontWeight="bold">
87-
Kindness and Empathy
83+
{t('values.kindness.title')}
8884
</Text>
89-
: we know that we are living in a complex, stressful, and
90-
diverse world and go out of our way to make people’s lives and
91-
days better through our interactions
85+
: {t('values.kindness.body')}
9286
</ListItem>
9387
</UnorderedList>
9488
</Stack>
9589

9690
<Stack spacing={6}>
9791
<Heading as="h2" fontSize="lg">
98-
Goals
92+
{t('goals.title')}
9993
</Heading>
10094
<UnorderedList spacing={3}>
101-
<ListItem>
102-
Onboard, Educate, &amp; Support Web3 Developers
103-
</ListItem>
104-
<ListItem>
105-
Foster &amp; Build Web3 Tools &amp; Public Goods
106-
</ListItem>
95+
<ListItem>{t('goals.body1')}</ListItem>
96+
<ListItem>{t('goals.body2')}</ListItem>
10797
</UnorderedList>
10898
</Stack>
10999

110100
<Stack spacing={6}>
111101
<Heading as="h2" fontSize="lg">
112-
How do I join?
102+
{t('membership.title')}
113103
</Heading>
114-
<Text>
115-
Membership is temporarily closed but will be open again soon.
116-
Follow us on Twitter for updates!
117-
</Text>
104+
<Text>{t('membership.body')}</Text>
118105
</Stack>
119106
</Stack>
120107

@@ -127,15 +114,15 @@ export default function IndexPage() {
127114
<>
128115
<FaTwitter />
129116
<VisuallyHidden>
130-
Opens the Discord DAO Twitter in the current tab
117+
{t('socialLinkLabel', { platform: 'Twitter' })}
131118
</VisuallyHidden>
132119
</>
133120
</SocialIconLink>
134121
<SocialIconLink href="https://discord.gg/devdao" label="Discord">
135122
<>
136123
<FaDiscord />
137124
<VisuallyHidden>
138-
Opens the Discord DAO Discord in the current tab
125+
{t('socialLinkLabel', { platform: 'Discord' })}
139126
</VisuallyHidden>
140127
</>
141128
</SocialIconLink>
@@ -146,7 +133,7 @@ export default function IndexPage() {
146133
<>
147134
<FaGithub />
148135
<VisuallyHidden>
149-
Opens the Discord DAO GitHub organization in the current tab
136+
{t('socialLinkLabel', { platform: 'GitHub' })}
150137
</VisuallyHidden>
151138
</>
152139
</SocialIconLink>
@@ -182,6 +169,7 @@ export const getStaticProps = async ({ locale }: { locale: string }) => ({
182169
const CurrentStatus = () => {
183170
const shouldShowIcon = useBreakpointValue({ base: false, md: true });
184171
const buttonSize = useBreakpointValue({ base: 'md', md: 'lg' });
172+
const { t } = useTranslation();
185173

186174
return (
187175
<Stack
@@ -199,12 +187,9 @@ const CurrentStatus = () => {
199187
<Stack spacing={4}>
200188
<Stack fontSize="xs">
201189
<Text fontSize="sm" fontWeight="bold">
202-
Current Status: Season 0
203-
</Text>
204-
<Text>
205-
We&apos;re forming guilds, creating culture, strengthening our
206-
community, teaching &amp; learning, and building cool shit together.
190+
{t('currentStatus')}: {t('season')} 0
207191
</Text>
192+
<Text>{t('callout')}</Text>
208193
</Stack>
209194
<Box>
210195
<Button
@@ -220,7 +205,7 @@ const CurrentStatus = () => {
220205
_active={{ bg: 'gray.200' }}
221206
leftIcon={<BsLightningCharge />}
222207
>
223-
Read our Snapshot
208+
{t('calloutButton')}
224209
</Button>
225210
</Box>
226211
</Stack>

0 commit comments

Comments
 (0)