chore: fold/expand i18n (#400)

This commit is contained in:
winwin2011 2022-11-02 06:44:23 +08:00 committed by GitHub
parent d347b7a91e
commit 5bdf15aece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 7 deletions

View File

@ -1,4 +1,5 @@
import { useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { marked } from "../labs/marked";
import Icon from "./Icon";
import "../less/memo-content.less";
@ -29,6 +30,7 @@ const MAX_MEMO_CONTAINER_HEIGHT = 384;
const MemoContent: React.FC<Props> = (props: Props) => {
const { className, content, onMemoContentClick, onMemoContentDoubleClick } = props;
const { t } = useTranslation();
const [state, setState] = useState<State>({
expandButtonStatus: -1,
});
@ -84,7 +86,7 @@ const MemoContent: React.FC<Props> = (props: Props) => {
{state.expandButtonStatus !== -1 && (
<div className="expand-btn-container">
<span className={`btn ${state.expandButtonStatus === 0 ? "expand-btn" : "fold-btn"}`} onClick={handleExpandBtnClick}>
{state.expandButtonStatus === 0 ? "Expand" : "Fold"}
{state.expandButtonStatus === 0 ? t("common.expand") : t("common.fold")}
<Icon.ChevronRight className="icon-img" />
</span>
</div>

View File

@ -38,7 +38,9 @@
"yourself": "Yourself",
"archived-at": "Archived at",
"changed": "changed",
"update-on": "Update on"
"update-on": "Update on",
"fold": "Fold",
"expand": "Expand"
},
"slogan": "An open source, self-hosted knowledge base that works with a SQLite db file.",
"auth": {
@ -171,4 +173,4 @@
"resource-filename-updated": "Resource filename changed.",
"invalid-resource-filename": "Invalid filename."
}
}
}

View File

@ -38,7 +38,9 @@
"yourself": "Chính bạn",
"archived-at": "Lưu trữ lúc",
"changed": "đã thay đổi",
"update-on": "Cập nhật"
"update-on": "Cập nhật",
"fold": "Fold",
"expand": "Expand"
},
"slogan": "Một mã nguồn mở, tự bạn lưu lại mọi thứ bạn biết dựa trên SQLite db.",
"auth": {
@ -171,4 +173,4 @@
"resource-filename-updated": "Tên tệp tài nguyên đã thay đổi.",
"invalid-resource-filename": "Tên tệp không hợp lệ."
}
}
}

View File

@ -38,7 +38,9 @@
"yourself": "你自己",
"archived-at": "归档于",
"changed": "已更改",
"update-on": "更新于"
"update-on": "更新于",
"fold": "折叠",
"expand": "展开"
},
"slogan": "一个开源的、支持私有化部署的碎片化知识卡片管理工具。",
"auth": {
@ -171,4 +173,4 @@
"resource-filename-updated": "资源文件名更改成功。",
"invalid-resource-filename": "无效的资源文件名"
}
}
}