chore: add translation for saving status in EditorToolbar
This commit is contained in:
parent
501e8f1eae
commit
6c9ea31de0
2 changed files with 5 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import type { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { validationService } from "../services";
|
import { validationService } from "../services";
|
||||||
import { useEditorContext } from "../state";
|
import { useEditorContext } from "../state";
|
||||||
import InsertMenu from "../Toolbar/InsertMenu";
|
import InsertMenu from "../Toolbar/InsertMenu";
|
||||||
|
|
@ -7,6 +8,7 @@ import VisibilitySelector from "../Toolbar/VisibilitySelector";
|
||||||
import type { EditorToolbarProps } from "../types";
|
import type { EditorToolbarProps } from "../types";
|
||||||
|
|
||||||
export const EditorToolbar: FC<EditorToolbarProps> = ({ onSave, onCancel, memoName }) => {
|
export const EditorToolbar: FC<EditorToolbarProps> = ({ onSave, onCancel, memoName }) => {
|
||||||
|
const t = useTranslate();
|
||||||
const { state, actions, dispatch } = useEditorContext();
|
const { state, actions, dispatch } = useEditorContext();
|
||||||
const { valid } = validationService.canSave(state);
|
const { valid } = validationService.canSave(state);
|
||||||
|
|
||||||
|
|
@ -41,12 +43,12 @@ export const EditorToolbar: FC<EditorToolbarProps> = ({ onSave, onCancel, memoNa
|
||||||
|
|
||||||
{onCancel && (
|
{onCancel && (
|
||||||
<Button variant="ghost" onClick={onCancel} disabled={isSaving}>
|
<Button variant="ghost" onClick={onCancel} disabled={isSaving}>
|
||||||
Cancel
|
{t("common.cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Button onClick={onSave} disabled={!valid || isSaving}>
|
<Button onClick={onSave} disabled={!valid || isSaving}>
|
||||||
{isSaving ? "Saving..." : "Save"}
|
{isSaving ? t("editor.saving") : t("editor.save")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@
|
||||||
"add-your-comment-here": "Add your comment here...",
|
"add-your-comment-here": "Add your comment here...",
|
||||||
"any-thoughts": "Any thoughts...",
|
"any-thoughts": "Any thoughts...",
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
|
"saving": "Saving...",
|
||||||
"no-changes-detected": "No changes detected",
|
"no-changes-detected": "No changes detected",
|
||||||
"focus-mode": "Focus Mode",
|
"focus-mode": "Focus Mode",
|
||||||
"exit-focus-mode": "Exit Focus Mode",
|
"exit-focus-mode": "Exit Focus Mode",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue