@@ -19,10 +19,11 @@ import {
19
19
onChangeTrimmed ,
20
20
} from "util/formUtils"
21
21
import * as Yup from "yup"
22
+ import i18next from "i18next"
23
+ import { useTranslation } from "react-i18next"
22
24
23
25
export const Language = {
24
26
nameLabel : "Name" ,
25
- displayNameLabel : "Display name" ,
26
27
descriptionLabel : "Description" ,
27
28
defaultTtlLabel : "Auto-stop default" ,
28
29
iconLabel : "Icon" ,
@@ -42,7 +43,11 @@ const MS_HOUR_CONVERSION = 3600000
42
43
43
44
export const validationSchema = Yup . object ( {
44
45
name : nameValidator ( Language . nameLabel ) ,
45
- display_name : templateDisplayNameValidator ( Language . displayNameLabel ) ,
46
+ display_name : templateDisplayNameValidator (
47
+ i18next . t ( "displayNameLabel" , {
48
+ ns : "templatePage" ,
49
+ } ) ,
50
+ ) ,
46
51
description : Yup . string ( ) . max (
47
52
MAX_DESCRIPTION_CHAR_LIMIT ,
48
53
Language . descriptionMaxError ,
@@ -99,6 +104,8 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
99
104
const hasIcon = form . values . icon && form . values . icon !== ""
100
105
const emojiButtonRef = useRef < HTMLButtonElement > ( null )
101
106
107
+ const { t } = useTranslation ( "templatePage" )
108
+
102
109
return (
103
110
< form onSubmit = { form . handleSubmit } aria-label = { Language . formAriaLabel } >
104
111
< Stack >
@@ -116,7 +123,7 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
116
123
{ ...getFieldHelpers ( "display_name" ) }
117
124
disabled = { isSubmitting }
118
125
fullWidth
119
- label = { Language . displayNameLabel }
126
+ label = { t ( " displayNameLabel" ) }
120
127
variant = "outlined"
121
128
/>
122
129
0 commit comments