Skip to content

Commit 81e40d9

Browse files
taosinkiss-fire
andauthored
chore: update i18n for tag reame (#4493)
* feat: update i18n for zh-hans * Update zh-Hans.json --------- Co-authored-by: KissFire <[email protected]>
1 parent fc5962f commit 81e40d9

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

web/src/components/RenameTagDialog.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const RenameTagDialog: React.FC<Props> = (props: Props) => {
2424

2525
const handleConfirm = async () => {
2626
if (!newName || newName.includes(" ")) {
27-
toast.error("Tag name cannot be empty or contain spaces");
27+
toast.error(t("tag.rename-error-empty"));
2828
return;
2929
}
3030
if (newName === tag) {
31-
toast.error("New name cannot be the same as the old name");
31+
toast.error(t("tag.rename-error-repeat"));
3232
return;
3333
}
3434

@@ -38,7 +38,7 @@ const RenameTagDialog: React.FC<Props> = (props: Props) => {
3838
oldTag: tag,
3939
newTag: newName,
4040
});
41-
toast.success("Rename tag successfully");
41+
toast.success(t("tag.rename-success"));
4242
} catch (error: any) {
4343
console.error(error);
4444
toast.error(error.details);
@@ -57,16 +57,16 @@ const RenameTagDialog: React.FC<Props> = (props: Props) => {
5757
<div className="flex flex-col justify-start items-start max-w-xs">
5858
<div className="w-full flex flex-col justify-start items-start mb-3">
5959
<div className="relative w-full mb-2 flex flex-row justify-start items-center space-x-2">
60-
<span className="w-20 text-sm whitespace-nowrap shrink-0 text-right">Old Name</span>
60+
<span className="w-20 text-sm whitespace-nowrap shrink-0 text-right">{t("tag.old-name")}</span>
6161
<Input className="w-full" readOnly disabled type="text" placeholder="A new tag name" value={tag} />
6262
</div>
6363
<div className="relative w-full mb-2 flex flex-row justify-start items-center space-x-2">
64-
<span className="w-20 text-sm whitespace-nowrap shrink-0 text-right">New Name</span>
64+
<span className="w-20 text-sm whitespace-nowrap shrink-0 text-right">{t("tag.new-name")}</span>
6565
<Input className="w-full" type="text" placeholder="A new tag name" value={newName} onChange={handleTagNameInputChange} />
6666
</div>
6767
<List size="sm" marker="disc">
6868
<ListItem>
69-
<p className="leading-5">All your memos with this tag will be updated.</p>
69+
<p className="leading-5">{t("tag.rename-tip")}</p>
7070
</ListItem>
7171
</List>
7272
</div>

web/src/locales/en.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,14 @@
395395
"create-tags-guide": "You can create tags by inputting `#tag`.",
396396
"delete-confirm": "Are you sure to delete this tag? All related memos will be archived.",
397397
"delete-tag": "Delete Tag",
398-
"no-tag-found": "No tag found"
398+
"no-tag-found": "No tag found",
399+
"rename-tag": "Rename tag",
400+
"old-name": "Old Name",
401+
"new-name": "New Name",
402+
"rename-tip": "All your memos with this tag will be updated.",
403+
"rename-error-empty": "Tag name cannot be empty or contain spaces",
404+
"rename-error-repeat": "New name cannot be the same as the old name",
405+
"rename-success": "Rename tag successfully"
399406
},
400407
"markdown": {
401408
"code-block": "Code block",

web/src/locales/zh-Hans.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"preview": "预览",
5353
"profile": "个人资料",
5454
"remember-me": "保持登录",
55-
"rename": "改名",
55+
"rename": "重命名",
5656
"reset": "重置",
5757
"resources": "资源库",
5858
"restore": "恢复",
@@ -379,7 +379,14 @@
379379
"create-tags-guide": "您可以通过输入 “#标签” 创建标签。",
380380
"delete-confirm": "您确定要删除此标签吗?所有相关的备忘录将会被归档。",
381381
"delete-tag": "删除标签",
382-
"no-tag-found": "没找到此标签"
382+
"no-tag-found": "没找到此标签",
383+
"rename-tag": "标签重命名",
384+
"old-name": "旧名称",
385+
"new-name": "新名称",
386+
"rename-tip": "您的所有带有此标签的备忘录将被更新。",
387+
"rename-error-empty": "新名称不能为空或包含空格",
388+
"rename-error-repeat": "新名称不能与旧名称相同",
389+
"rename-success": "重命名成功"
383390
},
384391
"markdown": {
385392
"code-block": "代码块",

0 commit comments

Comments
 (0)