Skip to content

Commit 261f144

Browse files
committed
fix(i18n): fix project sub-page not load translations
1 parent ae824d2 commit 261f144

File tree

9 files changed

+29
-5
lines changed

9 files changed

+29
-5
lines changed

apps/dokploy/pages/dashboard/project/[projectId].tsx

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ import {
9292
SelectTrigger,
9393
SelectValue,
9494
} from "@/components/ui/select";
95+
import { getLocale, serverSideTranslations } from "@/utils/i18n";
9596

9697
export type Services = {
9798
appName: string;
@@ -993,6 +994,7 @@ export async function getServerSideProps(
993994
const { params } = ctx;
994995

995996
const { req, res } = ctx;
997+
const locale = getLocale(req.cookies);
996998
const { user, session } = await validateRequest(req);
997999
if (!user) {
9981000
return {
@@ -1025,6 +1027,7 @@ export async function getServerSideProps(
10251027
props: {
10261028
trpcState: helpers.dehydrate(),
10271029
projectId: params?.projectId,
1030+
...(await serverSideTranslations(locale)),
10281031
},
10291032
};
10301033
} catch (_error) {

apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
import { cn } from "@/lib/utils";
3939
import { appRouter } from "@/server/api/root";
4040
import { api } from "@/utils/api";
41+
import { getLocale, serverSideTranslations } from "@/utils/i18n";
4142
import { validateRequest } from "@dokploy/server/lib/auth";
4243
import { createServerSideHelpers } from "@trpc/react-query/server";
4344
import copy from "copy-to-clipboard";
@@ -358,6 +359,7 @@ export async function getServerSideProps(
358359
}>,
359360
) {
360361
const { query, params, req, res } = ctx;
362+
const locale = getLocale(req.cookies);
361363

362364
const activeTab = query.tab;
363365
const { user, session } = await validateRequest(req);
@@ -396,6 +398,7 @@ export async function getServerSideProps(
396398
trpcState: helpers.dehydrate(),
397399
applicationId: params?.applicationId,
398400
activeTab: (activeTab || "general") as TabState,
401+
...(await serverSideTranslations(locale)),
399402
},
400403
};
401404
} catch (_error) {

apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { type ReactElement, useEffect, useState } from "react";
4848
import { toast } from "sonner";
4949
import superjson from "superjson";
5050
import { ShowImport } from "@/components/dashboard/application/advanced/import/show-import";
51+
import { getLocale, serverSideTranslations } from "@/utils/i18n";
5152

5253
type TabState =
5354
| "projects"
@@ -356,6 +357,7 @@ export async function getServerSideProps(
356357
}>,
357358
) {
358359
const { query, params, req, res } = ctx;
360+
const locale = getLocale(req.cookies);
359361

360362
const activeTab = query.tab;
361363
const { user, session } = await validateRequest(req);
@@ -392,6 +394,7 @@ export async function getServerSideProps(
392394
trpcState: helpers.dehydrate(),
393395
composeId: params?.composeId,
394396
activeTab: (activeTab || "general") as TabState,
397+
...(await serverSideTranslations(locale)),
395398
},
396399
};
397400
} catch (_error) {

apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
import { cn } from "@/lib/utils";
3333
import { appRouter } from "@/server/api/root";
3434
import { api } from "@/utils/api";
35+
import { getLocale, serverSideTranslations } from "@/utils/i18n";
3536
import { validateRequest } from "@dokploy/server/lib/auth";
3637
import { createServerSideHelpers } from "@trpc/react-query/server";
3738
import { HelpCircle, ServerOff } from "lucide-react";
@@ -301,6 +302,7 @@ export async function getServerSideProps(
301302
ctx: GetServerSidePropsContext<{ mariadbId: string; activeTab: TabState }>,
302303
) {
303304
const { query, params, req, res } = ctx;
305+
const locale = getLocale(req.cookies);
304306
const activeTab = query.tab;
305307

306308
const { user, session } = await validateRequest(req);
@@ -336,6 +338,7 @@ export async function getServerSideProps(
336338
trpcState: helpers.dehydrate(),
337339
mariadbId: params?.mariadbId,
338340
activeTab: (activeTab || "general") as TabState,
341+
...(await serverSideTranslations(locale)),
339342
},
340343
};
341344
} catch (_error) {

apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
import { cn } from "@/lib/utils";
3333
import { appRouter } from "@/server/api/root";
3434
import { api } from "@/utils/api";
35+
import { getLocale, serverSideTranslations } from "@/utils/i18n";
3536
import { validateRequest } from "@dokploy/server/lib/auth";
3637
import { createServerSideHelpers } from "@trpc/react-query/server";
3738
import { HelpCircle, ServerOff } from "lucide-react";
@@ -299,6 +300,7 @@ export async function getServerSideProps(
299300
ctx: GetServerSidePropsContext<{ mongoId: string; activeTab: TabState }>,
300301
) {
301302
const { query, params, req, res } = ctx;
303+
const locale = getLocale(req.cookies);
302304
const activeTab = query.tab;
303305

304306
const { user, session } = await validateRequest(req);
@@ -334,6 +336,7 @@ export async function getServerSideProps(
334336
trpcState: helpers.dehydrate(),
335337
mongoId: params?.mongoId,
336338
activeTab: (activeTab || "general") as TabState,
339+
...(await serverSideTranslations(locale)),
337340
},
338341
};
339342
} catch (_error) {

apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
import { cn } from "@/lib/utils";
3333
import { appRouter } from "@/server/api/root";
3434
import { api } from "@/utils/api";
35+
import { getLocale, serverSideTranslations } from "@/utils/i18n";
3536
import { validateRequest } from "@dokploy/server/lib/auth";
3637
import { createServerSideHelpers } from "@trpc/react-query/server";
3738
import { HelpCircle, ServerOff } from "lucide-react";
@@ -283,6 +284,7 @@ export async function getServerSideProps(
283284
ctx: GetServerSidePropsContext<{ mysqlId: string; activeTab: TabState }>,
284285
) {
285286
const { query, params, req, res } = ctx;
287+
const locale = getLocale(req.cookies);
286288
const activeTab = query.tab;
287289

288290
const { user, session } = await validateRequest(req);
@@ -318,6 +320,7 @@ export async function getServerSideProps(
318320
trpcState: helpers.dehydrate(),
319321
mysqlId: params?.mysqlId,
320322
activeTab: (activeTab || "general") as TabState,
323+
...(await serverSideTranslations(locale)),
321324
},
322325
};
323326
} catch (_error) {

apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import Link from "next/link";
4444
import { useRouter } from "next/router";
4545
import { type ReactElement, useState } from "react";
4646
import superjson from "superjson";
47+
import { getLocale, serverSideTranslations } from "@/utils/i18n";
4748

4849
type TabState = "projects" | "monitoring" | "settings" | "backups" | "advanced";
4950

@@ -281,6 +282,7 @@ export async function getServerSideProps(
281282
ctx: GetServerSidePropsContext<{ postgresId: string; activeTab: TabState }>,
282283
) {
283284
const { query, params, req, res } = ctx;
285+
const locale = getLocale(req.cookies);
284286
const activeTab = query.tab;
285287
const { user, session } = await validateRequest(req);
286288
if (!user) {
@@ -315,6 +317,7 @@ export async function getServerSideProps(
315317
trpcState: helpers.dehydrate(),
316318
postgresId: params?.postgresId,
317319
activeTab: (activeTab || "general") as TabState,
320+
...(await serverSideTranslations(locale)),
318321
},
319322
};
320323
} catch (_error) {

apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
import { cn } from "@/lib/utils";
3232
import { appRouter } from "@/server/api/root";
3333
import { api } from "@/utils/api";
34+
import { getLocale, serverSideTranslations } from "@/utils/i18n";
3435
import { validateRequest } from "@dokploy/server/lib/auth";
3536
import { createServerSideHelpers } from "@trpc/react-query/server";
3637
import { HelpCircle, ServerOff } from "lucide-react";
@@ -292,6 +293,7 @@ export async function getServerSideProps(
292293
ctx: GetServerSidePropsContext<{ redisId: string; activeTab: TabState }>,
293294
) {
294295
const { query, params, req, res } = ctx;
296+
const locale = getLocale(req.cookies);
295297
const activeTab = query.tab;
296298

297299
const { user, session } = await validateRequest(req);
@@ -326,6 +328,7 @@ export async function getServerSideProps(
326328
trpcState: helpers.dehydrate(),
327329
redisId: params?.redisId,
328330
activeTab: (activeTab || "general") as TabState,
331+
...(await serverSideTranslations(locale)),
329332
},
330333
};
331334
} catch (_error) {

packages/server/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
"@ai-sdk/mistral": "^1.0.6",
3737
"@ai-sdk/openai": "^1.0.12",
3838
"@ai-sdk/openai-compatible": "^0.0.13",
39-
"@better-auth/utils":"0.2.3",
40-
"@oslojs/encoding":"1.1.0",
41-
"@oslojs/crypto":"1.0.1",
42-
"drizzle-dbml-generator":"0.10.0",
43-
"better-auth":"1.2.4",
39+
"@better-auth/utils": "0.2.3",
40+
"@oslojs/encoding": "1.1.0",
41+
"@oslojs/crypto": "1.0.1",
42+
"drizzle-dbml-generator": "0.10.0",
43+
"better-auth": "1.2.4",
4444
"@faker-js/faker": "^8.4.1",
4545
"@lucia-auth/adapter-drizzle": "1.0.7",
4646
"@octokit/auth-app": "^6.0.4",

0 commit comments

Comments
 (0)