diff --git a/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx b/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx index 3c8d51bb9..799227001 100644 --- a/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx +++ b/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx @@ -18,6 +18,7 @@ import { Input } from "@/components/ui/input"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; +import { useTranslation } from "next-i18next"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; @@ -51,6 +52,7 @@ const randomImages = [ export const ProfileForm = () => { const { data, refetch } = api.auth.get.useQuery(); const { mutateAsync, isLoading } = api.auth.update.useMutation(); + const { t } = useTranslation("common"); const form = useForm({ defaultValues: { @@ -91,7 +93,9 @@ export const ProfileForm = () => {
- Account + + {t("dashboard.settings.profile.title")} + Change the details of your profile here. diff --git a/apps/dokploy/next-i18next.config.js b/apps/dokploy/next-i18next.config.js new file mode 100644 index 000000000..7e365819d --- /dev/null +++ b/apps/dokploy/next-i18next.config.js @@ -0,0 +1,9 @@ +/** @type {import('next-i18next').UserConfig} */ +module.exports = { + i18n: { + defaultLocale: "en", + locales: ["en", "zh-Hans"], + localeDetection: false, + }, + fallbackLng: "en", +}; diff --git a/apps/dokploy/package.json b/apps/dokploy/package.json index e62bb1dd8..9a281b796 100644 --- a/apps/dokploy/package.json +++ b/apps/dokploy/package.json @@ -84,6 +84,7 @@ "dotenv": "16.4.5", "drizzle-orm": "^0.30.8", "drizzle-zod": "0.5.1", + "i18next": "^23.16.4", "input-otp": "^1.2.4", "js-yaml": "4.1.0", "lodash": "4.17.21", @@ -91,6 +92,7 @@ "lucide-react": "^0.312.0", "nanoid": "3", "next": "^15.0.1", + "next-i18next": "^15.3.1", "next-themes": "^0.2.1", "node-pty": "1.0.0", "node-schedule": "2.1.1", @@ -100,6 +102,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.49.3", + "react-i18next": "^15.1.0", "recharts": "^2.12.7", "slugify": "^1.6.6", "sonner": "^1.4.0", diff --git a/apps/dokploy/pages/_app.tsx b/apps/dokploy/pages/_app.tsx index 41b4d50bf..c8e00aca5 100644 --- a/apps/dokploy/pages/_app.tsx +++ b/apps/dokploy/pages/_app.tsx @@ -3,6 +3,7 @@ import "@/styles/globals.css"; import { Toaster } from "@/components/ui/sonner"; import { api } from "@/utils/api"; import type { NextPage } from "next"; +import { appWithTranslation } from "next-i18next"; import { ThemeProvider } from "next-themes"; import type { AppProps } from "next/app"; import { Inter } from "next/font/google"; @@ -27,6 +28,7 @@ const MyApp = ({ pageProps: { ...pageProps }, }: AppPropsWithLayout) => { const getLayout = Component.getLayout ?? ((page) => page); + return ( <>