Skip to content

Commit 40ac2b9

Browse files
committed
chore: add translation for saving status in EditorToolbar
1 parent 501e8f1 commit 40ac2b9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

web/src/components/MemoEditor/components/EditorToolbar.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import type { FC } from "react";
22
import { Button } from "@/components/ui/button";
3+
import { useTranslate } from "@/utils/i18n";
34
import { validationService } from "../services";
45
import { useEditorContext } from "../state";
56
import InsertMenu from "../Toolbar/InsertMenu";
67
import VisibilitySelector from "../Toolbar/VisibilitySelector";
78
import type { EditorToolbarProps } from "../types";
89

910
export const EditorToolbar: FC<EditorToolbarProps> = ({ onSave, onCancel, memoName }) => {
11+
const t = useTranslate();
1012
const { state, actions, dispatch } = useEditorContext();
1113
const { valid } = validationService.canSave(state);
1214

@@ -41,12 +43,12 @@ export const EditorToolbar: FC<EditorToolbarProps> = ({ onSave, onCancel, memoNa
4143

4244
{onCancel && (
4345
<Button variant="ghost" onClick={onCancel} disabled={isSaving}>
44-
Cancel
46+
{t("common.cancel")}
4547
</Button>
4648
)}
4749

4850
<Button onClick={onSave} disabled={!valid || isSaving}>
49-
{isSaving ? "Saving..." : "Save"}
51+
{isSaving ? t("editor.saving") : t("editor.save")}
5052
</Button>
5153
</div>
5254
</div>

web/src/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"add-your-comment-here": "Add your comment here...",
122122
"any-thoughts": "Any thoughts...",
123123
"save": "Save",
124+
"saving": "Saving...",
124125
"no-changes-detected": "No changes detected",
125126
"focus-mode": "Focus Mode",
126127
"exit-focus-mode": "Exit Focus Mode",
@@ -466,4 +467,4 @@
466467
"tags": "Tags",
467468
"upload-attachment": "Upload Attachment(s)"
468469
}
469-
}
470+
}

0 commit comments

Comments
 (0)