Skip to content

Commit f55e3c1

Browse files
committed
hotfix: translations build errors
1 parent 13db224 commit f55e3c1

File tree

15 files changed

+92
-29
lines changed

15 files changed

+92
-29
lines changed

api/api/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"version": "v1",
55
"status": "active",
6-
"release_date": "2025-10-15T21:35:07.482629937+05:30",
6+
"release_date": "2025-10-21T22:39:41.363939+05:30",
77
"end_of_life": "0001-01-01T00:00:00Z",
88
"changes": [
99
"Initial API version"

api/doc/openapi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

view/app/containers/hooks/use-container-details.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,21 @@ function useContainerDetails() {
5656
await stopContainer(containerId).unwrap();
5757
toast.success(t(`containers.${action}_success`));
5858
break;
59+
case 'restart':
60+
await stopContainer(containerId).unwrap();
61+
await startContainer(containerId).unwrap();
62+
toast.success(t('containers.restart_success'));
63+
break;
5964
case 'remove':
6065
setIsDeleteDialogOpen(true);
6166
break;
6267
}
6368
} catch (error) {
64-
toast.error(t(`containers.${action}_error`));
69+
if (action === 'restart') {
70+
toast.error(t('containers.restart_error'));
71+
} else {
72+
toast.error(t(`containers.${action}_error`));
73+
}
6574
}
6675
};
6776

view/app/file-manager/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Actions from './components/actions/Actions';
1111
import { FileItem } from './components/file-list/FileItem';
1212
import useFileManager from './hooks/ui/useFileManager';
1313
import { useTranslation } from '@/hooks/use-translation';
14+
import type { translationKey } from '@/hooks/use-translation';
1415
import { DeleteDialog } from '@/components/ui/delete-dialog';
1516
import { FileData } from '@/redux/types/files';
1617
import { FileContextMenu } from './components/context-menu/FileContextMenu';
@@ -166,7 +167,7 @@ interface FileListProps {
166167
handleDelete: (path: string) => void;
167168
handleCopy: (fromPath: string, toPath: string) => void;
168169
startRenaming: (file: FileData) => void;
169-
t: (key: string, params?: any) => string;
170+
t: (key: translationKey, params?: Record<string, string>) => string;
170171
}
171172

172173
const FileList = ({
@@ -239,7 +240,7 @@ interface FileDeleteDialogProps {
239240
fileToDelete: FileData | null;
240241
setFileToDelete: (file: FileData | null) => void;
241242
handleDelete: (path: string) => void;
242-
t: (key: string, params?: any) => string;
243+
t: (key: translationKey, params?: Record<string, string>) => string;
243244
}
244245

245246
const FileDeleteDialog = ({

view/app/register/hooks/use-register.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useTranslation } from '@/hooks/use-translation';
3+
import { useTranslation, type translationKey } from '@/hooks/use-translation';
44
import { useRouter } from 'next/navigation';
55
import { signUp } from 'supertokens-auth-react/recipe/emailpassword';
66
import { toast } from 'sonner';
@@ -10,7 +10,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
1010
import * as z from 'zod';
1111
import { useIsAdminRegisteredQuery } from '@/redux/services/users/authApi';
1212

13-
const registerSchema = (t: (key: string) => string) =>
13+
const registerSchema = (t: (key: translationKey, params?: Record<string, string>) => string) =>
1414
z
1515
.object({
1616
email: z.string().email(t('auth.register.errors.invalidEmail')),

view/app/self-host/hooks/use_update_deployment.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ function useUpdateDeployment({
4747
const deploymentFormSchema = z.object({
4848
name: z
4949
.string()
50-
.min(3, { message: t('selfHost.deployForm.fields.applicationName.minLength') })
50+
.min(3, { message: t('selfHost.deployForm.validation.applicationName.minLength') })
5151
.regex(/^[a-zA-Z0-9_-]+$/, {
52-
message: t('selfHost.deployForm.fields.applicationName.invalidFormat')
52+
message: t('selfHost.deployForm.validation.applicationName.invalidFormat')
5353
})
5454
.optional(),
5555
pre_run_command: z.string().optional(),
@@ -138,7 +138,7 @@ function useUpdateDeployment({
138138
if (!input.trim())
139139
return {
140140
isValid: false,
141-
error: t('selfHost.deployForm.fields.environmentVariables.emptyInput')
141+
error: t('selfHost.deployForm.validation.envVariables.emptyInput')
142142
};
143143

144144
const regex = /^([^=]+)=(.*)$/;
@@ -147,7 +147,7 @@ function useUpdateDeployment({
147147
if (!isValid) {
148148
return {
149149
isValid: false,
150-
error: t('selfHost.deployForm.fields.environmentVariables.invalidFormat')
150+
error: t('selfHost.deployForm.validation.envVariables.invalidFormat')
151151
};
152152
}
153153

@@ -156,7 +156,7 @@ function useUpdateDeployment({
156156
if (!key.trim()) {
157157
return {
158158
isValid: false,
159-
error: t('selfHost.deployForm.fields.environmentVariables.emptyKey')
159+
error: t('selfHost.deployForm.validation.envVariables.emptyKey')
160160
};
161161
}
162162

view/app/settings/general/components/FeatureFlagsSettings.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function FeatureFlagsSettings() {
6666

6767
return featureFlags.filter((feature) => {
6868
const matchesSearch = feature.feature_name.toLowerCase().includes(searchTerm.toLowerCase()) ||
69-
t(`settings.featureFlags.features.${feature.feature_name}.title`).toLowerCase().includes(searchTerm.toLowerCase());
69+
t(`settings.featureFlags.features.${feature.feature_name}.title` as any).toLowerCase().includes(searchTerm.toLowerCase());
7070

7171
const matchesFilter = filterEnabled === 'all' ||
7272
(filterEnabled === 'enabled' && feature.is_enabled) ||
@@ -205,7 +205,7 @@ export default function FeatureFlagsSettings() {
205205
<div className="flex items-center gap-2">
206206
<GroupIcon className="h-4 w-4 text-muted-foreground" />
207207
<TypographySmall className="font-semibold">
208-
{t(`settings.featureFlags.groups.${group}.title`)}
208+
{t(`settings.featureFlags.groups.${group}.title` as any)}
209209
</TypographySmall>
210210
<Badge variant="outline" className="text-xs">
211211
{enabledInGroup}/{features.length}
@@ -221,11 +221,11 @@ export default function FeatureFlagsSettings() {
221221
<div className="space-y-1 flex-1">
222222
<div className="flex items-center gap-2">
223223
<TypographySmall className="font-medium">
224-
{t(`settings.featureFlags.features.${feature.feature_name}.title`)}
224+
{t(`settings.featureFlags.features.${feature.feature_name}.title` as any)}
225225
</TypographySmall>
226226
</div>
227227
<TypographyMuted className="text-sm">
228-
{t(`settings.featureFlags.features.${feature.feature_name}.description`)}
228+
{t(`settings.featureFlags.features.${feature.feature_name}.description` as any)}
229229
</TypographyMuted>
230230
</div>
231231
<RBACGuard resource="feature-flags" action="update">

view/app/settings/hooks/use-notification-settings.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ function useNotificationSettings() {
5454
const handleCreateSMTPConfiguration = async (data: CreateSMTPConfigRequest) => {
5555
try {
5656
await createSMTPConfiguration(data);
57-
toast.success(t('settings.notifications.messages.emailConfigSaved'));
57+
toast.success(t('settings.notifications.messages.email.success'));
5858
} catch (error) {
59-
toast.error(t('settings.notifications.messages.emailConfigFailed'));
59+
toast.error(t('settings.notifications.messages.email.error'));
6060
}
6161
};
6262

6363
const handleUpdateSMTPConfiguration = async (data: UpdateSMTPConfigRequest) => {
6464
try {
6565
await updateSMTPConfiguration(data);
66-
toast.success(t('settings.notifications.messages.emailConfigSaved'));
66+
toast.success(t('settings.notifications.messages.email.success'));
6767
} catch (error) {
68-
toast.error(t('settings.notifications.messages.emailConfigFailed'));
68+
toast.error(t('settings.notifications.messages.email.error'));
6969
}
7070
};
7171

@@ -125,7 +125,7 @@ function useNotificationSettings() {
125125
});
126126
}
127127
} catch (error) {
128-
toast.error(t('settings.notifications.messages.emailConfigFailed'));
128+
toast.error(t('settings.notifications.messages.email.error'));
129129
}
130130
};
131131

view/components/layout/app-sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ export function AppSidebar({
135135
})
136136
.map((item) => ({
137137
...item,
138-
title: t(item.title),
138+
title: t(item.title as any),
139139
items: item.items?.map((subItem) => ({
140140
...subItem,
141-
title: t(subItem.title)
141+
title: t(subItem.title as any)
142142
}))
143143
})),
144144
[data.navMain, hasAnyPermission, t]

view/hooks/use-translation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type DeepKeyOf<T> = {
1212

1313
// This will help us to make sure whatever keys that are entered in the t(``) string are correct,
1414
// and enable autocompletion in editors
15-
type translationKey = DeepKeyOf<typeof en>
15+
export type translationKey = DeepKeyOf<typeof en>
1616

1717
export function useTranslation() {
1818
const [translations, setTranslations] = useState<Record<string, any>>({});

0 commit comments

Comments
 (0)