From c5afc3eb338d078d8e01c7a0eb4bf41860946656 Mon Sep 17 00:00:00 2001 From: gakshita Date: Fri, 31 Jan 2025 15:03:01 +0530 Subject: [PATCH 1/4] chore: added core.json --- packages/i18n/src/locales/en/core.json | 176 ++++++++++++++++++ .../i18n/src/locales/en/translations.json | 151 +-------------- .../i18n/src/locales/es/translations.json | 25 +++ .../i18n/src/locales/fr/translations.json | 26 +++ .../i18n/src/locales/ja/translations.json | 26 +++ .../i18n/src/locales/zh-CN/translations.json | 26 +++ 6 files changed, 281 insertions(+), 149 deletions(-) create mode 100644 packages/i18n/src/locales/en/core.json diff --git a/packages/i18n/src/locales/en/core.json b/packages/i18n/src/locales/en/core.json new file mode 100644 index 00000000000..b447337dcef --- /dev/null +++ b/packages/i18n/src/locales/en/core.json @@ -0,0 +1,176 @@ +{ + "sidebar": { + "projects": "Projects", + "pages": "Pages", + "new_work_item": "New work item", + "home": "Home", + "your_work": "Your work", + "inbox": "Inbox", + "pi_chat": "PI Chat", + "workspace": "Workspace", + "initiatives": "Initiatives", + "teamspaces": "Teamspaces", + "views": "Views", + "analytics": "Analytics", + "your_projects": "Your projects", + "work_items": "Work items", + "cycles": "Cycles", + "modules": "Modules", + "intake": "Intake", + "pro_trial": "Pro trial ends in 13d", + "epics": "Epics", + "upgrade_plan": "Upgrade plan", + "plane_pro": "Plane Pro", + "business": "Business" + }, + + "auth": { + "common": { + "email": { + "label": "Email", + "placeholder": "name@company.com", + "errors": { + "required": "Email is required", + "invalid": "Email is invalid" + } + }, + "password": { + "label": "Password", + "set_password": "Set a password", + "placeholder": "Enter password", + "confirm_password": { + "label": "Confirm password", + "placeholder": "Confirm password" + }, + "current_password": { + "label": "Current password" + }, + "new_password": { + "label": "New password", + "placeholder": "Enter new password" + }, + "change_password": { + "label": { + "default": "Change password", + "submitting": "Changing password" + } + }, + "errors": { + "match": "Passwords don't match", + "empty": "Please enter your password", + "length": "Password length should me more than 8 characters", + "strength": { + "weak": "Password is weak", + "strong": "Password is strong" + } + }, + "submit": "Set password", + "toast": { + "change_password": { + "success": { + "title": "Success!", + "message": "Password changed successfully." + }, + "error": { + "title": "Error!", + "message": "Something went wrong. Please try again." + } + } + } + }, + "unique_code": { + "label": "Unique code", + "placeholder": "gets-sets-flys", + "paste_code": "Paste the code sent to your email", + "requesting_new_code": "Requesting new code", + "sending_code": "Sending code" + }, + "already_have_an_account": "Already have an account?", + "login": "Log in", + "create_account": "Create an account", + "new_to_plane": "New to Plane?", + "back_to_sign_in": "Back to sign in", + "resend_in": "Resend in {seconds} seconds", + "sign_in_with_unique_code": "Sign in with unique code", + "forgot_password": "Forgot your password?" + }, + "sign_up": { + "header": { + "label": "Create an account to start managing work with your team.", + "step": { + "email": { + "header": "Sign up", + "sub_header": "" + }, + "password": { + "header": "Sign up", + "sub_header": "Sign up using an email-password combination." + }, + "unique_code": { + "header": "Sign up", + "sub_header": "Sign up using a unique code sent to the email address above." + } + } + }, + "errors": { + "password": { + "strength": "Try setting-up a strong password to proceed" + } + } + }, + "sign_in": { + "header": { + "label": "Log in to start managing work with your team.", + "step": { + "email": { + "header": "Log in or sign up", + "sub_header": "" + }, + "password": { + "header": "Log in or sign up", + "sub_header": "Use your email-password combination to log in." + }, + "unique_code": { + "header": "Log in or sign up", + "sub_header": "Log in using a unique code sent to the email address above." + } + } + } + }, + "forgot_password": { + "title": "Reset your password", + "description": "Enter your user account's verified email address and we will send you a password reset link.", + "email_sent": "We sent the reset link to your email address", + "send_reset_link": "Send reset link", + "errors": { + "smtp_not_enabled": "We see that your god hasn't enabled SMTP, we will not be able to send a password reset link" + }, + "toast": { + "success": { + "title": "Email sent", + "message": "Check your inbox for a link to reset your password. If it doesn't appear within a few minutes, check your spam folder." + }, + "error": { + "title": "Error!", + "message": "Something went wrong. Please try again." + } + } + }, + "reset_password": { + "title": "Set new password", + "description": "Secure your account with a strong password" + }, + "set_password": { + "title": "Secure your account", + "description": "Setting password helps you login securely" + }, + "sign_out": { + "toast": { + "error": { + "title": "Error!", + "message": "Failed to sign out. Please try again." + } + } + } + } +} \ No newline at end of file diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index b3877581ddd..e2ddea60ce4 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -2076,155 +2076,8 @@ } }, - "auth": { - "common": { - "email": { - "label": "Email", - "placeholder": "name@company.com", - "errors": { - "required": "Email is required", - "invalid": "Email is invalid" - } - }, - "password": { - "label": "Password", - "set_password": "Set a password", - "placeholder": "Enter password", - "confirm_password": { - "label": "Confirm password", - "placeholder": "Confirm password" - }, - "current_password": { - "label": "Current password" - }, - "new_password": { - "label": "New password", - "placeholder": "Enter new password" - }, - "change_password": { - "label": { - "default": "Change password", - "submitting": "Changing password" - } - }, - "errors": { - "match": "Passwords don't match", - "empty": "Please enter your password", - "length": "Password length should me more than 8 characters", - "strength": { - "weak": "Password is weak", - "strong": "Password is strong" - } - }, - "submit": "Set password", - "toast": { - "change_password": { - "success": { - "title": "Success!", - "message": "Password changed successfully." - }, - "error": { - "title": "Error!", - "message": "Something went wrong. Please try again." - } - } - } - }, - "unique_code": { - "label": "Unique code", - "placeholder": "gets-sets-flys", - "paste_code": "Paste the code sent to your email", - "requesting_new_code": "Requesting new code", - "sending_code": "Sending code" - }, - "already_have_an_account": "Already have an account?", - "login": "Log in", - "create_account": "Create an account", - "new_to_plane": "New to Plane?", - "back_to_sign_in": "Back to sign in", - "resend_in": "Resend in {seconds} seconds", - "sign_in_with_unique_code": "Sign in with unique code", - "forgot_password": "Forgot your password?" - }, - "sign_up": { - "header": { - "label": "Create an account to start managing work with your team.", - "step": { - "email": { - "header": "Sign up", - "sub_header": "" - }, - "password": { - "header": "Sign up", - "sub_header": "Sign up using an email-password combination." - }, - "unique_code": { - "header": "Sign up", - "sub_header": "Sign up using a unique code sent to the email address above." - } - } - }, - "errors": { - "password": { - "strength": "Try setting-up a strong password to proceed" - } - } - }, - "sign_in": { - "header": { - "label": "Log in to start managing work with your team.", - "step": { - "email": { - "header": "Log in or sign up", - "sub_header": "" - }, - "password": { - "header": "Log in or sign up", - "sub_header": "Use your email-password combination to log in." - }, - "unique_code": { - "header": "Log in or sign up", - "sub_header": "Log in using a unique code sent to the email address above." - } - } - } - }, - "forgot_password": { - "title": "Reset your password", - "description": "Enter your user account's verified email address and we will send you a password reset link.", - "email_sent": "We sent the reset link to your email address", - "send_reset_link": "Send reset link", - "errors": { - "smtp_not_enabled": "We see that your god hasn't enabled SMTP, we will not be able to send a password reset link" - }, - "toast": { - "success": { - "title": "Email sent", - "message": "Check your inbox for a link to reset your password. If it doesn't appear within a few minutes, check your spam folder." - }, - "error": { - "title": "Error!", - "message": "Something went wrong. Please try again." - } - } - }, - "reset_password": { - "title": "Set new password", - "description": "Secure your account with a strong password" - }, - "set_password": { - "title": "Secure your account", - "description": "Setting password helps you login securely" - }, - "sign_out": { - "toast": { - "error": { - "title": "Error!", - "message": "Failed to sign out. Please try again." - } - } - } - }, + + "cycle": { "label": "{count, plural, one {Cycle} other {Cycles}}", diff --git a/packages/i18n/src/locales/es/translations.json b/packages/i18n/src/locales/es/translations.json index 17873b42b86..b4278216ac5 100644 --- a/packages/i18n/src/locales/es/translations.json +++ b/packages/i18n/src/locales/es/translations.json @@ -332,6 +332,31 @@ "re_generate_key": "Regenerar clave", "export": "Exportar", + "sidebar": { + "projects": "Proyectos", + "pages": "Páginas", + "new_work_item": "Nuevo elemento de trabajo", + "home": "Inicio", + "your_work": "Tu trabajo", + "inbox": "Bandeja de entrada", + "pi_chat": "Chat PI", + "workspace": "Espacio de trabajo", + "initiatives": "Iniciativas", + "teamspaces": "Espacios de equipo", + "views": "Vistas", + "analytics": "Análisis", + "your_projects": "Tus proyectos", + "work_items": "Elementos de trabajo", + "cycles": "Ciclos", + "modules": "Módulos", + "intake": "Entrada", + "pro_trial": "La prueba Pro termina en 13d", + "epics": "Épicas", + "upgrade_plan": "Actualizar plan", + "plane_pro": "Plane Pro", + "business": "Negocios" + }, + "project_view": { "sort_by": { "created_at": "Fecha de creación", diff --git a/packages/i18n/src/locales/fr/translations.json b/packages/i18n/src/locales/fr/translations.json index 5db24edf6d6..60eeacc711c 100644 --- a/packages/i18n/src/locales/fr/translations.json +++ b/packages/i18n/src/locales/fr/translations.json @@ -332,6 +332,32 @@ "re_generate_key": "Régénérer la clé", "export": "Exporter", + "sidebar": { + "projects": "Projets", + "pages": "Pages", + "new_work_item": "Nouvel élément de travail", + "home": "Accueil", + "your_work": "Votre travail", + "inbox": "Boîte de réception", + "pi_chat": "Chat PI", + "workspace": "Espace de travail", + "initiatives": "Initiatives", + "teamspaces": "Espaces d'équipe", + "views": "Vues", + "analytics": "Analytique", + "your_projects": "Vos projets", + "work_items": "Éléments de travail", + "cycles": "Cycles", + "modules": "Modules", + "intake": "Réception", + "pro_trial": "L'essai Pro se termine dans 13j", + "epics": "Épiques", + "upgrade_plan": "Mettre à niveau", + "plane_pro": "Plane Pro", + "business": "Entreprise" + + }, + "project_view": { "sort_by": { "created_at": "Créé le", diff --git a/packages/i18n/src/locales/ja/translations.json b/packages/i18n/src/locales/ja/translations.json index e7226961b5c..a910bcad599 100644 --- a/packages/i18n/src/locales/ja/translations.json +++ b/packages/i18n/src/locales/ja/translations.json @@ -332,6 +332,32 @@ "re_generate_key": "キーを再生成", "export": "エクスポート", + "sidebar": { + "projects": "プロジェクト", + "pages": "ページ", + "new_work_item": "新規作業項目", + "home": "ホーム", + "your_work": "あなたの作業", + "inbox": "受信トレイ", + "pi_chat": "PIチャット", + "workspace": "ワークスペース", + "initiatives": "イニシアチブ", + "teamspaces": "チームスペース", + "views": "ビュー", + "analytics": "分析", + "your_projects": "あなたのプロジェクト", + "work_items": "作業項目", + "cycles": "サイクル", + "modules": "モジュール", + "intake": "取り込み", + "pro_trial": "Proトライアル残り13日", + "epics": "エピック", + "upgrade_plan": "プランをアップグレード", + "plane_pro": "Plane Pro", + "business": "ビジネス" + }, + + "project_view": { "sort_by": { "created_at": "作成日時", diff --git a/packages/i18n/src/locales/zh-CN/translations.json b/packages/i18n/src/locales/zh-CN/translations.json index 4f616a49fa4..79d6e36305f 100644 --- a/packages/i18n/src/locales/zh-CN/translations.json +++ b/packages/i18n/src/locales/zh-CN/translations.json @@ -332,6 +332,32 @@ "re_generate_key": "重新生成密钥", "export": "导出", + "sidebar": { + "projects": "项目", + "pages": "页面", + "new_work_item": "新建工作项", + "home": "首页", + "your_work": "你的工作", + "inbox": "收件箱", + "pi_chat": "PI聊天", + "workspace": "工作空间", + "initiatives": "计划", + "teamspaces": "团队空间", + "views": "视图", + "analytics": "分析", + "your_projects": "你的项目", + "work_items": "工作项", + "cycles": "周期", + "modules": "模块", + "intake": "采集", + "pro_trial": "Pro试用期剩余13天", + "epics": "史诗", + "upgrade_plan": "升级计划", + "plane_pro": "Plane Pro", + "business": "商务" + }, + + "project_view": { "sort_by": { "created_at": "创建于", From 06e2bf0f97ccce11e6e1e1a27af3b4b122eb56aa Mon Sep 17 00:00:00 2001 From: gakshita Date: Fri, 31 Jan 2025 15:54:49 +0530 Subject: [PATCH 2/4] fix: changed sidebar keys --- packages/i18n/src/locales/en/core.json | 6 +++++- packages/i18n/src/locales/es/translations.json | 6 +++++- packages/i18n/src/locales/fr/translations.json | 7 +++++-- packages/i18n/src/locales/ja/translations.json | 6 +++++- .../i18n/src/locales/zh-CN/translations.json | 6 +++++- web/ce/components/workspace/edition-badge.tsx | 4 ++-- web/ce/components/workspace/upgrade-badge.tsx | 5 ++++- .../sidebar/favorites/favorites-menu.tsx | 2 +- .../workspace/sidebar/project-navigation.tsx | 18 +++++++++--------- .../workspace/sidebar/projects-list.tsx | 2 +- .../workspace/sidebar/quick-actions.tsx | 4 +++- .../components/workspace/sidebar/user-menu.tsx | 8 ++++---- .../sidebar/workspace-menu-header.tsx | 2 +- .../workspace/sidebar/workspace-menu.tsx | 8 ++++---- 14 files changed, 54 insertions(+), 30 deletions(-) diff --git a/packages/i18n/src/locales/en/core.json b/packages/i18n/src/locales/en/core.json index b447337dcef..4abbf39fa72 100644 --- a/packages/i18n/src/locales/en/core.json +++ b/packages/i18n/src/locales/en/core.json @@ -21,7 +21,11 @@ "epics": "Epics", "upgrade_plan": "Upgrade plan", "plane_pro": "Plane Pro", - "business": "Business" + "business": "Business", + "drafts": "Drafts", + "your_favorites": "Your favorites", + "pro": "Pro", + "upgrade": "Upgrade" }, "auth": { diff --git a/packages/i18n/src/locales/es/translations.json b/packages/i18n/src/locales/es/translations.json index b4278216ac5..ea6269123d9 100644 --- a/packages/i18n/src/locales/es/translations.json +++ b/packages/i18n/src/locales/es/translations.json @@ -354,7 +354,11 @@ "epics": "Épicas", "upgrade_plan": "Actualizar plan", "plane_pro": "Plane Pro", - "business": "Negocios" + "business": "Negocios", + "drafts": "Borradores", + "your_favorites": "Tus favoritos", + "pro": "Pro", + "upgrade": "Actualizar" }, "project_view": { diff --git a/packages/i18n/src/locales/fr/translations.json b/packages/i18n/src/locales/fr/translations.json index 60eeacc711c..7710f3d2142 100644 --- a/packages/i18n/src/locales/fr/translations.json +++ b/packages/i18n/src/locales/fr/translations.json @@ -354,8 +354,11 @@ "epics": "Épiques", "upgrade_plan": "Mettre à niveau", "plane_pro": "Plane Pro", - "business": "Entreprise" - + "business": "Entreprise", + "drafts": "Brouillons", + "your_favorites": "Vos favoris", + "pro": "Pro", + "upgrade": "Mettre à niveau" }, "project_view": { diff --git a/packages/i18n/src/locales/ja/translations.json b/packages/i18n/src/locales/ja/translations.json index a910bcad599..e4135afb145 100644 --- a/packages/i18n/src/locales/ja/translations.json +++ b/packages/i18n/src/locales/ja/translations.json @@ -354,7 +354,11 @@ "epics": "エピック", "upgrade_plan": "プランをアップグレード", "plane_pro": "Plane Pro", - "business": "ビジネス" + "business": "ビジネス", + "drafts": "下書き", + "your_favorites": "お気に入り", + "pro": "Pro", + "upgrade": "アップグレード" }, diff --git a/packages/i18n/src/locales/zh-CN/translations.json b/packages/i18n/src/locales/zh-CN/translations.json index 79d6e36305f..4b43067fda8 100644 --- a/packages/i18n/src/locales/zh-CN/translations.json +++ b/packages/i18n/src/locales/zh-CN/translations.json @@ -354,7 +354,11 @@ "epics": "史诗", "upgrade_plan": "升级计划", "plane_pro": "Plane Pro", - "business": "商务" + "business": "商务", + "drafts": "草稿", + "your_favorites": "收藏夹", + "pro": "Pro", + "upgrade": "升级" }, diff --git a/web/ce/components/workspace/edition-badge.tsx b/web/ce/components/workspace/edition-badge.tsx index 82d4f47d244..effb5501b4b 100644 --- a/web/ce/components/workspace/edition-badge.tsx +++ b/web/ce/components/workspace/edition-badge.tsx @@ -1,12 +1,12 @@ import { useState } from "react"; import { observer } from "mobx-react"; +import packageJson from "package.json"; import { useTranslation } from "@plane/i18n"; // ui import { Button, Tooltip } from "@plane/ui"; // hooks import { usePlatformOS } from "@/hooks/use-platform-os"; // assets -import packageJson from "package.json"; // local components import { PaidPlanUpgradeModal } from "./upgrade"; @@ -29,7 +29,7 @@ export const WorkspaceEditionBadge = observer(() => { className="w-fit min-w-24 cursor-pointer rounded-2xl px-2 py-1 text-center text-sm font-medium outline-none" onClick={() => setIsPaidPlanPurchaseModalOpen(true)} > - {t("upgrade")} + {t("sidebar.upgrade")} diff --git a/web/ce/components/workspace/upgrade-badge.tsx b/web/ce/components/workspace/upgrade-badge.tsx index 3fc3654cfba..1abb731e7ff 100644 --- a/web/ce/components/workspace/upgrade-badge.tsx +++ b/web/ce/components/workspace/upgrade-badge.tsx @@ -1,5 +1,6 @@ import { FC } from "react"; // helpers +import { useTranslation } from "@plane/i18n"; import { cn } from "@/helpers/common.helper"; type TUpgradeBadge = { @@ -10,6 +11,8 @@ type TUpgradeBadge = { export const UpgradeBadge: FC = (props) => { const { className, size = "sm" } = props; + const { t } = useTranslation(); + return (
= (props) => { className )} > - Pro + {t("sidebar.pro")}
); }; diff --git a/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx b/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx index e1edc361521..8786e8d2b13 100644 --- a/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx +++ b/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx @@ -200,7 +200,7 @@ export const SidebarFavoritesMenu = observer(() => { )} > toggleFavoriteMenu(!isFavoriteMenuOpen)} className="flex-1 text-start"> - {t("your_favorites").toUpperCase()} + {t("sidebar.your_favorites").toUpperCase()} diff --git a/web/core/components/workspace/sidebar/project-navigation.tsx b/web/core/components/workspace/sidebar/project-navigation.tsx index 0053f4b4c46..e859eed41e6 100644 --- a/web/core/components/workspace/sidebar/project-navigation.tsx +++ b/web/core/components/workspace/sidebar/project-navigation.tsx @@ -17,13 +17,13 @@ import { usePlatformOS } from "@/hooks/use-platform-os"; // plane-web constants export type TNavigationItem = { - key: string; name: string; href: string; icon: React.ElementType; access: EUserPermissions[] | EUserProjectRoles[]; shouldRender: boolean; sortOrder: number; + i18n_key: string; }; type TProjectItemsProps = { @@ -56,7 +56,7 @@ export const ProjectNavigation: FC = observer((props) => { const baseNavigation = useCallback( (workspaceSlug: string, projectId: string): TNavigationItem[] => [ { - key: "issues", + i18n_key: "sidebar.work_items", name: "Work items", href: `/${workspaceSlug}/projects/${projectId}/issues`, icon: LayersIcon, @@ -65,7 +65,7 @@ export const ProjectNavigation: FC = observer((props) => { sortOrder: 1, }, { - key: "cycles", + i18n_key: "sidebar.cycles", name: "Cycles", href: `/${workspaceSlug}/projects/${projectId}/cycles`, icon: ContrastIcon, @@ -74,7 +74,7 @@ export const ProjectNavigation: FC = observer((props) => { sortOrder: 2, }, { - key: "modules", + i18n_key: "sidebar.modules", name: "Modules", href: `/${workspaceSlug}/projects/${projectId}/modules`, icon: DiceIcon, @@ -83,7 +83,7 @@ export const ProjectNavigation: FC = observer((props) => { sortOrder: 3, }, { - key: "views", + i18n_key: "sidebar.views", name: "Views", href: `/${workspaceSlug}/projects/${projectId}/views`, icon: Layers, @@ -92,7 +92,7 @@ export const ProjectNavigation: FC = observer((props) => { sortOrder: 4, }, { - key: "pages", + i18n_key: "sidebar.pages", name: "Pages", href: `/${workspaceSlug}/projects/${projectId}/pages`, icon: FileText, @@ -101,7 +101,7 @@ export const ProjectNavigation: FC = observer((props) => { sortOrder: 5, }, { - key: "intake", + i18n_key: "sidebar.intake", name: "Intake", href: `/${workspaceSlug}/projects/${projectId}/inbox`, icon: Intake, @@ -145,7 +145,7 @@ export const ProjectNavigation: FC = observer((props) => { = observer((props) => { - {!isSidebarCollapsed && {t(item.key)}} + {!isSidebarCollapsed && {t(item.i18n_key)}} diff --git a/web/core/components/workspace/sidebar/projects-list.tsx b/web/core/components/workspace/sidebar/projects-list.tsx index 6ca6b525fa3..847ba914af3 100644 --- a/web/core/components/workspace/sidebar/projects-list.tsx +++ b/web/core/components/workspace/sidebar/projects-list.tsx @@ -187,7 +187,7 @@ export const SidebarProjectsList: FC = observer(() => { {isCollapsed ? ( ) : ( - {t("your_projects").toUpperCase()} + {t("sidebar.your_projects").toUpperCase()} )} diff --git a/web/core/components/workspace/sidebar/quick-actions.tsx b/web/core/components/workspace/sidebar/quick-actions.tsx index 8e497d7a137..c0c8eee9c78 100644 --- a/web/core/components/workspace/sidebar/quick-actions.tsx +++ b/web/core/components/workspace/sidebar/quick-actions.tsx @@ -94,7 +94,9 @@ export const SidebarQuickActions = observer(() => { disabled={disabled} > - {!isSidebarCollapsed && {t("new_issue")}} + {!isSidebarCollapsed && ( + {t("sidebar.new_work_item")} + )}