Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/i18n/src/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down
4 changes: 3 additions & 1 deletion packages/i18n/src/locales/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down Expand Up @@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/src/locales/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/src/locales/ja/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@
"week": "週",
"month": "月",
"quarter": "四半期",
"press_for_commands": "コマンドを入力",
"click_to_add_description": "説明を追加",
"search": {
"label": "検索",
"placeholder": "検索するキーワードを入力...",
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/src/locales/zh-CN/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@
"week": "周",
"month": "月",
"quarter": "季度",
"press_for_commands": "输入 '/' 以输入命令",
"click_to_add_description": "点击以添加描述",
"search": {
"label": "搜索",
"placeholder": "输入以搜索...",
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/home/home-dashboard-widgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -51,6 +53,10 @@ export const InboxIssueDescription: FC<TInboxIssueDescription> = observer((props
onEnterKeyPress,
onAssetUpload,
} = props;

// i18n
const { t } = useTranslation();

// hooks
const { loader } = useProjectInbox();
const { isMobile } = usePlatformOS();
Expand All @@ -74,7 +80,7 @@ export const InboxIssueDescription: FC<TInboxIssueDescription> = 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,
Expand Down
11 changes: 9 additions & 2 deletions web/core/components/issues/description-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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
Expand Down Expand Up @@ -50,6 +52,9 @@ export const IssueDescriptionInput: FC<IssueDescriptionInputProps> = observer((p
placeholder,
} = props;

// i18n
const { t } = useTranslation();

const { handleSubmit, reset, control } = useForm<TIssue>({
defaultValues: {
description_html: initialValue,
Expand Down Expand Up @@ -119,7 +124,9 @@ export const IssueDescriptionInput: FC<IssueDescriptionInputProps> = observer((p
debouncedFormSave();
}}
placeholder={
placeholder ? placeholder : (isFocused, value) => getDescriptionPlaceholder(isFocused, value)
placeholder
? placeholder
: (isFocused, value) => t(`${getDescriptionPlaceholderI18n(isFocused, value)}`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need string literal here

}
searchMentionCallback={async (payload) =>
await workspaceService.searchEntity(workspaceSlug?.toString() ?? "", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -72,6 +74,8 @@ export const IssueDescriptionEditor: React.FC<TIssueDescriptionEditorProps> = ob
onAssetUpload,
onClose,
} = props;
// i18n
const { t } = useTranslation();
// states
const [iAmFeelingLucky, setIAmFeelingLucky] = useState(false);
// store hooks
Expand Down Expand Up @@ -190,7 +194,7 @@ export const IssueDescriptionEditor: React.FC<TIssueDescriptionEditorProps> = 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,
Expand Down
7 changes: 3 additions & 4 deletions web/helpers/issue.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 === "<p></p>" || 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 = (
Expand Down
Loading