diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index 5a673157558..be10ee8b7aa 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -589,6 +589,8 @@ "week": "Week", "month": "Month", "quarter": "Quarter", + "press_for_commands": "Press '/' for commands", + "click_to_add_description": "Click to add description", "search": { "label": "Search", "placeholder": "Type to search...", diff --git a/packages/i18n/src/locales/es/translations.json b/packages/i18n/src/locales/es/translations.json index bf5c115cc0d..8e09bfa3eca 100644 --- a/packages/i18n/src/locales/es/translations.json +++ b/packages/i18n/src/locales/es/translations.json @@ -589,6 +589,8 @@ "week": "Semana", "month": "Mes", "quarter": "Trimestre", + "press_for_commands": "Presiona '/' para comandos", + "click_to_add_description": "Haz clic para agregar descripción", "search": { "label": "Buscar", "placeholder": "Escribe para buscar...", @@ -1364,7 +1366,7 @@ "title": "Actividad reciente", "empty": "No pudimos encontrar datos. Por favor, revise sus entradas", "button": "Descargar la actividad de hoy", - "button_loading": "Descargando" + "button_loading": "Descargando" } }, "actions": { diff --git a/packages/i18n/src/locales/fr/translations.json b/packages/i18n/src/locales/fr/translations.json index dd4976f873c..ce19ba1530d 100644 --- a/packages/i18n/src/locales/fr/translations.json +++ b/packages/i18n/src/locales/fr/translations.json @@ -589,6 +589,8 @@ "week": "Semaine", "month": "Mois", "quarter": "Trimestre", + "press_for_commands": "Presse '/' pour les commandes", + "click_to_add_description": "Cliquez pour ajouter une description", "search": { "label": "Recherche", "placeholder": "Tapez pour rechercher...", diff --git a/packages/i18n/src/locales/ja/translations.json b/packages/i18n/src/locales/ja/translations.json index 6b56ce7fa20..8167cd43b59 100644 --- a/packages/i18n/src/locales/ja/translations.json +++ b/packages/i18n/src/locales/ja/translations.json @@ -589,6 +589,8 @@ "week": "週", "month": "月", "quarter": "四半期", + "press_for_commands": "コマンドを入力", + "click_to_add_description": "説明を追加", "search": { "label": "検索", "placeholder": "検索するキーワードを入力...", diff --git a/packages/i18n/src/locales/zh-CN/translations.json b/packages/i18n/src/locales/zh-CN/translations.json index c2df1ae4774..e01dfb7a77b 100644 --- a/packages/i18n/src/locales/zh-CN/translations.json +++ b/packages/i18n/src/locales/zh-CN/translations.json @@ -589,6 +589,8 @@ "week": "周", "month": "月", "quarter": "季度", + "press_for_commands": "输入 '/' 以输入命令", + "click_to_add_description": "点击以添加描述", "search": { "label": "搜索", "placeholder": "输入以搜索...", diff --git a/web/core/components/home/home-dashboard-widgets.tsx b/web/core/components/home/home-dashboard-widgets.tsx index 4b8ed0a29bc..e391567c4db 100644 --- a/web/core/components/home/home-dashboard-widgets.tsx +++ b/web/core/components/home/home-dashboard-widgets.tsx @@ -35,7 +35,7 @@ export const HOME_WIDGETS_LIST: { my_stickies: { component: StickiesWidget, fullWidth: false, - title: "home.my_stickies.title", + title: "stickies.title", }, new_at_plane: { component: null, diff --git a/web/core/components/inbox/modals/create-modal/issue-description.tsx b/web/core/components/inbox/modals/create-modal/issue-description.tsx index 9485fc3e6fe..3f2b5e88996 100644 --- a/web/core/components/inbox/modals/create-modal/issue-description.tsx +++ b/web/core/components/inbox/modals/create-modal/issue-description.tsx @@ -6,6 +6,8 @@ import { observer } from "mobx-react"; import { ETabIndices } from "@plane/constants"; // editor import { EditorRefApi } from "@plane/editor"; +// i18n +import { useTranslation } from "@plane/i18n"; // types import { TIssue } from "@plane/types"; import { EFileAssetType } from "@plane/types/src/enums"; @@ -14,7 +16,7 @@ import { Loader } from "@plane/ui"; // components import { RichTextEditor } from "@/components/editor/rich-text-editor/rich-text-editor"; // helpers -import { getDescriptionPlaceholder } from "@/helpers/issue.helper"; +import { getDescriptionPlaceholderI18n } from "@/helpers/issue.helper"; import { getTabIndex } from "@/helpers/tab-indices.helper"; // hooks import { useProjectInbox } from "@/hooks/store"; @@ -51,6 +53,10 @@ export const InboxIssueDescription: FC = observer((props onEnterKeyPress, onAssetUpload, } = props; + + // i18n + const { t } = useTranslation(); + // hooks const { loader } = useProjectInbox(); const { isMobile } = usePlatformOS(); @@ -74,7 +80,7 @@ export const InboxIssueDescription: FC = observer((props projectId={projectId} dragDropEnabled={false} onChange={(_description: object, description_html: string) => handleData("description_html", description_html)} - placeholder={getDescriptionPlaceholder} + placeholder={(isFocused, description) => t(`${getDescriptionPlaceholderI18n(isFocused, description)}`)} searchMentionCallback={async (payload) => await workspaceService.searchEntity(workspaceSlug?.toString() ?? "", { ...payload, diff --git a/web/core/components/issues/description-input.tsx b/web/core/components/issues/description-input.tsx index e4955dd1a6f..a19b94517ff 100644 --- a/web/core/components/issues/description-input.tsx +++ b/web/core/components/issues/description-input.tsx @@ -4,6 +4,8 @@ import { FC, useCallback, useEffect, useState } from "react"; import debounce from "lodash/debounce"; import { observer } from "mobx-react"; import { Controller, useForm } from "react-hook-form"; +// i18n +import { useTranslation } from "@plane/i18n"; // types import { TIssue, TNameDescriptionLoader } from "@plane/types"; import { EFileAssetType } from "@plane/types/src/enums"; @@ -13,7 +15,7 @@ import { Loader } from "@plane/ui"; import { RichTextEditor, RichTextReadOnlyEditor } from "@/components/editor"; import { TIssueOperations } from "@/components/issues/issue-detail"; // helpers -import { getDescriptionPlaceholder } from "@/helpers/issue.helper"; +import { getDescriptionPlaceholderI18n } from "@/helpers/issue.helper"; // hooks import { useWorkspace } from "@/hooks/store"; // plane web services @@ -50,6 +52,9 @@ export const IssueDescriptionInput: FC = observer((p placeholder, } = props; + // i18n + const { t } = useTranslation(); + const { handleSubmit, reset, control } = useForm({ defaultValues: { description_html: initialValue, @@ -119,7 +124,9 @@ export const IssueDescriptionInput: FC = observer((p debouncedFormSave(); }} placeholder={ - placeholder ? placeholder : (isFocused, value) => getDescriptionPlaceholder(isFocused, value) + placeholder + ? placeholder + : (isFocused, value) => t(`${getDescriptionPlaceholderI18n(isFocused, value)}`) } searchMentionCallback={async (payload) => await workspaceService.searchEntity(workspaceSlug?.toString() ?? "", { diff --git a/web/core/components/issues/issue-modal/components/description-editor.tsx b/web/core/components/issues/issue-modal/components/description-editor.tsx index ffc1ec18970..878b383228b 100644 --- a/web/core/components/issues/issue-modal/components/description-editor.tsx +++ b/web/core/components/issues/issue-modal/components/description-editor.tsx @@ -8,6 +8,8 @@ import { Sparkle } from "lucide-react"; import { ETabIndices } from "@plane/constants"; // editor import { EditorRefApi } from "@plane/editor"; +// i18n +import { useTranslation } from "@plane/i18n"; // types import { TIssue } from "@plane/types"; import { EFileAssetType } from "@plane/types/src/enums"; @@ -17,7 +19,7 @@ import { Loader, setToast, TOAST_TYPE } from "@plane/ui"; import { GptAssistantPopover } from "@/components/core"; import { RichTextEditor } from "@/components/editor"; // helpers -import { getDescriptionPlaceholder } from "@/helpers/issue.helper"; +import { getDescriptionPlaceholderI18n } from "@/helpers/issue.helper"; import { getTabIndex } from "@/helpers/tab-indices.helper"; // hooks import { useInstance, useWorkspace } from "@/hooks/store"; @@ -72,6 +74,8 @@ export const IssueDescriptionEditor: React.FC = ob onAssetUpload, onClose, } = props; + // i18n + const { t } = useTranslation(); // states const [iAmFeelingLucky, setIAmFeelingLucky] = useState(false); // store hooks @@ -190,7 +194,7 @@ export const IssueDescriptionEditor: React.FC = ob onEnterKeyPress={() => submitBtnRef?.current?.click()} ref={editorRef} tabIndex={getIndex("description_html")} - placeholder={getDescriptionPlaceholder} + placeholder={(isFocused, description) => t(getDescriptionPlaceholderI18n(isFocused, description))} searchMentionCallback={async (payload) => await workspaceService.searchEntity(workspaceSlug?.toString() ?? "", { ...payload, diff --git a/web/helpers/issue.helper.ts b/web/helpers/issue.helper.ts index 69fb2d8c79e..55239b50109 100644 --- a/web/helpers/issue.helper.ts +++ b/web/helpers/issue.helper.ts @@ -211,11 +211,10 @@ export const formatTextList = (TextArray: string[]): string => { } }; -export const getDescriptionPlaceholder = (isFocused: boolean, description: string | undefined): string => { +export const getDescriptionPlaceholderI18n = (isFocused: boolean, description: string | undefined): string => { const isDescriptionEmpty = !description || description === "

" || description.trim() === ""; - // TODO: Translate here - if (!isDescriptionEmpty || isFocused) return "Press '/' for commands..."; - else return "Click to add description"; + if (!isDescriptionEmpty || isFocused) return "common.press_for_commands"; + else return "common.click_to_add_description"; }; export const issueCountBasedOnFilters = (