Skip to content

Commit f0cb32c

Browse files
committed
feat(i18n): new translation keys
1 parent 1775425 commit f0cb32c

File tree

7 files changed

+99
-30
lines changed

7 files changed

+99
-30
lines changed

public/locales/en/remnawave.json

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,12 @@
931931
"additional-response-headers": "Additional response headers",
932932
"headers-that-will-be-sent-with-subscription-content": "Headers that will be sent with the subscription content.",
933933
"randomize-hosts": "Randomize hosts",
934-
"randomize-hosts-description": "Randomize hosts in subscription content"
934+
"randomize-hosts-description": "Randomize hosts in subscription content",
935+
"additional-options": "Additional Options",
936+
"configure-additional-subscription-options": "Configure additional subscription options",
937+
"error": "Error",
938+
"save-settings": "Save Settings",
939+
"save-your-subscription-settings-to-apply-changes": "Save your subscription settings to apply changes"
935940
}
936941
},
937942
"nodes-realtime-metrics": {
@@ -1298,7 +1303,8 @@
12981303
"no-config-profiles-available": "No config profiles available",
12991304
"all": "All",
13001305
"selected": "Selected",
1301-
"unselected": "Unselected"
1306+
"unselected": "Unselected",
1307+
"edit-internal-squad": "Edit Internal Squad"
13021308
}
13031309
}
13041310
},
@@ -1385,5 +1391,30 @@
13851391
"or": "or",
13861392
"rotate-device": "Rotate device",
13871393
"i-understand-continue-anyway": "I understand, continue anyway"
1394+
},
1395+
"internal-squad-header-action-buttons": {
1396+
"feature": {
1397+
"update": "Update",
1398+
"create-internal-squad": "Create Internal Squad",
1399+
"create-a-new-internal-squad-by-entering-a-name-below": "Create a new internal squad by entering a name below.",
1400+
"it-cant-be-changed-later": "It can't be changed later",
1401+
"squad-name": "Squad Name",
1402+
"enter-squad-name": "Enter squad name",
1403+
"cancel": "Cancel",
1404+
"create": "Create"
1405+
}
1406+
},
1407+
"config-profiles-header-action-buttons": {
1408+
"feature": {
1409+
"update": "Update",
1410+
"create-config-profile": "Create Config Profile",
1411+
"create-a-new-config-profile-by-entering-a-name-below": "Create a new config profile by entering a name below.",
1412+
"you-can-customize-xray-config-after-creation": "You can customize XRay config after creation.",
1413+
"it-cant-be-changed-later": "It can't be changed later",
1414+
"profile-name": "Profile Name",
1415+
"enter-profile-name": "Enter profile name",
1416+
"cancel": "Cancel",
1417+
"create": "Create"
1418+
}
13881419
}
13891420
}

src/features/ui/dashboard/config-profiles/header-action-buttons/header-action-buttons.feature.tsx renamed to src/features/ui/dashboard/config-profiles/header-action-buttons/config-profiles-header-action-buttons.feature.tsx

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CreateConfigProfileCommand } from '@remnawave/backend-contract'
33
import { generatePath, useNavigate } from 'react-router-dom'
44
import { PiArrowsClockwise, PiPlus } from 'react-icons/pi'
55
import { useDisclosure } from '@mantine/hooks'
6+
import { useTranslation } from 'react-i18next'
67
import { useField } from '@mantine/form'
78

89
import { QueryKeys, useCreateConfigProfile, useGetConfigProfiles } from '@shared/api/hooks'
@@ -49,6 +50,7 @@ const generateDefaultConfig = () => {
4950

5051
export const ConfigProfilesHeaderActionButtonsFeature = () => {
5152
const { isFetching } = useGetConfigProfiles()
53+
const { t } = useTranslation()
5254

5355
const [opened, { open, close }] = useDisclosure(false)
5456
const navigate = useNavigate()
@@ -93,31 +95,45 @@ export const ConfigProfilesHeaderActionButtonsFeature = () => {
9395
size="xs"
9496
variant="default"
9597
>
96-
Update
98+
{t('config-profiles-header-action-buttons.feature.update')}
9799
</Button>
98100

99101
<Button leftSection={<PiPlus size="16px" />} onClick={open} size="xs" variant="default">
100-
Create Config Profile
102+
{t('config-profiles-header-action-buttons.feature.create-config-profile')}
101103
</Button>
102104

103-
<Modal centered onClose={close} opened={opened} size="md" title="Create Config Profile">
105+
<Modal
106+
centered
107+
onClose={close}
108+
opened={opened}
109+
size="md"
110+
title={t('config-profiles-header-action-buttons.feature.create-config-profile')}
111+
>
104112
<Stack gap="md">
105113
<Text size="sm">
106-
Create a new config profile by entering a name below.
107-
<br />
114+
{t(
115+
'config-profiles-header-action-buttons.feature.create-a-new-config-profile-by-entering-a-name-below'
116+
)}
108117
<br />
109-
You can customize XRay config after creation.
118+
119+
{t(
120+
'config-profiles-header-action-buttons.feature.you-can-customize-xray-config-after-creation'
121+
)}
110122
</Text>
111123
<TextInput
112-
description="It can't be changed later"
113-
label="Profile Name"
114-
placeholder="Enter profile name"
124+
description={t(
125+
'config-profiles-header-action-buttons.feature.it-cant-be-changed-later'
126+
)}
127+
label={t('config-profiles-header-action-buttons.feature.profile-name')}
128+
placeholder={t(
129+
'config-profiles-header-action-buttons.feature.enter-profile-name'
130+
)}
115131
required
116132
{...nameField.getInputProps()}
117133
/>
118134
<Group justify="flex-end">
119135
<Button onClick={close} variant="default">
120-
Cancel
136+
{t('config-profiles-header-action-buttons.feature.cancel')}
121137
</Button>
122138

123139
<Button
@@ -131,7 +147,7 @@ export const ConfigProfilesHeaderActionButtonsFeature = () => {
131147
})
132148
}}
133149
>
134-
Create
150+
{t('config-profiles-header-action-buttons.feature.create')}
135151
</Button>
136152
</Group>
137153
</Stack>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './header-action-buttons.feature'
1+
export * from './config-profiles-header-action-buttons.feature'
22
export * from './interfaces'

src/features/ui/dashboard/internal-squads/header-action-buttons/header-action-buttons.feature.tsx

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import { Button, Group, Modal, Stack, Text, TextInput } from '@mantine/core'
22
import { CreateInternalSquadCommand } from '@remnawave/backend-contract'
33
import { PiArrowsClockwise, PiPlus } from 'react-icons/pi'
44
import { useDisclosure } from '@mantine/hooks'
5+
import { useTranslation } from 'react-i18next'
56
import { useField } from '@mantine/form'
67

78
import { QueryKeys, useCreateInternalSquad, useGetInternalSquads } from '@shared/api/hooks'
89
import { MODALS, useModalsStore } from '@entities/dashboard/modal-store'
910
import { queryClient } from '@shared/api'
1011

1112
export const InternalSquadsHeaderActionButtonsFeature = () => {
13+
const { t } = useTranslation()
1214
const { isFetching } = useGetInternalSquads()
1315

1416
const { open: openModal, setInternalData } = useModalsStore()
@@ -59,14 +61,20 @@ export const InternalSquadsHeaderActionButtonsFeature = () => {
5961
size="xs"
6062
variant="default"
6163
>
62-
Update
64+
{t('internal-squad-header-action-buttons.feature.update')}
6365
</Button>
6466

6567
<Button leftSection={<PiPlus size="16px" />} onClick={open} size="xs" variant="default">
66-
Create Internal Squad
68+
{t('internal-squad-header-action-buttons.feature.create-internal-squad')}
6769
</Button>
6870

69-
<Modal centered onClose={close} opened={opened} size="md" title="Create Internal Squad">
71+
<Modal
72+
centered
73+
onClose={close}
74+
opened={opened}
75+
size="md"
76+
title={t('internal-squad-header-action-buttons.feature.create-internal-squad')}
77+
>
7078
<form
7179
onSubmit={(e) => {
7280
e.preventDefault()
@@ -79,25 +87,33 @@ export const InternalSquadsHeaderActionButtonsFeature = () => {
7987
}}
8088
>
8189
<Stack gap="md">
82-
<Text size="sm">Create a new internal squad by entering a name below.</Text>
90+
<Text size="sm">
91+
{t(
92+
'internal-squad-header-action-buttons.feature.create-a-new-internal-squad-by-entering-a-name-below'
93+
)}
94+
</Text>
8395
<TextInput
84-
description="It can't be changed later"
85-
label="Squad Name"
86-
placeholder="Enter squad name"
96+
description={t(
97+
'internal-squad-header-action-buttons.feature.it-cant-be-changed-later'
98+
)}
99+
label={t('internal-squad-header-action-buttons.feature.squad-name')}
100+
placeholder={t(
101+
'internal-squad-header-action-buttons.feature.enter-squad-name'
102+
)}
87103
required
88104
{...nameField.getInputProps()}
89105
/>
90106
<Group justify="flex-end">
91107
<Button onClick={close} variant="default">
92-
Cancel
108+
{t('internal-squad-header-action-buttons.feature.cancel')}
93109
</Button>
94110

95111
<Button
96112
disabled={!!nameField.error || nameField.getValue().length === 0}
97113
loading={isPending}
98114
type="submit"
99115
>
100-
Create
116+
{t('internal-squad-header-action-buttons.feature.create')}
101117
</Button>
102118
</Group>
103119
</Stack>

src/widgets/dashboard/subscription-settings/settings/subscription-tabs.widget.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,14 @@ export const SubscriptionTabs = ({
206206
</ThemeIcon>
207207
<Stack gap={4}>
208208
<Title fw={600} mb={2} order={4}>
209-
Additional Options
209+
{t(
210+
'subscription-tabs.widget.additional-options'
211+
)}
210212
</Title>
211213
<Text c="dimmed" lh={1.5} size="sm">
212-
Configure additional subscription options
214+
{t(
215+
'subscription-tabs.widget.configure-additional-subscription-options'
216+
)}
213217
</Text>
214218
</Stack>
215219
</Group>
@@ -531,7 +535,7 @@ export const SubscriptionTabs = ({
531535
color="red"
532536
icon={<PiInfo />}
533537
radius="md"
534-
title="Error"
538+
title={t('subscription-tabs.widget.error')}
535539
>
536540
{form.errors.customResponseHeaders}
537541
</Alert>
@@ -553,10 +557,12 @@ export const SubscriptionTabs = ({
553557
<Group align="center" justify="space-between">
554558
<Box>
555559
<Title fw={600} order={4}>
556-
Save Settings
560+
{t('subscription-tabs.widget.save-settings')}
557561
</Title>
558562
<Text c="dimmed" size="sm">
559-
Save your subscription settings to apply changes
563+
{t(
564+
'subscription-tabs.widget.save-your-subscription-settings-to-apply-changes'
565+
)}
560566
</Text>
561567
</Box>
562568
<Button

src/widgets/dashboard/users/internal-squads-drawer-with-store/internal-squads-with-store.drawer.widget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ export const InternalSquadsDrawerWithStore = () => {
423423
padding="md"
424424
position="right"
425425
size="480px"
426-
title={`Edit Internal Squad`}
426+
title={t('internal-squads.drawer.widget.edit-internal-squad')}
427427
>
428428
{isLoading ? (
429429
<LoaderModalShared h="80vh" text="Loading..." w="100%" />

src/widgets/dashboard/users/internal-squads-drawer/internal-squads.drawer.widget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export const InternalSquadsDrawer = (props: IProps) => {
204204
padding="md"
205205
position="right"
206206
size="480px"
207-
title={`Edit Internal Squad`}
207+
title={t('internal-squads.drawer.widget.edit-internal-squad')}
208208
>
209209
<Stack gap="md" h="100%">
210210
<Paper mb="sm" p="md" radius={'md'} shadow="sm" withBorder>

0 commit comments

Comments
 (0)