chore: tweak i18n

This commit is contained in:
Steven 2024-02-21 23:02:18 +08:00
parent e7bbd850b2
commit 4378816e44
26 changed files with 52 additions and 65 deletions

View File

@ -62,7 +62,7 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
const handleSaveBtnClick = async () => { const handleSaveBtnClick = async () => {
if (!validateTagName(tagName)) { if (!validateTagName(tagName)) {
toast.error(t("tag-list.invalid-tag-name")); toast.error(t("tag.invalid-tag-name"));
return; return;
} }
@ -90,7 +90,7 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
return ( return (
<> <>
<div className="dialog-header-container"> <div className="dialog-header-container">
<p className="title-text">{t("tag-list.create-tag")}</p> <p className="title-text">{t("tag.create-tag")}</p>
<IconButton size="sm" onClick={() => destroy()}> <IconButton size="sm" onClick={() => destroy()}>
<Icon.X className="w-5 h-auto" /> <Icon.X className="w-5 h-auto" />
</IconButton> </IconButton>
@ -99,7 +99,7 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
<Input <Input
className="mb-2" className="mb-2"
size="md" size="md"
placeholder={t("tag-list.tag-name")} placeholder={t("tag.tag-name")}
value={tagName} value={tagName}
onChange={handleTagNameChanged} onChange={handleTagNameChanged}
onKeyDown={handleTagNameInputKeyDown} onKeyDown={handleTagNameInputKeyDown}
@ -109,7 +109,7 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
/> />
{tagNameList.length > 0 && ( {tagNameList.length > 0 && (
<> <>
<p className="w-full mt-2 mb-1 text-sm text-gray-400">{t("tag-list.all-tags")}</p> <p className="w-full mt-2 mb-1 text-sm text-gray-400">{t("tag.all-tags")}</p>
<div className="w-full flex flex-row justify-start items-start flex-wrap"> <div className="w-full flex flex-row justify-start items-start flex-wrap">
{Array.from(tagNameList) {Array.from(tagNameList)
.sort() .sort()
@ -130,12 +130,12 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
{shownSuggestTagNameList.length > 0 && ( {shownSuggestTagNameList.length > 0 && (
<> <>
<div className="mt-4 mb-1 text-sm w-full flex flex-row justify-start items-center"> <div className="mt-4 mb-1 text-sm w-full flex flex-row justify-start items-center">
<span className="text-gray-400 mr-2">{t("tag-list.tag-suggestions")}</span> <span className="text-gray-400 mr-2">{t("tag.tag-suggestions")}</span>
<span <span
className="text-xs border border-gray-200 rounded-md px-1 leading-5 cursor-pointer text-gray-600 hover:shadow dark:border-zinc-700 dark:text-gray-400" className="text-xs border border-gray-200 rounded-md px-1 leading-5 cursor-pointer text-gray-600 hover:shadow dark:border-zinc-700 dark:text-gray-400"
onClick={handleToggleShowSuggestionTags} onClick={handleToggleShowSuggestionTags}
> >
{showTagSuggestions ? t("tag-list.hide") : t("tag-list.show")} {showTagSuggestions ? t("tag.hide") : t("tag.show")}
</span> </span>
</div> </div>
{showTagSuggestions && ( {showTagSuggestions && (
@ -153,7 +153,7 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
))} ))}
</div> </div>
<Button size="sm" variant="outlined" onClick={handleSaveSuggestTagList}> <Button size="sm" variant="outlined" onClick={handleSaveSuggestTagList}>
{t("tag-list.save-all")} {t("tag.save-all")}
</Button> </Button>
</> </>
)} )}

View File

@ -45,7 +45,7 @@ const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
handleCloseBtnClick(); handleCloseBtnClick();
} catch (error: any) { } catch (error: any) {
console.error(error); console.error(error);
toast.error(error.response.data.message || t("message.updating-setting-failed")); toast.error(error.response.data.message);
} }
} }
}; };

View File

@ -6,7 +6,11 @@ import Icon from "../Icon";
import MermaidBlock from "./MermaidBlock"; import MermaidBlock from "./MermaidBlock";
import { BaseProps } from "./types"; import { BaseProps } from "./types";
const MERMAID_LANGUAGE = "mermaid"; // Special languages that are rendered differently.
enum SpecialLanguage {
HTML = "__html",
MERMAID = "mermaid",
}
interface Props extends BaseProps { interface Props extends BaseProps {
language: string; language: string;
@ -15,17 +19,14 @@ interface Props extends BaseProps {
const CodeBlock: React.FC<Props> = ({ language, content }: Props) => { const CodeBlock: React.FC<Props> = ({ language, content }: Props) => {
const formatedLanguage = (language || "").toLowerCase() || "text"; const formatedLanguage = (language || "").toLowerCase() || "text";
let highlightedCode = content;
// Users can set Markdown code blocks as `__html` to render HTML directly. // Users can set Markdown code blocks as `__html` to render HTML directly.
if (formatedLanguage === "__html") { if (formatedLanguage === SpecialLanguage.HTML) {
return <div className="w-full overflow-auto !my-2" dangerouslySetInnerHTML={{ __html: content }} />; return <div className="w-full overflow-auto !my-2" dangerouslySetInnerHTML={{ __html: content }} />;
} } else if (formatedLanguage === SpecialLanguage.MERMAID) {
if (formatedLanguage === MERMAID_LANGUAGE) {
return <MermaidBlock content={content} />; return <MermaidBlock content={content} />;
} }
let highlightedCode = content;
try { try {
const temp = hljs.highlight(content, { const temp = hljs.highlight(content, {
language: formatedLanguage, language: formatedLanguage,

View File

@ -92,7 +92,7 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
); );
if (updatedMemo.visibility == visibility) { if (updatedMemo.visibility == visibility) {
toast.success(t("common.changed")); toast.success(t("message.update-succeed"));
} }
}; };

View File

@ -166,7 +166,7 @@
"storage": "المساحة التخزينية", "storage": "المساحة التخزينية",
"system": "النظام" "system": "النظام"
}, },
"tag-list": { "tag": {
"all-tags": "جميع العلامات", "all-tags": "جميع العلامات",
"create-tag": "انشاء علامة", "create-tag": "انشاء علامة",
"hide": "اخفاء", "hide": "اخفاء",

View File

@ -351,7 +351,7 @@
"telegram-bot-token-placeholder": "Dein Telegram Bot token" "telegram-bot-token-placeholder": "Dein Telegram Bot token"
} }
}, },
"tag-list": { "tag": {
"all-tags": "Alle Tags", "all-tags": "Alle Tags",
"create-tag": "Tag erstellen", "create-tag": "Tag erstellen",
"hide": "Ausblenden", "hide": "Ausblenden",

View File

@ -40,16 +40,11 @@
"type": "Type", "type": "Type",
"title": "Title", "title": "Title",
"filter": "Filter", "filter": "Filter",
"filter-period": "{{from}} to {{to}}",
"tags": "Tags", "tags": "Tags",
"yourself": "Yourself", "yourself": "Yourself",
"changed": "changed",
"fold": "Fold",
"expand": "Expand",
"image": "Image", "image": "Image",
"file": "File", "file": "File",
"link": "Link", "link": "Link",
"vacuum": "Vacuum",
"select": "Select", "select": "Select",
"database": "Database", "database": "Database",
"upload": "Upload", "upload": "Upload",
@ -84,10 +79,7 @@
"cancel-edit": "Cancel edit", "cancel-edit": "Cancel edit",
"save": "Save", "save": "Save",
"placeholder": "Any thoughts...", "placeholder": "Any thoughts...",
"only-image-supported": "Only image file supported.", "local": "Local"
"cant-empty": "Content can't be empty",
"local": "Local",
"resources": "Resources"
}, },
"memo": { "memo": {
"view-detail": "View Detail", "view-detail": "View Detail",
@ -106,7 +98,7 @@
"disabled": "Public memos are disabled" "disabled": "Public memos are disabled"
}, },
"delete-memo": "Delete Memo", "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? THIS ACTION IS IRREVERSIBLE",
"comment": { "comment": {
"self": "Comments", "self": "Comments",
"no-comment": "No comment" "no-comment": "No comment"
@ -118,11 +110,11 @@
"copy-link": "Copy Link", "copy-link": "Copy Link",
"reset-link": "Reset Link", "reset-link": "Reset Link",
"reset-resource-link": "Reset Resource 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? This will break all current link usages. THIS ACTION IS IRREVERSIBLE",
"delete-resource": "Delete Resource", "delete-resource": "Delete Resource",
"linked-amount": "Linked amount", "linked-amount": "Linked amount",
"warning-text": "Are you sure to delete this resource?\n\nTHIS ACTION IS IRREVERSIBLE", "warning-text": "Are you sure to delete this resource? THIS ACTION IS IRREVERSIBLE",
"warning-text-unused": "Are you sure to delete these unused resources?\n\nTHIS ACTION IS IRREVERSIBLE", "warning-text-unused": "Are you sure to delete these unused resources? THIS ACTION IS IRREVERSIBLE",
"no-unused-resources": "No unused resources", "no-unused-resources": "No unused resources",
"delete-selected-resources": "Delete Selected Resources", "delete-selected-resources": "Delete Selected Resources",
"no-files-selected": "No files selected", "no-files-selected": "No files selected",
@ -148,7 +140,7 @@
} }
} }
}, },
"tag-list": { "tag": {
"tip-text": "Input `#tag` to create", "tip-text": "Input `#tag` to create",
"create-tag": "Create Tag", "create-tag": "Create Tag",
"all-tags": "All Tags", "all-tags": "All Tags",
@ -206,7 +198,7 @@
"storage-services": "Storage services", "storage-services": "Storage services",
"create-a-service": "Create a service", "create-a-service": "Create a service",
"update-a-service": "Update 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}}\"? THIS ACTION IS IRREVERSIBLE",
"delete-storage": "Delete Storage", "delete-storage": "Delete Storage",
"local-storage-path": "Local storage path", "local-storage-path": "Local storage path",
"update-local-path": "Update Local Storage Path", "update-local-path": "Update Local Storage Path",
@ -237,7 +229,7 @@
"archive-member": "Archive 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-member": "Delete Member",
"delete-warning": "Are you sure to delete {{username}}?\n\nTHIS ACTION IS IRREVERSIBLE" "delete-warning": "Are you sure to delete {{username}}? THIS ACTION IS IRREVERSIBLE"
}, },
"system-section": { "system-section": {
"server-name": "Server Name", "server-name": "Server Name",
@ -276,7 +268,7 @@
"sso-section": { "sso-section": {
"sso-list": "SSO List", "sso-list": "SSO List",
"delete-sso": "Confirm delete", "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? THIS ACTION IS IRREVERSIBLE",
"create-sso": "Create SSO", "create-sso": "Create SSO",
"update-sso": "Update SSO", "update-sso": "Update SSO",
"sso-created": "SSO {{name}} created", "sso-created": "SSO {{name}} created",
@ -326,7 +318,6 @@
"about-memos": "About memos", "about-memos": "About memos",
"memos-description": "memos is a web-based note-taking application that you can use to write, organize, and share notes.", "memos-description": "memos is a web-based note-taking application that you can use to write, organize, and share notes.",
"no-server-description": "No description configured for this server.", "no-server-description": "No description configured for this server.",
"powered-by": "Powered by",
"other-projects": "Other Projects" "other-projects": "Other Projects"
}, },
"message": { "message": {
@ -366,11 +357,7 @@
"succeed-update-customized-profile": "Profile successfully customized.", "succeed-update-customized-profile": "Profile successfully customized.",
"succeed-update-additional-script": "Additional script updated successfully.", "succeed-update-additional-script": "Additional script updated successfully.",
"update-succeed": "Update succeeded", "update-succeed": "Update succeeded",
"page-not-found": "404 - Page Not Found", "maximum-upload-size-is": "Maximum allowed upload size is {{size}} MiB"
"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",
"password-login-disabled": "Can't remove last identity provider when password login is disabled"
}, },
"inbox": { "inbox": {
"memo-comment": "{{user}} has a comment on your {{memo}}.", "memo-comment": "{{user}} has a comment on your {{memo}}.",

View File

@ -80,7 +80,7 @@
"disabled": "Las notas públicas están deshabilitadas" "disabled": "Las notas públicas están deshabilitadas"
} }
}, },
"tag-list": { "tag": {
"tip-text": "Escribe '#etiqueta' para crearlo" "tip-text": "Escribe '#etiqueta' para crearlo"
}, },
"setting": { "setting": {

View File

@ -360,7 +360,7 @@
"telegram-bot-token-placeholder": "Votre jeton de Bot Telegram" "telegram-bot-token-placeholder": "Votre jeton de Bot Telegram"
} }
}, },
"tag-list": { "tag": {
"all-tags": "Toutes les Étiquettes", "all-tags": "Toutes les Étiquettes",
"create-tag": "Créer une Étiquette", "create-tag": "Créer une Étiquette",
"hide": "Cacher", "hide": "Cacher",

View File

@ -262,7 +262,7 @@
}, },
"system": "सिस्टम" "system": "सिस्टम"
}, },
"tag-list": { "tag": {
"all-tags": "सभी टैग", "all-tags": "सभी टैग",
"create-tag": "टैग बनाएँ", "create-tag": "टैग बनाएँ",
"tag-name": "टैग_नाम", "tag-name": "टैग_नाम",

View File

@ -354,7 +354,7 @@
"telegram-bot-token-placeholder": "Tvoj Telegram Bot token" "telegram-bot-token-placeholder": "Tvoj Telegram Bot token"
} }
}, },
"tag-list": { "tag": {
"all-tags": "Svi Tagovi", "all-tags": "Svi Tagovi",
"create-tag": "Stvori Tag", "create-tag": "Stvori Tag",
"hide": "Sakrij", "hide": "Sakrij",

View File

@ -248,7 +248,7 @@
"telegram-bot-token-placeholder": "Telegram bot tokened" "telegram-bot-token-placeholder": "Telegram bot tokened"
} }
}, },
"tag-list": { "tag": {
"all-tags": "Minden címke", "all-tags": "Minden címke",
"create-tag": "Címke létrehozása", "create-tag": "Címke létrehozása",
"hide": "Elrejt", "hide": "Elrejt",

View File

@ -341,7 +341,7 @@
"telegram-bot-token-placeholder": "Il token del tuo bot Telegram" "telegram-bot-token-placeholder": "Il token del tuo bot Telegram"
} }
}, },
"tag-list": { "tag": {
"all-tags": "Tutti i Tags", "all-tags": "Tutti i Tags",
"create-tag": "Crea Tag", "create-tag": "Crea Tag",
"invalid-tag-name": "Nome tag non valido", "invalid-tag-name": "Nome tag non valido",

View File

@ -148,7 +148,7 @@
} }
} }
}, },
"tag-list": { "tag": {
"tip-text": "作成するには`#tag`のように入力してください", "tip-text": "作成するには`#tag`のように入力してください",
"create-tag": "タグを作成する", "create-tag": "タグを作成する",
"all-tags": "すべてのタグ", "all-tags": "すべてのタグ",

View File

@ -351,7 +351,7 @@
"telegram-bot-token-placeholder": "서버의 텔레그램 봇 토큰" "telegram-bot-token-placeholder": "서버의 텔레그램 봇 토큰"
} }
}, },
"tag-list": { "tag": {
"all-tags": "모든 태그", "all-tags": "모든 태그",
"create-tag": "태그 생성", "create-tag": "태그 생성",
"hide": "숨기기", "hide": "숨기기",

View File

@ -116,7 +116,7 @@
}, },
"no-archived-memos": "Geen gearchiveerde memos." "no-archived-memos": "Geen gearchiveerde memos."
}, },
"tag-list": { "tag": {
"tip-text": "Typ `#label` om aan te maken", "tip-text": "Typ `#label` om aan te maken",
"create-tag": "Label maken", "create-tag": "Label maken",
"all-tags": "Alle labels", "all-tags": "Alle labels",

View File

@ -227,7 +227,7 @@
"server-name": "Nazwa serwera" "server-name": "Nazwa serwera"
} }
}, },
"tag-list": { "tag": {
"tip-text": "Wprowadź `#tag` aby utworzyć" "tip-text": "Wprowadź `#tag` aby utworzyć"
} }
} }

View File

@ -361,7 +361,7 @@
"vacuum-hint": "Limpa dados não utilizados." "vacuum-hint": "Limpa dados não utilizados."
} }
}, },
"tag-list": { "tag": {
"all-tags": "Todas as Tags", "all-tags": "Todas as Tags",
"create-tag": "Criar Tag", "create-tag": "Criar Tag",
"hide": "Ocultar", "hide": "Ocultar",

View File

@ -333,7 +333,7 @@
"telegram-bot-token-placeholder": "Ваш токен Telegram бота" "telegram-bot-token-placeholder": "Ваш токен Telegram бота"
} }
}, },
"tag-list": { "tag": {
"all-tags": "Все теги", "all-tags": "Все теги",
"create-tag": "Создать тег", "create-tag": "Создать тег",
"tag-name": "Тег", "tag-name": "Тег",

View File

@ -104,7 +104,7 @@
"disabled": "Javne beležke so onemogočene" "disabled": "Javne beležke so onemogočene"
} }
}, },
"tag-list": { "tag": {
"tip-text": "Vnesite `#značka` za izdalavo", "tip-text": "Vnesite `#značka` za izdalavo",
"create-tag": "Kreiraj značko", "create-tag": "Kreiraj značko",
"all-tags": "Vse značke", "all-tags": "Vse značke",

View File

@ -78,7 +78,7 @@
"disabled": "Offentliga anteckningar är inaktiverade" "disabled": "Offentliga anteckningar är inaktiverade"
} }
}, },
"tag-list": { "tag": {
"tip-text": "Ange `#tag ` för att skapa" "tip-text": "Ange `#tag ` för att skapa"
}, },
"setting": { "setting": {

View File

@ -69,7 +69,7 @@
"disabled": "Halka açık notlar devre dışı bırakıldı" "disabled": "Halka açık notlar devre dışı bırakıldı"
} }
}, },
"tag-list": { "tag": {
"tip-text": "Oluşturmak için #etiket girin" "tip-text": "Oluşturmak için #etiket girin"
}, },
"setting": { "setting": {

View File

@ -78,7 +78,7 @@
"disabled": "Public memos are disabled" "disabled": "Public memos are disabled"
} }
}, },
"tag-list": { "tag": {
"tip-text": "Введіть `#tag` щоб створити" "tip-text": "Введіть `#tag` щоб створити"
}, },
"setting": { "setting": {

View File

@ -148,7 +148,7 @@
} }
} }
}, },
"tag-list": { "tag": {
"tip-text": "Nhập `#tag` để tạo mới", "tip-text": "Nhập `#tag` để tạo mới",
"create-tag": "Tạo thẻ", "create-tag": "Tạo thẻ",
"all-tags": "Tất cả thẻ", "all-tags": "Tất cả thẻ",
@ -377,4 +377,4 @@
"version-update": "Phiên bản mới {{version}} đã có sẵn!" "version-update": "Phiên bản mới {{version}} đã có sẵn!"
} }
} }
} }

View File

@ -3,8 +3,7 @@
"about-memos": "关于 Memos", "about-memos": "关于 Memos",
"memos-description": "Memos 是一个基于网页的笔记应用程序,您可以使用它来编写、组织和共享笔记。", "memos-description": "Memos 是一个基于网页的笔记应用程序,您可以使用它来编写、组织和共享笔记。",
"no-server-description": "没有为此服务器配置描述。", "no-server-description": "没有为此服务器配置描述。",
"other-projects": "其他的项目", "other-projects": "其他的项目"
"powered-by": "Powered by"
}, },
"amount-text": { "amount-text": {
"memo": "MEMO" "memo": "MEMO"
@ -101,7 +100,7 @@
"editing": "编辑中...", "editing": "编辑中...",
"local": "本地", "local": "本地",
"only-image-supported": "仅支持图片文件。", "only-image-supported": "仅支持图片文件。",
"placeholder": "任何想法...", "placeholder": "此刻的想法...",
"resources": "资源库", "resources": "资源库",
"save": "保存" "save": "保存"
}, },
@ -127,7 +126,7 @@
"self": "评论" "self": "评论"
}, },
"copy-link": "复制链接", "copy-link": "复制链接",
"delete-confirm": "您确定要删除此备忘录吗?\n\n此操作不可逆", "delete-confirm": "您确定要删除此备忘录吗?此操作不可逆",
"delete-memo": "删除备忘录", "delete-memo": "删除备忘录",
"embed": "嵌入", "embed": "嵌入",
"fetch-more": "点击此处获取更多", "fetch-more": "点击此处获取更多",
@ -357,7 +356,7 @@
"telegram-bot-token-placeholder": "您的 Telegram 机器人 Token" "telegram-bot-token-placeholder": "您的 Telegram 机器人 Token"
} }
}, },
"tag-list": { "tag": {
"all-tags": "全部标签", "all-tags": "全部标签",
"create-tag": "创建标签", "create-tag": "创建标签",
"hide": "收起", "hide": "收起",

View File

@ -360,7 +360,7 @@
"vacuum-hint": "清理未使用的資料" "vacuum-hint": "清理未使用的資料"
} }
}, },
"tag-list": { "tag": {
"all-tags": "所有標籤", "all-tags": "所有標籤",
"create-tag": "建立標籤", "create-tag": "建立標籤",
"hide": "隱藏", "hide": "隱藏",