Skip to content

Commit e5484d4

Browse files
committed
Use translations
1 parent 51809d7 commit e5484d4

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

site/src/i18n/en/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import usersPage from "./usersPage.json"
1111
import templateVersionPage from "./templateVersionPage.json"
1212
import loginPage from "./loginPage.json"
1313
import workspaceChangeVersionPage from "./workspaceChangeVersionPage.json"
14+
import serviceBannerSettings from "./serviceBannerSettings.json"
1415

1516
export const en = {
1617
common,
@@ -26,4 +27,5 @@ export const en = {
2627
templateVersionPage,
2728
loginPage,
2829
workspaceChangeVersionPage,
30+
serviceBannerSettings,
2931
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"updateLabel": "Update",
3+
"messageHelperText": "Markdown bold, italics, and links are supported.",
4+
"showPreviewLabel": "Show Preview"
5+
}

site/src/pages/DeploySettingsPage/ServiceBannerSettingsPage.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Header } from "components/DeploySettingsLayout/Header"
1111
import { LoadingButton } from "components/LoadingButton/LoadingButton"
1212
import { Stack } from "components/Stack/Stack"
1313
import { FormikContextType, useFormik } from "formik"
14-
import React, { useContext, useState } from "react"
14+
import React, { useContext, useState, useTransition } from "react"
1515
import { Helmet } from "react-helmet-async"
1616
import { pageTitle } from "util/page"
1717
import * as Yup from "yup"
@@ -24,6 +24,7 @@ import { BlockPicker } from "react-color"
2424
import { useTheme } from "@material-ui/core/styles"
2525
import FormHelperText from "@material-ui/core/FormHelperText"
2626
import Button from "@material-ui/core/Button"
27+
import { useTranslation } from "react-i18next"
2728

2829
export interface ServiceBannerFormValues {
2930
message?: string
@@ -92,6 +93,7 @@ const ServiceBannerSettingsPage: React.FC = () => {
9293
)
9394

9495
const theme = useTheme()
96+
const [t] = useTranslation("serviceBannerSettings")
9597

9698
return (
9799
<>
@@ -148,9 +150,7 @@ const ServiceBannerSettingsPage: React.FC = () => {
148150
)
149151
}}
150152
/>
151-
<FormHelperText>
152-
Markdown bold, italics, and links are supported.
153-
</FormHelperText>
153+
<FormHelperText>{t("messageHelperText")}</FormHelperText>
154154
</Stack>
155155

156156
<Stack spacing={0}>
@@ -190,7 +190,7 @@ const ServiceBannerSettingsPage: React.FC = () => {
190190

191191
<Stack direction="row">
192192
<LoadingButton loading={false} type="submit" variant="contained">
193-
{"Update"}
193+
{t("updateLabel")}
194194
</LoadingButton>
195195
</Stack>
196196
</Stack>
@@ -214,7 +214,7 @@ const ServiceBannerSettingsPage: React.FC = () => {
214214
)
215215
}}
216216
>
217-
Show Preview
217+
{t("showPreviewLabel")}
218218
</Button>
219219
</>
220220
)}

0 commit comments

Comments
 (0)