Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: tweak i18n locales

Steven40a5503d452b
diff --git a/web/src/components/ChangeMemoCreatedTsDialog.tsx b/web/src/components/ChangeMemoCreatedTsDialog.tsx
index 3bc78ea75..6da85153a 100644
--- a/web/src/components/ChangeMemoCreatedTsDialog.tsx
+++ b/web/src/components/ChangeMemoCreatedTsDialog.tsx
@@ -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);
diff --git a/web/src/components/CreateMemoRelationDialog.tsx b/web/src/components/CreateMemoRelationDialog.tsx
index 0b2218d1e..576cf04ca 100644
--- a/web/src/components/CreateMemoRelationDialog.tsx
+++ b/web/src/components/CreateMemoRelationDialog.tsx
@@ -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}
diff --git a/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx b/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx
index d76263fe4..80f084244 100644
--- a/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx
+++ b/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx
@@ -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;
}
diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx
index 19edf9228..b8046c79f 100644
--- a/web/src/components/Settings/MemberSection.tsx
+++ b/web/src/components/Settings/MemberSection.tsx
@@ -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;
}
diff --git a/web/src/components/Settings/WorkspaceSection.tsx b/web/src/components/Settings/WorkspaceSection.tsx
index fc6822f60..fdb86c0ad 100644
--- a/web/src/components/Settings/WorkspaceSection.tsx
+++ b/web/src/components/Settings/WorkspaceSection.tsx
@@ -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) => {
diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx
index 9fd55753c..19060b9fc 100644
--- a/web/src/components/ShareMemoDialog.tsx
+++ b/web/src/components/ShareMemoDialog.tsx
@@ -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) => {
diff --git a/web/src/components/UpdateCustomizedProfileDialog.tsx b/web/src/components/UpdateCustomizedProfileDialog.tsx
index 7ba48fa1e..2ca086241 100644
--- a/web/src/components/UpdateCustomizedProfileDialog.tsx
+++ b/web/src/components/UpdateCustomizedProfileDialog.tsx
@@ -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();
};
diff --git a/web/src/locales/en.json b/web/src/locales/en.json
index 710c236c8..323a630ec 100644
--- a/web/src/locales/en.json
+++ b/web/src/locales/en.json
@@ -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",
diff --git a/web/src/pages/SignIn.tsx b/web/src/pages/SignIn.tsx
index 551d65447..ab417e3ce 100644
--- a/web/src/pages/SignIn.tsx
+++ b/web/src/pages/SignIn.tsx
@@ -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();
};
diff --git a/web/src/pages/SignUp.tsx b/web/src/pages/SignUp.tsx
index 90e83678b..5cdbfadc3 100644
--- a/web/src/pages/SignUp.tsx
+++ b/web/src/pages/SignUp.tsx
@@ -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();
};