Skip to content

Commit 78c685b

Browse files
authored
Update navigation (#992)
* change navigation items * extract strings
1 parent dce1391 commit 78c685b

File tree

2 files changed

+122
-47
lines changed

2 files changed

+122
-47
lines changed

components/Header.tsx

Lines changed: 113 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,69 +21,143 @@ const Header = ({ transparent = true }: HeaderProps) => {
2121
const router = useRouter()
2222
const [pageScrolled, setPageScrolled] = useState(false)
2323

24-
// prettier-ignore
2524
const navigationItems = [
2625
{
27-
value: "/servers",
28-
label: <FormattedMessage id="nav.servers.title" defaultMessage="Servers" />,
29-
}, {
3026
value: "/apps",
3127
label: <FormattedMessage id="nav.apps.title" defaultMessage="Apps" />,
3228
},
3329
{
34-
value: "https://shop.joinmastodon.org/",
35-
label: <FormattedMessage id="nav.merch.title" defaultMessage="Merch" />,
30+
value: "/sponsors",
31+
label: (
32+
<FormattedMessage id="nav.sponsors.title" defaultMessage="Donate" />
33+
),
3634
},
3735
{
38-
value: "/sponsors",
39-
label: <FormattedMessage id="nav.sponsors.title" defaultMessage="Donate" />,
40-
}, {
4136
key: "resources",
42-
label: <FormattedMessage id="nav.resources.title" defaultMessage="Resources" />,
37+
label: (
38+
<FormattedMessage id="nav.resources.title" defaultMessage="Resources" />
39+
),
4340
childItems: [
4441
{
4542
value: "/about",
46-
label: <FormattedMessage id="nav.about_us.title" defaultMessage="About us" />,
47-
description: <FormattedMessage id="nav.about_us.description" defaultMessage="Read about our story, the team, and recent media coverage" />
48-
}, {
49-
value: "/about#contact",
50-
label: <FormattedMessage id="nav.contact.title" defaultMessage="Contact" />,
51-
description: <FormattedMessage id="nav.contact.description" defaultMessage="Get in touch for press, business, legal and other inquiries" />
43+
label: (
44+
<FormattedMessage
45+
id="nav.about_us.title"
46+
defaultMessage="About us"
47+
/>
48+
),
49+
description: (
50+
<FormattedMessage
51+
id="nav.about_us.description"
52+
defaultMessage="Learn about the small team behind Mastodon."
53+
/>
54+
),
55+
},
56+
{
57+
value: "/servers",
58+
label: (
59+
<FormattedMessage id="nav.servers.title" defaultMessage="Servers" />
60+
),
61+
description: (
62+
<FormattedMessage
63+
id="nav.servers.description"
64+
defaultMessage="Browse the directory of other Mastodon servers."
65+
/>
66+
),
5267
},
5368
{
5469
value: "https://blog.joinmastodon.org/",
5570
label: <FormattedMessage id="nav.blog.title" defaultMessage="Blog" />,
56-
description: <FormattedMessage id="nav.blog.description" defaultMessage="Get the latest news about the platform" />,
57-
}, {
71+
description: (
72+
<FormattedMessage
73+
id="nav.blog.description"
74+
defaultMessage="Get the latest news about the platform."
75+
/>
76+
),
77+
},
78+
{
5879
value: "https://docs.joinmastodon.org",
59-
label: <FormattedMessage id="nav.docs.title" defaultMessage="Documentation" />,
60-
description: <FormattedMessage id="nav.docs.description" defaultMessage="Learn how Mastodon works in-depth" />,
61-
}, {
80+
label: (
81+
<FormattedMessage
82+
id="nav.docs.title"
83+
defaultMessage="Documentation"
84+
/>
85+
),
86+
description: (
87+
<FormattedMessage
88+
id="nav.docs.description"
89+
defaultMessage="Learn how Mastodon works in-depth."
90+
/>
91+
),
92+
},
93+
{
6294
value: "https://github.com/mastodon/mastodon/discussions",
63-
label: <FormattedMessage id="nav.support.title" defaultMessage="Support" />,
64-
description: <FormattedMessage id="nav.support.description" defaultMessage="Get help or suggest a feature on GitHub" />,
65-
}, {
95+
label: (
96+
<FormattedMessage id="nav.support.title" defaultMessage="Support" />
97+
),
98+
description: (
99+
<FormattedMessage
100+
id="nav.support.description"
101+
defaultMessage="Get help or suggest a feature on GitHub."
102+
/>
103+
),
104+
},
105+
{
106+
value: "https://shop.joinmastodon.org/",
107+
label: (
108+
<FormattedMessage id="nav.merch.title" defaultMessage="Merch" />
109+
),
110+
description: (
111+
<FormattedMessage
112+
id="nav.merch.description"
113+
defaultMessage="Support your friends building Mastodon (and look cool while doing it)."
114+
/>
115+
),
116+
},
117+
{
66118
value: "/verification",
67-
label: <FormattedMessage id="nav.verification.title" defaultMessage="Verification" />,
68-
description: <FormattedMessage id="nav.verification.description" defaultMessage="Learn about verified profile links on Mastodon" />
69-
}, {
70-
value: "/branding",
71-
label: <FormattedMessage id="nav.branding.title" defaultMessage="Branding" />,
72-
description: <FormattedMessage id="nav.branding.description" defaultMessage="Download our logos and learn how to use them" />,
119+
label: (
120+
<FormattedMessage
121+
id="nav.verification.title"
122+
defaultMessage="Verification"
123+
/>
124+
),
125+
description: (
126+
<FormattedMessage
127+
id="nav.verification.description"
128+
defaultMessage="Learn about verified profile links on Mastodon."
129+
/>
130+
),
73131
},
74132
],
75133
footer: {
76134
value: "https://github.com/mastodon/mastodon",
77-
label: <FormattedMessage id="nav.code.action" defaultMessage="Browse code" />,
78-
title: <FormattedMessage id="nav.code.title" defaultMessage="Source code" />,
79-
description: <FormattedMessage id="nav.code.description" defaultMessage="Mastodon is free and open-source software" />,
135+
label: (
136+
<FormattedMessage id="nav.code.action" defaultMessage="Browse code" />
137+
),
138+
title: (
139+
<FormattedMessage id="nav.code.title" defaultMessage="Source code" />
140+
),
141+
description: (
142+
<FormattedMessage
143+
id="nav.code.description"
144+
defaultMessage="Mastodon is free and open-source software."
145+
/>
146+
),
80147
},
81-
}, {
148+
},
149+
{
82150
key: "locale",
83-
label: <span aria-label={intl.formatMessage({
84-
id: "translate_site",
85-
defaultMessage: "文A, Translate site",
86-
})}>文A</span>,
151+
label: (
152+
<span
153+
aria-label={intl.formatMessage({
154+
id: "translate_site",
155+
defaultMessage: "文A, Translate site",
156+
})}
157+
>
158+
文A
159+
</span>
160+
),
87161
compact: true,
88162
childItems: locales.map((locale) => ({
89163
key: locale.code,
@@ -94,7 +168,7 @@ const Header = ({ transparent = true }: HeaderProps) => {
94168
label: locale.language,
95169
active: router.locale === locale.code,
96170
})),
97-
}
171+
},
98172
]
99173
// set active status on links
100174
.map((item) => ({ ...item, active: router.asPath === item.value }))

locales/en.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"donate_widget.currency.eur": "EUR",
3838
"donate_widget.currency.usd": "USD",
3939
"donate_widget.currency_select": "Select currency",
40+
"donate_widget.footer": "Donations go to Mastodon gGmbH",
4041
"donate_widget.frequency.monthly": "Monthly",
4142
"donate_widget.frequency.once": "Just once",
4243
"donate_widget.frequency.yearly": "Yearly",
@@ -81,35 +82,35 @@
8182
"home.why.opensource.title": "Open Source",
8283
"home.why.title": "Why Mastodon?",
8384
"ios_and_android.download": "Official apps",
84-
"nav.about_us.description": "Read about our story, the team, and recent media coverage",
85+
"nav.about_us.description": "Learn about the small team behind Mastodon.",
8586
"nav.about_us.title": "About us",
8687
"nav.apps.title": "Apps",
87-
"nav.blog.description": "Get the latest news about the platform",
88+
"nav.blog.description": "Get the latest news about the platform.",
8889
"nav.blog.title": "Blog",
89-
"nav.branding.description": "Download our logos and learn how to use them",
9090
"nav.branding.title": "Branding",
9191
"nav.code.action": "Browse code",
92-
"nav.code.description": "Mastodon is free and open-source software",
92+
"nav.code.description": "Mastodon is free and open-source software.",
9393
"nav.code.title": "Source code",
9494
"nav.company.title": "Company",
95-
"nav.contact.description": "Get in touch for press, business, legal and other inquiries",
9695
"nav.contact.title": "Contact",
97-
"nav.docs.description": "Learn how Mastodon works in-depth",
96+
"nav.docs.description": "Learn how Mastodon works in-depth.",
9897
"nav.docs.title": "Documentation",
9998
"nav.impressum.title": "Impressum",
99+
"nav.merch.description": "Support your friends building Mastodon (and look cool while doing it).",
100100
"nav.merch.title": "Merch",
101101
"nav.privacy_policy.title": "Privacy Policy",
102102
"nav.product.title": "Product",
103103
"nav.resources.title": "Resources",
104104
"nav.roadmap.title": "Roadmap",
105+
"nav.servers.description": "Browse the directory of other Mastodon servers.",
105106
"nav.servers.title": "Servers",
106107
"nav.sponsors.title": "Donate",
107108
"nav.status.title": "Status",
108-
"nav.support.description": "Get help or suggest a feature on GitHub",
109+
"nav.support.description": "Get help or suggest a feature on GitHub.",
109110
"nav.support.title": "Support",
110111
"nav.toggle": "Toggle menu",
111112
"nav.trademark_policy.title": "Trademark Policy",
112-
"nav.verification.description": "Learn about verified profile links on Mastodon",
113+
"nav.verification.description": "Learn about verified profile links on Mastodon.",
113114
"nav.verification.title": "Verification",
114115
"roadmap.all": "All",
115116
"roadmap.android": "Android",

0 commit comments

Comments
 (0)