diff --git a/apps/dokploy/components/dashboard/organization/handle-organization.tsx b/apps/dokploy/components/dashboard/organization/handle-organization.tsx
index 014c37df1..4ccb03cfa 100644
--- a/apps/dokploy/components/dashboard/organization/handle-organization.tsx
+++ b/apps/dokploy/components/dashboard/organization/handle-organization.tsx
@@ -21,6 +21,7 @@ import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, Plus } from "lucide-react";
+import { useTranslation } from "next-i18next";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
@@ -41,6 +42,7 @@ interface Props {
}
export function AddOrganization({ organizationId }: Props) {
+ const { t } = useTranslation("common");
const [open, setOpen] = useState(false);
const utils = api.useUtils();
const { data: organization } = api.organization.one.useQuery(
@@ -81,7 +83,9 @@ export function AddOrganization({ organizationId }: Props) {
.then(() => {
form.reset();
toast.success(
- `Organization ${organizationId ? "updated" : "created"} successfully`,
+ organizationId
+ ? t("common.side.organizations.updateSuccess")
+ : t("common.side.organizations.createSuccess"),
);
utils.organization.all.invalidate();
setOpen(false);
@@ -89,7 +93,9 @@ export function AddOrganization({ organizationId }: Props) {
.catch((error) => {
console.error(error);
toast.error(
- `Failed to ${organizationId ? "update" : "create"} organization`,
+ organizationId
+ ? t("common.side.organizations.updateFailed")
+ : t("common.side.organizations.createFailed"),
);
});
};
@@ -113,7 +119,7 @@ export function AddOrganization({ organizationId }: Props) {
- Add organization
+ {t("common.side.organizations.createOrganization")}
)}
@@ -121,12 +127,14 @@ export function AddOrganization({ organizationId }: Props) {
- {organizationId ? "Update organization" : "Add organization"}
+ {organizationId
+ ? t("common.side.organizations.updateOrganization")
+ : t("common.side.organizations.createOrganization")}
{organizationId
- ? "Update the organization name and logo"
- : "Create a new organization to manage your projects."}
+ ? t("common.side.organizations.updateOrganizationDescription")
+ : t("common.side.organizations.createOrganizationDescription")}
diff --git a/apps/dokploy/components/layouts/side.tsx b/apps/dokploy/components/layouts/side.tsx
index 1d4952b0c..36590f9de 100644
--- a/apps/dokploy/components/layouts/side.tsx
+++ b/apps/dokploy/components/layouts/side.tsx
@@ -603,7 +603,8 @@ function SidebarLogo() {
)}
>
- {activeOrganization?.name ?? "Select Organization"}
+ {activeOrganization?.name ??
+ t("common.side.organizations.select-organization")}
@@ -619,7 +620,7 @@ function SidebarLogo() {
sideOffset={4}
>
- Organizations
+ {t("common.side.organizations")}
{organizations?.map((org) => (
@@ -647,8 +648,12 @@ function SidebarLogo() {
{
await deleteOrganization({
@@ -657,13 +662,17 @@ function SidebarLogo() {
.then(() => {
refetch();
toast.success(
- "Organization deleted successfully",
+ t(
+ "common.side.organizations.organization-deleted",
+ ),
);
})
.catch((error) => {
toast.error(
error?.message ||
- "Error deleting organization",
+ t(
+ "common.side.organizations.error-deleting-organization",
+ ),
);
});
}}
diff --git a/apps/dokploy/public/locales/en/common.json b/apps/dokploy/public/locales/en/common.json
index ab7f27186..11727ba77 100644
--- a/apps/dokploy/public/locales/en/common.json
+++ b/apps/dokploy/public/locales/en/common.json
@@ -33,5 +33,23 @@
"common.side.invitations.error-accepting-invitation": "Error accepting invitation",
"common.side.invitations.invitation-accepted": "Invitation accepted successfully",
"common.side.invitations.expires": "Expires: {{expireDate}}",
- "common.side.invitations.role": "Role: {{role}}"
+ "common.side.invitations.role": "Role: {{role}}",
+
+ "common.side.organizations": "Organizations",
+ "common.side.organizations.select-organization": "Select Organization",
+ "common.side.organizations.delete-organization": "Delete Organization",
+ "common.side.organizations.confirm-delete-organization": "Are you sure you want to delete this organization?",
+ "common.side.organizations.organization-deleted": "Organization deleted successfully",
+ "common.side.organizations.error-deleting-organization": "Error deleting organization",
+ "common.side.organizations.createOrganization": "Create organization",
+ "common.side.organizations.updateOrganization": "Update organization",
+ "common.side.organizations.createOrganizationDescription": "Create a new organization to manage your projects.",
+ "common.side.organizations.updateOrganizationDescription": "Update the organization name and logo",
+ "common.side.organizations.name": "Name",
+ "common.side.organizations.name.placeHolder": "Organization name",
+ "common.side.organizations.logoURL": "Logo URL",
+ "common.side.organizations.createSuccess": "Organization created successfully",
+ "common.side.organizations.updateSuccess": "Organization updated successfully",
+ "common.side.organizations.createFailed": "Failed to create organization",
+ "common.side.organizations.updateFailed": "Failed to update organization"
}
diff --git a/apps/dokploy/public/locales/zh-Hans/common.json b/apps/dokploy/public/locales/zh-Hans/common.json
index 5eb3df651..174fb86d4 100644
--- a/apps/dokploy/public/locales/zh-Hans/common.json
+++ b/apps/dokploy/public/locales/zh-Hans/common.json
@@ -33,5 +33,23 @@
"common.side.invitations.error-accepting-invitation": "接受邀请时出错",
"common.side.invitations.invitation-accepted": "邀请已成功接受",
"common.side.invitations.expires": "有效期:{{expireDate}}",
- "common.side.invitations.role": "角色:{{role}}"
+ "common.side.invitations.role": "角色:{{role}}",
+
+ "common.side.organizations": "组织",
+ "common.side.organizations.select-organization": "选择组织",
+ "common.side.organizations.delete-organization": "删除组织",
+ "common.side.organizations.confirm-delete-organization": "您确定要删除此组织吗?",
+ "common.side.organizations.organization-deleted": "组织已成功删除",
+ "common.side.organizations.error-deleting-organization": "删除组织时出错",
+ "common.side.organizations.createOrganization": "创建组织",
+ "common.side.organizations.updateOrganization": "更新组织",
+ "common.side.organizations.createOrganizationDescription": "创建一个新组织来管理您的项目。",
+ "common.side.organizations.updateOrganizationDescription": "更新组织名称和标志",
+ "common.side.organizations.name": "名称",
+ "common.side.organizations.name.placeHolder": "请输入组织名称",
+ "common.side.organizations.logoURL": "Logo 图片地址",
+ "common.side.organizations.createSuccess": "组织创建成功",
+ "common.side.organizations.updateSuccess": "组织更新成功",
+ "common.side.organizations.createFailed": "创建组织失败",
+ "common.side.organizations.updateFailed": "更新组织失败"
}