diff --git a/apps/web/core/components/core/modals/bulk-delete-issues-modal.tsx b/apps/web/core/components/core/modals/bulk-delete-issues-modal.tsx index c2cde2998f5..29b17fc741b 100644 --- a/apps/web/core/components/core/modals/bulk-delete-issues-modal.tsx +++ b/apps/web/core/components/core/modals/bulk-delete-issues-modal.tsx @@ -177,7 +177,7 @@ export const BulkDeleteIssuesModal = observer(function BulkDeleteIssuesModal(pro setQuery(event.target.value)} /> diff --git a/apps/web/core/components/cycles/cycles-view-header.tsx b/apps/web/core/components/cycles/cycles-view-header.tsx index 8c3cd0a0c9b..087e7bcde0c 100644 --- a/apps/web/core/components/cycles/cycles-view-header.tsx +++ b/apps/web/core/components/cycles/cycles-view-header.tsx @@ -100,7 +100,7 @@ export const CyclesViewHeader = observer(function CyclesViewHeader(props: Props) updateSearchQuery(e.target.value)} onKeyDown={handleInputKeyDown} diff --git a/apps/web/core/components/cycles/transfer-issues-modal.tsx b/apps/web/core/components/cycles/transfer-issues-modal.tsx index 3f1bda0d667..721a7212725 100644 --- a/apps/web/core/components/cycles/transfer-issues-modal.tsx +++ b/apps/web/core/components/cycles/transfer-issues-modal.tsx @@ -8,6 +8,7 @@ import { useState } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import { AlertCircle } from "lucide-react"; +import { useTranslation } from "@plane/i18n"; import { SearchIcon, CycleIcon, TransferIcon, CloseIcon } from "@plane/propel/icons"; import { TOAST_TYPE, setToast } from "@plane/propel/toast"; import { EIssuesStoreType } from "@plane/types"; @@ -23,6 +24,8 @@ type Props = { export const TransferIssuesModal = observer(function TransferIssuesModal(props: Props) { const { isOpen, handleClose, cycleId } = props; + // translation + const { t } = useTranslation(); // states const [query, setQuery] = useState(""); @@ -41,16 +44,16 @@ export const TransferIssuesModal = observer(function TransferIssuesModal(props: .then(async () => { setToast({ type: TOAST_TYPE.SUCCESS, - title: "Success!", - message: "Work items have been transferred successfully", + title: t("common.success"), + message: t("cycle.transfer_issues_modal.transfer_success"), }); await getCycleDetails(payload.new_cycle_id); }) .catch(() => { setToast({ type: TOAST_TYPE.ERROR, - title: "Error!", - message: "Unable to transfer work items. Please try again.", + title: t("common.error.label"), + message: t("cycle.transfer_issues_modal.transfer_error"), }); }); }; @@ -64,8 +67,8 @@ export const TransferIssuesModal = observer(function TransferIssuesModal(props: await Promise.all(cyclesFetch).catch((error) => { setToast({ type: TOAST_TYPE.ERROR, - title: "Error", - message: error.error || "Unable to fetch cycle details", + title: t("common.error.label"), + message: error.error || t("cycle.transfer_issues_modal.fetch_details_error"), }); }); }; @@ -82,7 +85,7 @@ export const TransferIssuesModal = observer(function TransferIssuesModal(props:
-

Transfer work items

+

{t("cycle.transfer_issues_modal.title")}

diff --git a/apps/web/core/components/home/user-greetings.tsx b/apps/web/core/components/home/user-greetings.tsx index 8d5d6cc1e86..ae72bd95b79 100644 --- a/apps/web/core/components/home/user-greetings.tsx +++ b/apps/web/core/components/home/user-greetings.tsx @@ -43,15 +43,16 @@ export function UserGreetingsView(props: IUserGreetingsView) { minute: "2-digit", }).format(currentTime); - const greeting = parseInt(hour, 10) < 12 ? "morning" : parseInt(hour, 10) < 18 ? "afternoon" : "evening"; + const greeting = + parseInt(hour, 10) < 12 ? "good_morning" : parseInt(hour, 10) < 18 ? "good_afternoon" : "good_evening"; return (

- {t("good")} {t(greeting)}, {user?.first_name} {user?.last_name} + {t(greeting)}, {user?.first_name} {user?.last_name}

-
{greeting === "morning" ? "🌤️" : greeting === "afternoon" ? "🌥️" : "🌙️"}
+
{greeting === "good_morning" ? "🌤️" : greeting === "good_afternoon" ? "🌥️" : "🌙️"}
{weekDay}, {date} {timeString}
diff --git a/apps/web/core/components/inbox/content/issue-properties.tsx b/apps/web/core/components/inbox/content/issue-properties.tsx index f355e39e36c..737da2666a3 100644 --- a/apps/web/core/components/inbox/content/issue-properties.tsx +++ b/apps/web/core/components/inbox/content/issue-properties.tsx @@ -5,6 +5,7 @@ */ import { observer } from "mobx-react"; +import { useTranslation } from "@plane/i18n"; import { StatePropertyIcon, MembersPropertyIcon, @@ -42,6 +43,8 @@ type Props = { export const InboxIssueContentProperties = observer(function InboxIssueContentProperties(props: Props) { const { workspaceSlug, projectId, issue, issueOperations, isEditable, duplicateIssueDetails, isIntakeAccepted } = props; + // translation + const { t } = useTranslation(); const router = useAppRouter(); // store hooks @@ -100,7 +103,7 @@ export const InboxIssueContentProperties = observer(function InboxIssueContentPr } disabled={!isEditable} projectId={projectId?.toString() ?? ""} - placeholder="Add assignees" + placeholder={t("inbox_issue.properties.add_assignees")} multiple buttonVariant={ (issue?.assignee_ids || [])?.length > 0 ? "transparent-without-text" : "transparent-with-text" @@ -144,7 +147,7 @@ export const InboxIssueContentProperties = observer(function InboxIssueContentPr Due date
issue?.id && diff --git a/apps/web/core/components/inbox/modals/select-duplicate.tsx b/apps/web/core/components/inbox/modals/select-duplicate.tsx index 7b6911830f1..8b4ff119747 100644 --- a/apps/web/core/components/inbox/modals/select-duplicate.tsx +++ b/apps/web/core/components/inbox/modals/select-duplicate.tsx @@ -141,7 +141,7 @@ export function SelectDuplicateInboxIssueModal(props: Props) { setQuery(e.target.value)} /> diff --git a/apps/web/core/components/modules/links/create-update-modal.tsx b/apps/web/core/components/modules/links/create-update-modal.tsx index b99254aefd6..f70c1b17f68 100644 --- a/apps/web/core/components/modules/links/create-update-modal.tsx +++ b/apps/web/core/components/modules/links/create-update-modal.tsx @@ -6,6 +6,7 @@ import { useEffect } from "react"; import { Controller, useForm } from "react-hook-form"; +import { useTranslation } from "@plane/i18n"; // plane types import { Button } from "@plane/propel/button"; import { TOAST_TYPE, setToast } from "@plane/propel/toast"; @@ -28,6 +29,8 @@ const defaultValues: ModuleLink = { export function CreateUpdateModuleLinkModal(props: Props) { const { isOpen, handleClose, createLink, updateLink, data } = props; + // translation + const { t } = useTranslation(); // form info const { formState: { errors, isSubmitting }, @@ -54,23 +57,23 @@ export function CreateUpdateModuleLinkModal(props: Props) { await createLink(payload); setToast({ type: TOAST_TYPE.SUCCESS, - title: "Success!", - message: "Module link created successfully.", + title: t("common.success"), + message: t("entity.add.success", { entity: t("common.link") }), }); } else { await updateLink(payload, data.id); setToast({ type: TOAST_TYPE.SUCCESS, - title: "Success!", - message: "Module link updated successfully.", + title: t("common.success"), + message: t("entity.update.success", { entity: t("common.link") }), }); } onClose(); } catch (error: any) { setToast({ type: TOAST_TYPE.ERROR, - title: "Error!", - message: error?.data?.error ?? "Some error occurred. Please try again.", + title: t("common.error.label"), + message: error?.data?.error ?? t("common.error.message"), }); } }; @@ -86,11 +89,13 @@ export function CreateUpdateModuleLinkModal(props: Props) {
-

{data ? "Update" : "Add"} link

+

+ {data ? t("common.update_link") : t("common.add_link")} +

)} @@ -114,8 +119,8 @@ export function CreateUpdateModuleLinkModal(props: Props) {
)} @@ -138,10 +143,18 @@ export function CreateUpdateModuleLinkModal(props: Props) {
diff --git a/apps/web/core/components/modules/module-view-header.tsx b/apps/web/core/components/modules/module-view-header.tsx index 916bfe95b6a..d963b7e69ff 100644 --- a/apps/web/core/components/modules/module-view-header.tsx +++ b/apps/web/core/components/modules/module-view-header.tsx @@ -125,7 +125,7 @@ export const ModuleViewHeader = observer(function ModuleViewHeader() { updateSearchQuery(e.target.value)} onKeyDown={handleInputKeyDown} diff --git a/apps/web/core/components/pages/list/search-input.tsx b/apps/web/core/components/pages/list/search-input.tsx index 36ab492ca5e..ee4f4be89af 100644 --- a/apps/web/core/components/pages/list/search-input.tsx +++ b/apps/web/core/components/pages/list/search-input.tsx @@ -6,6 +6,7 @@ import { useRef, useState } from "react"; // plane imports +import { useTranslation } from "@plane/i18n"; import { useOutsideClickDetector } from "@plane/hooks"; import { IconButton } from "@plane/propel/icon-button"; import { SearchIcon, CloseIcon } from "@plane/propel/icons"; @@ -18,6 +19,8 @@ type Props = { export function PageSearchInput(props: Props) { const { searchQuery, updateSearchQuery } = props; + // translation + const { t } = useTranslation(); // states const [isSearchOpen, setIsSearchOpen] = useState(false); // refs @@ -64,7 +67,7 @@ export function PageSearchInput(props: Props) { updateSearchQuery(e.target.value)} onKeyDown={handleInputKeyDown} diff --git a/apps/web/core/components/project-states/create-update/form.tsx b/apps/web/core/components/project-states/create-update/form.tsx index f3fdec84d64..e7bcaf74fb6 100644 --- a/apps/web/core/components/project-states/create-update/form.tsx +++ b/apps/web/core/components/project-states/create-update/form.tsx @@ -6,6 +6,7 @@ import { useEffect, useState } from "react"; import { TwitterPicker } from "react-color"; +import { useTranslation } from "@plane/i18n"; import { Button } from "@plane/propel/button"; import type { IState } from "@plane/types"; import { Popover, Input, TextArea } from "@plane/ui"; @@ -31,6 +32,8 @@ function PopoverButton({ color }: { color?: string }) { export function StateForm(props: TStateForm) { const { data, onSubmit, onCancel, buttonDisabled, buttonTitle } = props; + // translation + const { t } = useTranslation(); // states const [formData, setFromData] = useState | undefined>(undefined); const [errors, setErrors] = useState> | undefined>(undefined); @@ -50,7 +53,7 @@ export function StateForm(props: TStateForm) { const name = formData?.name || undefined; if (!formData || !name) { let currentErrors: Partial> = {}; - if (!name) currentErrors = { ...currentErrors, name: "Name is required" }; + if (!name) currentErrors = { ...currentErrors, name: t("name_is_required") }; setErrors(currentErrors); return; } @@ -77,7 +80,7 @@ export function StateForm(props: TStateForm) { id="name" type="text" name="name" - placeholder="Name" + placeholder={t("common.name")} value={formData?.name} onChange={(e) => handleFormData("name", e.target.value)} hasError={(errors && Boolean(errors.name)) || false} @@ -90,7 +93,7 @@ export function StateForm(props: TStateForm) {