From 5b846c2a06325178e86819ccc7f848d1329311e4 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Tue, 28 Jan 2025 17:03:53 +0530 Subject: [PATCH 1/2] chore: workspace views language support --- packages/i18n/src/locales/en/translations.json | 1 + .../(projects)/workspace-views/header.tsx | 6 ++++-- .../workspace/views/default-view-quick-action.tsx | 6 +++--- web/core/components/workspace/views/quick-action.tsx | 10 ++++++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index 589a3be796a..9fb1c93fd30 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -739,6 +739,7 @@ }, "workspace_issues": { + "add_view": "Add view", "empty_state": { "all-issues": { "title": "No issues in the project", diff --git a/web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx b/web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx index 7deb7cd60c2..34d494af1ba 100644 --- a/web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx +++ b/web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx @@ -6,6 +6,7 @@ import { useParams } from "next/navigation"; import { Layers } from "lucide-react"; // plane constants import { EIssueFilterType, EIssuesStoreType, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; // types import { IIssueDisplayFilterOptions, IIssueDisplayProperties, IIssueFilterOptions } from "@plane/types"; // ui @@ -33,6 +34,7 @@ export const GlobalIssuesHeader = observer(() => { const { workspace: { workspaceMemberIds }, } = useMember(); + const { t } = useTranslation(); const issueFilters = globalViewId ? filters[globalViewId.toString()] : undefined; @@ -103,7 +105,7 @@ export const GlobalIssuesHeader = observer(() => { } />} + link={} />} /> @@ -141,7 +143,7 @@ export const GlobalIssuesHeader = observer(() => { )} diff --git a/web/core/components/workspace/views/default-view-quick-action.tsx b/web/core/components/workspace/views/default-view-quick-action.tsx index 3df11bbdb58..d7dd4bcca68 100644 --- a/web/core/components/workspace/views/default-view-quick-action.tsx +++ b/web/core/components/workspace/views/default-view-quick-action.tsx @@ -42,13 +42,13 @@ export const DefaultWorkspaceViewQuickActions: React.FC = observer((props { key: "open-new-tab", action: handleOpenInNewTab, - title: "Open in new tab", + title: "open_in_new_tab", icon: ExternalLink, }, { key: "copy-link", action: handleCopyText, - title: "Copy link", + title: "copy_link", icon: LinkIcon, }, ]; @@ -114,7 +114,7 @@ export const DefaultWorkspaceViewQuickActions: React.FC = observer((props > {item.icon && }
-
{item.title}
+
{t(item.title || "")}
{item.description && (

= observer((props) => { // store hooks const { data } = useUser(); const { allowPermissions } = useUserPermissions(); + const { t } = useTranslation(); // auth const isOwner = view?.owned_by === data?.id; const isAdmin = allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.WORKSPACE); @@ -54,26 +56,26 @@ export const WorkspaceViewQuickActions: React.FC = observer((props) => { { key: "edit", action: () => setUpdateViewModal(true), - title: "Edit", + title: t("edit"), icon: Pencil, shouldRender: isOwner, }, { key: "open-new-tab", action: handleOpenInNewTab, - title: "Open in new tab", + title: t("open_in_new_tab"), icon: ExternalLink, }, { key: "copy-link", action: handleCopyText, - title: "Copy link", + title: t("copy_link"), icon: LinkIcon, }, { key: "delete", action: () => setDeleteViewModal(true), - title: "Delete", + title: t("delete"), icon: Trash2, shouldRender: isOwner || isAdmin, }, From 011a17c66906d67d0ffbd8cd2474932e271e691e Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Tue, 28 Jan 2025 18:31:16 +0530 Subject: [PATCH 2/2] chore: code refactor --- packages/i18n/src/locales/en/translations.json | 2 +- .../[workspaceSlug]/(projects)/workspace-views/header.tsx | 2 +- .../issues/issue-layouts/empty-states/global-view.tsx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index 9fb1c93fd30..43cfb184eb7 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -738,7 +738,7 @@ } }, - "workspace_issues": { + "workspace_views": { "add_view": "Add view", "empty_state": { "all-issues": { diff --git a/web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx b/web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx index 34d494af1ba..1ac3757044d 100644 --- a/web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx +++ b/web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx @@ -143,7 +143,7 @@ export const GlobalIssuesHeader = observer(() => { )} diff --git a/web/core/components/issues/issue-layouts/empty-states/global-view.tsx b/web/core/components/issues/issue-layouts/empty-states/global-view.tsx index 6eb8543d9e7..03d4c62ed97 100644 --- a/web/core/components/issues/issue-layouts/empty-states/global-view.tsx +++ b/web/core/components/issues/issue-layouts/empty-states/global-view.tsx @@ -58,13 +58,13 @@ export const GlobalViewEmptyState: React.FC = observer(() => { return ( { setTrackElement("All issues empty state"); toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);