chore: update common locales

This commit is contained in:
Steven 2022-09-14 19:35:45 +08:00
parent c5b26e3310
commit 54db6eda04
6 changed files with 33 additions and 28 deletions

View file

@ -21,7 +21,6 @@ const ArchivedMemo: React.FC<Props> = (props: Props) => {
};
const { t } = useI18n();
const [showConfirmDeleteBtn, toggleConfirmDeleteBtn] = useToggle(false);
const imageUrls = Array.from(memo.content.match(IMAGE_URL_REG) ?? []).map((s) => s.replace(IMAGE_URL_REG, "$1"));
const handleDeleteMemoClick = async () => {
if (showConfirmDeleteBtn) {

View file

@ -101,7 +101,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
<div className="dialog-header-container">
<p className="title-text">
<span className="icon-text">🚀</span>
{shortcutId ? t("common.edit-shortcut") : t("common.create-shortcut")}
{shortcutId ? t("shortcut-list.edit-shortcut") : t("shortcut-list.create-shortcut")}
</p>
<button className="btn close-btn" onClick={destroy}>
<Icon.X />
@ -113,7 +113,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
<input className="title-input" type="text" placeholder="shortcut title" value={title} onChange={handleTitleInputChange} />
</div>
<div className="form-item-container filter-form-container">
<span className="normal-text">{t("common.filters")}</span>
<span className="normal-text">{t("common.filter")}</span>
<div className="filters-wrapper">
{filters.map((f, index) => {
return (
@ -127,7 +127,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
);
})}
<div className="create-filter-btn" onClick={handleAddFilterBenClick}>
{t("common.new-filter")}
{t("shortcut-list.new-filter")}
</div>
</div>
</div>
@ -136,7 +136,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
<div></div>
<div className="btns-container">
<span className={`tip-text ${filters.length === 0 && "hidden"}`}>
<strong>{shownMemoLength}</strong> {t("common.eligible-memo")}
<strong>{shownMemoLength}</strong> {t("shortcut-list.eligible-memo")}
</span>
<button className={`btn save-btn ${requestState.isLoading ? "requesting" : ""}`} onClick={handleSaveBtnClick}>
{t("common.save")}

View file

@ -30,9 +30,9 @@ const SearchBar = () => {
</div>
<div className="quickly-action-wrapper">
<div className="quickly-action-container">
<p className="title-text">{t("common.quickly-filter")}</p>
<p className="title-text">{t("search.quickly-filter").toUpperCase()}</p>
<div className="section-container types-container">
<span className="section-text">{t("common.types")}:</span>
<span className="section-text">{t("common.type").toUpperCase()}:</span>
<div className="values-container">
{memoSpecialTypes.map((t, idx) => {
return (

View file

@ -21,7 +21,7 @@ const useI18n = () => {
};
}, []);
const translate = (key: string) => {
const translate = (key: string): string => {
const keys = key.split(".");
let value = resources[locale];
for (const k of keys) {

View file

@ -26,17 +26,11 @@
"sign-in": "Sign in",
"sign-out": "Sign out",
"back-to-home": "Back to Home",
"type": "Type",
"shortcuts": "Shortcuts",
"create-shortcut" : "Create Shortcut",
"edit-shortcut": "Edit Shortcut",
"title": "Title",
"filter": "Filter",
"filters": "Filters",
"new-filter": "New Filter",
"eligible-memo": "eligible memo",
"tags": "Tags",
"quickly-filter": "QUICKLY FILTER",
"types": "TYPE"
"tags": "Tags"
},
"slogan": "An open source, self-hosted knowledge base that works with a SQLite db file.",
"auth": {
@ -77,9 +71,18 @@
"memo-list": {
"fetching-data": "fetching data..."
},
"shortcut-list": {
"create-shortcut": "Create Shortcut",
"edit-shortcut": "Edit Shortcut",
"new-filter": "New Filter",
"eligible-memo": "eligible memo"
},
"tag-list": {
"tip-text": "Enter `#tag ` to create"
},
"search": {
"quickly-filter": "Quickly filter"
},
"setting": {
"my-account": "My Account",
"preference": "Preference",
@ -95,4 +98,4 @@
"create-a-member": "Create a member"
}
}
}
}

View file

@ -26,17 +26,11 @@
"sign-in": "登录",
"sign-out": "退出登录",
"back-to-home": "回到主页",
"shortcuts": "快捷方式",
"create-shortcut" : "创建快捷方式",
"edit-shortcut": "编辑快捷方式",
"type": "类型",
"shortcuts": "捷径",
"title": "标题",
"filter": "过滤",
"filters": "全部过滤",
"new-filter": "新建过滤",
"eligible-memo": "符合条件的memo",
"tags": "全部标签",
"quickly-filter": "快速过滤",
"types": "类型"
"filter": "过滤器",
"tags": "全部标签"
},
"slogan": "一个开源的、支持私有化部署的碎片化知识卡片管理工具。",
"auth": {
@ -77,9 +71,18 @@
"memo-list": {
"fetching-data": "请求数据中..."
},
"shortcut-list": {
"create-shortcut": "创建捷径",
"edit-shortcut": "编辑捷径",
"new-filter": "新建过滤器",
"eligible-memo": "符合条件的 memo"
},
"tag-list": {
"tip-text": "输入`#tag `来创建标签"
},
"search": {
"quickly-filter": "快速过滤"
},
"setting": {
"my-account": "我的账号",
"preference": "偏好设置",
@ -95,4 +98,4 @@
"create-a-member": "创建成员"
}
}
}
}