chore: update i18n

This commit is contained in:
Steven 2023-10-05 15:07:03 +08:00
parent fd7043ea40
commit 42e8d51550
7 changed files with 51 additions and 58 deletions

View File

@ -291,14 +291,18 @@ const Memo: React.FC<Props> = (props: Props) => {
{creator && (
<>
<Link className="flex flex-row justify-start items-center" to={`/m/${memo.id}`}>
<Tooltip title={"The identifier of memo"} placement="top">
<Tooltip title={"Identifier"} placement="top">
<span className="text-sm text-gray-500 dark:text-gray-400">#{memo.id}</span>
</Tooltip>
</Link>
<Icon.Dot className="w-4 h-auto text-gray-400 dark:text-zinc-400" />
<Link className="flex flex-row justify-start items-center" to={`/u/${encodeURIComponent(memo.creatorUsername)}`}>
<UserAvatar className="!w-5 !h-auto mr-1" avatarUrl={creator.avatarUrl} />
<span className="text-sm text-gray-600 max-w-[8em] truncate dark:text-gray-400">{creator.nickname}</span>
<Link to={`/u/${encodeURIComponent(memo.creatorUsername)}`}>
<Tooltip title={"Creator"} placement="top">
<span className="flex flex-row justify-start items-center">
<UserAvatar className="!w-5 !h-auto mr-1" avatarUrl={creator.avatarUrl} />
<span className="text-sm text-gray-600 max-w-[8em] truncate dark:text-gray-400">{creator.nickname}</span>
</span>
</Tooltip>
</Link>
{memo.pinned && (
<>
@ -308,10 +312,10 @@ const Memo: React.FC<Props> = (props: Props) => {
</Tooltip>
</>
)}
{props.showVisibility && (
{props.showVisibility && memo.visibility !== "PRIVATE" && (
<>
<Icon.Dot className="w-4 h-auto text-gray-400 dark:text-zinc-400" />
<Tooltip title={"The visibility of memo"} placement="top">
<Tooltip title={t(`memo.visibility.${memo.visibility.toLowerCase()}` as any)} placement="top">
<span>
<VisibilityIcon visibility={memo.visibility} />
</span>

View File

@ -25,7 +25,7 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
return (
<>
<div className="dialog-header-container">
<p className="title-text flex items-center">{t("amount-text.memo_one")}</p>
<p className="title-text flex items-center">{t("amount-text.memo")}</p>
<button className="btn close-btn" onClick={handleCloseBtnClick}>
<Icon.X />
</button>

View File

@ -50,7 +50,7 @@ const PreferencesSection = () => {
const handleSaveTelegramUserId = async () => {
try {
await userStore.upsertUserSetting("telegram-user-id", telegramUserId);
toast.success(t("common.dialog.success"));
toast.success(t("message.update-succeed"));
} catch (error: any) {
console.error(error);
toast.error(error.response.data.message);

View File

@ -1,6 +1,5 @@
{
"common": {
"memos-slogan": "A lightweight, self-hosted memo hub. Open Source and Free forever.",
"about": "About",
"home": "Home",
"resources": "Resources",
@ -61,14 +60,7 @@
"beta": "Beta",
"new": "New",
"mark": "Mark",
"profile": "Profile",
"dialog": {
"error": "Error",
"help": "Help",
"info": "Information",
"success": "Success",
"warning": "Warning"
}
"profile": "Profile"
},
"router": {
"go-to-home": "Go to Home",
@ -88,7 +80,7 @@
"save": "Save",
"placeholder": "Any thoughts...",
"only-image-supported": "Only image file supported.",
"cant-empty": "Content cant be empty",
"cant-empty": "Content can't be empty",
"local": "Local",
"resources": "Resources"
},
@ -104,12 +96,16 @@
"search-placeholder": "Search memos",
"visibility": {
"private": "Private",
"protected": "Visible to members",
"public": "Public to everyone",
"protected": "Workspace",
"public": "Public",
"disabled": "Public memos are disabled"
},
"delete-memo": "Delete Memo",
"delete-confirm": "Are you sure you want to delete this memo?\n\nTHIS ACTION IS IRREVERSIBLE❗"
"delete-confirm": "Are you sure you want to delete this memo?\n\nTHIS ACTION IS IRREVERSIBLE",
"comment": {
"self": "Comments",
"no-comment": "No comment"
}
},
"resource": {
"no-resources": "No resources.",
@ -117,14 +113,14 @@
"copy-link": "Copy Link",
"reset-link": "Reset Link",
"reset-resource-link": "Reset Resource Link",
"reset-link-prompt": "Are you sure to reset the link?\nThis will break all current link usages.\n\nTHIS ACTION IS IRREVERSIBLE",
"reset-link-prompt": "Are you sure to reset the link?\nThis will break all current link usages.\n\nTHIS ACTION IS IRREVERSIBLE",
"delete-resource": "Delete Resource",
"linked-amount": "Linked amount",
"warning-text": "Are you sure to delete this resource?\n\nTHIS ACTION IS IRREVERSIBLE",
"warning-text-unused": "Are you sure to delete these unused resources?\n\nTHIS ACTION IS IRREVERSIBLE",
"warning-text": "Are you sure to delete this resource?\n\nTHIS ACTION IS IRREVERSIBLE",
"warning-text-unused": "Are you sure to delete these unused resources?\n\nTHIS ACTION IS IRREVERSIBLE",
"no-unused-resources": "No unused resources",
"delete-selected-resources": "Delete Selected Resources",
"no-files-selected": "No files selected",
"no-files-selected": "No files selected",
"upload-successfully": "Upload successfully",
"file-drag-drop-prompt": "Drag and drop your file here to upload file",
"search-bar-placeholder": "Search resource",
@ -180,7 +176,7 @@
"reset-api": "Reset API",
"openapi-title": "OpenAPI",
"openapi-reset": "Reset OpenAPI Key",
"openapi-reset-warning": " The existing API will be invalidated and a new one will be generated.\n\nAre you sure you want to reset?",
"openapi-reset-warning": " The existing API will be invalidated and a new one will be generated.\n\nAre you sure you want to reset?",
"openapi-sample-post": "Hello #memos from {{url}}"
},
"preference-section": {
@ -206,7 +202,7 @@
"storage-services-list": "Storage service list",
"create-a-service": "Create a service",
"update-a-service": "Update a service",
"warning-text": "Are you sure to delete storage service \"{{name}}\"?\n\nTHIS ACTION IS IRREVERSIBLE",
"warning-text": "Are you sure to delete storage service \"{{name}}\"?\n\nTHIS ACTION IS IRREVERSIBLE",
"delete-storage": "Delete Storage",
"local-storage-path": "Local storage path",
"update-local-path": "Update Local Storage Path",
@ -234,9 +230,9 @@
"member-section": {
"create-a-member": "Create a member",
"archive-member": "Archive member",
"archive-warning": "Are you sure to archive {{username}}?",
"archive-warning": "Are you sure to archive {{username}}?",
"delete-member": "Delete Member",
"delete-warning": "Are you sure to delete {{username}}?\n\nTHIS ACTION IS IRREVERSIBLE"
"delete-warning": "Are you sure to delete {{username}}?\n\nTHIS ACTION IS IRREVERSIBLE"
},
"system-section": {
"server-name": "Server Name",
@ -251,10 +247,10 @@
"database-file-size": "Database File Size",
"allow-user-signup": "Allow user signup",
"disable-password-login": "Disable password login",
"disable-password-login-warning": "This will disable password login for all users. It is not possible to log in without reverting this setting in the database if your configured identity providers fail. Youll also have to be extra carefull when removing an identity provider",
"disable-password-login-warning": "This will disable password login for all users. It is not possible to log in without reverting this setting in the database if your configured identity providers fail. Youll also have to be extra carefull when removing an identity provider",
"disable-password-login-final-warning": "Please type \"CONFIRM\" if you know what you are doing.",
"enable-password-login": "Enable password login",
"enable-password-login-warning": "This will enable password login for all users. Continue only if you want to users to be able to log in using both SSO and password",
"enable-password-login-warning": "This will enable password login for all users. Continue only if you want to users to be able to log in using both SSO and password",
"ignore-version-upgrade": "Ignore version upgrade",
"disable-public-memos": "Disable public memos",
"max-upload-size": "Maximum upload size (MiB)",
@ -278,7 +274,7 @@
"sso-section": {
"sso-list": "SSO List",
"delete-sso": "Confirm delete",
"confirm-delete": "Are you sure to delete \"{{name}}\" SSO configuration?\n\nTHIS ACTION IS IRREVERSIBLE",
"confirm-delete": "Are you sure to delete \"{{name}}\" SSO configuration?\n\nTHIS ACTION IS IRREVERSIBLE",
"create-sso": "Create SSO",
"update-sso": "Update SSO",
"sso-created": "SSO {{name}} created",
@ -295,16 +291,11 @@
"token-endpoint": "Token endpoint",
"user-endpoint": "User endpoint",
"scopes": "Scopes",
"disabled-password-login-warning": "Password-login is disabled, be extra careful when removing identity providers"
"disabled-password-login-warning": "Password-login is disabled, be extra careful when removing identity providers"
}
},
"amount-text": {
"memo_one": "MEMO",
"memo_other": "MEMOS",
"tag_one": "TAG",
"tag_other": "TAGS",
"day_one": "TAG",
"day_other": "TAGE"
"memo": "MEMO"
},
"days": {
"mon": "Mon",
@ -338,8 +329,8 @@
},
"message": {
"no-data": "Maybe no data was found, or maybe it should be another option.",
"memos-ready": "all memos are ready 🎉",
"resource-ready": "all resource are ready 🎉",
"memos-ready": "all memos are ready",
"resource-ready": "all resource are ready",
"restored-successfully": "Restored successfully",
"memo-updated-datetime": "Memo created datetime changed.",
"invalid-created-datetime": "Invalid created datetime.",
@ -368,17 +359,13 @@
"click-to-save-the-image": "Click to save the image",
"generating-the-screenshot": "Generating the screenshot...",
"count-selected-resources": "Total selected",
"too-short": "Too short",
"too-long": "Too long",
"not-allow-space": "Dont allow space",
"not-allow-chinese": "Dont allow chinese",
"succeed-vacuum-database": "Successfully vacuumed database.",
"succeed-update-additional-style": "Additional style updated successfully.",
"succeed-copy-resource-link": "Resource link copied successfully.",
"succeed-update-customized-profile": "Profile successfully customized.",
"succeed-update-additional-script": "Additional script updated successfully.",
"update-succeed": "Update succeeded",
"page-not-found": "404 - Page Not Found 😥",
"page-not-found": "404 - Page Not Found",
"maximum-upload-size-is": "Maximum allowed upload size is {{size}} MiB",
"file-exceeds-upload-limit-of": "File {{file}} exceeds upload limit of {{size}} MiB",
"updating-setting-failed": "Updating setting failed",

View File

@ -127,13 +127,17 @@ const MemoDetail = () => {
<MemoRelationListView relationList={referenceRelations} />
<div className="w-full mt-4 flex flex-col sm:flex-row justify-start sm:justify-between sm:items-center gap-2">
<div className="flex flex-row justify-start items-center">
<Tooltip title={"The identifier of memo"} placement="top">
<Tooltip title={"Identifier"} placement="top">
<span className="text-sm text-gray-500 dark:text-gray-400">#{memo.id}</span>
</Tooltip>
<Icon.Dot className="w-4 h-auto text-gray-400 dark:text-zinc-400" />
<Link className="flex flex-row justify-start items-center" to={`/u/${encodeURIComponent(memo.creatorUsername)}`}>
<UserAvatar className="!w-5 !h-auto mr-1" avatarUrl={creator?.avatarUrl} />
<span className="text-sm text-gray-600 max-w-[8em] truncate dark:text-gray-400">{creator?.nickname}</span>
<Link to={`/u/${encodeURIComponent(memo.creatorUsername)}`}>
<Tooltip title={"Creator"} placement="top">
<span className="flex flex-row justify-start items-center">
<UserAvatar className="!w-5 !h-auto mr-1" avatarUrl={creator?.avatarUrl} />
<span className="text-sm text-gray-600 max-w-[8em] truncate dark:text-gray-400">{creator?.nickname}</span>
</span>
</Tooltip>
</Link>
{allowEdit && (
<>
@ -185,13 +189,13 @@ const MemoDetail = () => {
{comments.length === 0 ? (
<div className="w-full flex flex-col justify-center items-center py-6 mb-2">
<Icon.MessageCircle strokeWidth={1} className="w-8 h-auto text-gray-400" />
<p className="text-gray-400 italic text-sm">No comments</p>
<p className="text-gray-400 italic text-sm">{t("memo.comment.no-comment")}</p>
</div>
) : (
<>
<div className="w-full flex flex-row justify-start items-center pl-3 mb-3">
<Icon.MessageCircle className="w-5 h-auto text-gray-400 mr-1" />
<span className="text-gray-400 text-sm">Comments</span>
<span className="text-gray-400 text-sm">{t("memo.comment.self")}</span>
<span className="text-gray-400 text-sm ml-0.5">({comments.length})</span>
</div>
{comments.map((comment) => (

View File

@ -120,14 +120,14 @@ const Resources = () => {
<>
<Divider />
<div className="w-full flex flex-row justify-start items-start">
<div className="w-16 sm:w-24 pt-4 sm:pl-4 flex flex-col justify-start items-start"></div>
<div className="w-16 sm:w-24 sm:pl-4 flex flex-col justify-start items-start"></div>
<div className="w-full max-w-[calc(100%-4rem)] sm:max-w-[calc(100%-6rem)] flex flex-row justify-start items-start gap-4 flex-wrap">
<div className="w-full flex flex-row justify-start items-center gap-2">
<span className="text-gray-600 dark:text-gray-400">Unused resources</span>
<span className="text-gray-500 dark:text-gray-500 opacity-80">({unusedResources.length})</span>
<Tooltip title="Delete all" placement="top">
<IconButton size="sm" onClick={handleDeleteUnusedResources}>
<Icon.Trash className="w-4 h-auto" />
<Icon.Trash className="w-4 h-auto opacity-60" />
</IconButton>
</Tooltip>
</div>

View File

@ -46,10 +46,8 @@ const UserProfile = () => {
<div className="w-full flex flex-row justify-start items-start">
<div className="flex-grow shrink w-full">
<div className="w-full flex flex-col justify-start items-center py-8">
<UserAvatar className="!w-20 h-auto mb-4 drop-shadow" avatarUrl={user?.avatarUrl} />
<div>
<p className="text-2xl font-bold text-gray-700 dark:text-gray-300">{user?.nickname}</p>
</div>
<UserAvatar className="!w-20 h-auto mb-2 drop-shadow" avatarUrl={user?.avatarUrl} />
<p className="text-3xl text-black opacity-80 dark:text-gray-200">{user?.nickname}</p>
</div>
<div className="w-full h-auto flex flex-col justify-start items-start bg-zinc-100 dark:bg-zinc-800 rounded-lg">
<MemoFilter />