chore: tweak i18n locales

This commit is contained in:
Steven 2024-05-08 21:33:49 +08:00
parent 16670b6b8d
commit 40a5503d45
10 changed files with 13 additions and 55 deletions

View File

@ -48,7 +48,7 @@ const ChangeMemoCreatedTsDialog: React.FC<Props> = (props: Props) => {
},
["created_ts"],
);
toast.success(t("message.memo-updated-datetime"));
toast.success("Updated memo created time successfully.");
handleCloseBtnClick();
} catch (error: any) {
console.error(error);

View File

@ -96,7 +96,7 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
size="md"
clearOnBlur
disableClearable
placeholder={t("reference.search-bar-placeholder")}
placeholder={t("reference.search-placeholder")}
noOptionsText={t("reference.no-memos-found")}
options={filteredMemos}
loading={isFetching}

View File

@ -5,7 +5,6 @@ import toast from "react-hot-toast";
import showCreateMemoRelationDialog from "@/components/CreateMemoRelationDialog";
import Icon from "@/components/Icon";
import { MemoRelation_Type } from "@/types/proto/api/v1/memo_relation_service";
import { useTranslate } from "@/utils/i18n";
import { EditorRefActions } from "../Editor";
import { MemoEditorContext } from "../types";
@ -16,7 +15,6 @@ interface Props {
const AddMemoRelationButton = (props: Props) => {
const { editorRef } = props;
const context = useContext(MemoEditorContext);
const t = useTranslate();
const handleAddMemoRelationBtnClick = () => {
showCreateMemoRelationDialog({
@ -24,7 +22,7 @@ const AddMemoRelationButton = (props: Props) => {
// If embedded mode is enabled, embed the memo instead of creating a relation.
if (embedded) {
if (!editorRef.current) {
toast.error(t("message.failed-to-embed-memo"));
toast.error("Failed to embed memo");
return;
}

View File

@ -71,7 +71,7 @@ const MemberSection = () => {
const handleCreateUserBtnClick = async () => {
if (state.creatingUser.username === "" || state.creatingUser.password === "") {
toast.error(t("message.fill-form"));
toast.error(t("message.fill-all"));
return;
}

View File

@ -103,7 +103,7 @@ const WorkspaceSection = () => {
console.error(error);
return;
}
toast.success(t("message.succeed-update-additional-style"));
toast.success(t("message.update-succeed"));
};
const handleAdditionalScriptChanged = (value: string) => {
@ -123,7 +123,7 @@ const WorkspaceSection = () => {
console.error(error);
return;
}
toast.success(t("message.succeed-update-additional-script"));
toast.success(t("message.update-succeed"));
};
const handleDisablePublicMemosChanged = async (value: boolean) => {

View File

@ -75,11 +75,7 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
const handleCopyLinkBtnClick = () => {
copy(`${window.location.origin}/m/${memo.uid}`);
if (memo.visibility !== Visibility.PUBLIC) {
toast.success(t("message.succeed-copy-link-not-public"));
} else {
toast.success(t("message.succeed-copy-link"));
}
toast.success(t("message.succeed-copy-link"));
};
const handleMemoVisibilityOptionChanged = async (visibility: Visibility) => {

View File

@ -78,7 +78,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
const handleSaveButtonClick = async () => {
if (customProfile.title === "") {
toast.error(t("message.fill-server-name"));
toast.error("Title cannot be empty.");
return;
}
@ -94,7 +94,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
console.error(error);
return;
}
toast.success(t("message.succeed-update-customized-profile"));
toast.success(t("message.update-succeed"));
destroy();
};

View File

@ -89,19 +89,12 @@
"any-thoughts": "Any thoughts...",
"save": "Save"
},
"embed-memo": {
"copy": "Copy",
"only-public-supported": "* Only public memos can be embedded.",
"text": "Copy and paste the below code into your blog or website.",
"title": "Embed Memo"
},
"inbox": {
"memo-comment": "{{user}} has a comment on your {{memo}}.",
"version-update": "New version {{version}} is available now!"
},
"memo": {
"archived-at": "Archived at",
"archived-memos": "Archived Memos",
"comment": {
"no-comment": "No comment",
"self": "Comments"
@ -128,42 +121,17 @@
"message": {
"archived-successfully": "Archived successfully",
"change-memo-created-time": "Change memo created time",
"change-resource-filename": "Change resource filename",
"click-to-save-the-image": "Click to save the image",
"copied": "Copied",
"count-selected-resources": "Total selected",
"deleted-successfully": "Deleted successfully",
"failed-to-embed-memo": "Failed to embed memo",
"fill-all": "Please fill in all fields.",
"fill-form": "Please fill out this form",
"fill-server-name": "Please fill in the server name",
"generating-the-screenshot": "Generating the screenshot…",
"image-load-failed": "Image load failed",
"invalid-created-datetime": "Invalid created datetime.",
"invalid-resource-filename": "Invalid filename.",
"login-failed": "Login failed",
"maximum-upload-size-is": "Maximum allowed upload size is {{size}} MiB",
"memo-not-found": "Memo not found.",
"memo-updated-datetime": "Memo created datetime changed.",
"memos-ready": "all memos are ready",
"new-password-not-match": "New passwords do not match.",
"no-data": "No data found.",
"password-changed": "Password Changed",
"password-not-match": "Passwords do not match.",
"private-only": "This memo is set to private.",
"resource-filename-updated": "Resource filename changed.",
"resource-ready": "all resource are ready",
"restored-successfully": "Restored successfully",
"signup-failed": "Signup failed",
"succeed-copy-code": "Code copied successfully.",
"succeed-copy-content": "Content copied successfully.",
"succeed-copy-link": "Link copied successfully.",
"succeed-copy-link-not-public": "Content copied successfully. This memo is not accessible without logging in.",
"succeed-copy-resource-link": "Resource link copied successfully.",
"succeed-update-additional-script": "Additional script updated successfully.",
"succeed-update-additional-style": "Additional style updated successfully.",
"succeed-update-customized-profile": "Profile successfully customized.",
"succeed-vacuum-database": "Successfully vacuumed database.",
"update-succeed": "Update succeeded",
"user-not-found": "User not found"
},
@ -171,7 +139,7 @@
"add-references": "Add references",
"embedded-usage": "Use as Embedded Content",
"no-memos-found": "No memos found",
"search-bar-placeholder": "Search content"
"search-placeholder": "Search content"
},
"resource": {
"clear": "Clear",
@ -203,11 +171,7 @@
"no-unused-resources": "No unused resources",
"reset-link": "Reset Link",
"reset-link-prompt": "Are you sure to reset the link? This will break all current link usages. THIS ACTION IS IRREVERSIBLE",
"reset-resource-link": "Reset Resource Link",
"search-bar-placeholder": "Search resource",
"upload-successfully": "Upload successfully",
"warning-text": "Are you sure to delete this resource? THIS ACTION IS IRREVERSIBLE",
"warning-text-unused": "Are you sure to delete these unused resources? THIS ACTION IS IRREVERSIBLE"
"reset-resource-link": "Reset Resource Link"
},
"router": {
"back-to-top": "Back to Top",

View File

@ -85,7 +85,7 @@ const SignIn = () => {
navigateTo("/");
} catch (error: any) {
console.error(error);
toast.error((error as ClientError).details || t("message.login-failed"));
toast.error((error as ClientError).details || "Failed to sign in.");
}
actionBtnLoadingState.setFinish();
};

View File

@ -66,7 +66,7 @@ const SignUp = () => {
navigateTo("/");
} catch (error: any) {
console.error(error);
toast.error((error as ClientError).details || t("message.signup-failed"));
toast.error((error as ClientError).details || "Sign up failed");
}
actionBtnLoadingState.setFinish();
};