From af363e2afae00e1387cb3c8e4166705964f5653f Mon Sep 17 00:00:00 2001 From: xueweihan <595666367@qq.com> Date: Sun, 4 Aug 2024 22:25:55 +0800 Subject: [PATCH] fix: tarns bug --- public/locales/en/article.json | 2 +- public/locales/en/common.json | 18 ++++---- public/locales/en/home.json | 6 +-- public/locales/en/notification.json | 4 +- public/locales/en/profile.json | 24 ++++++----- public/locales/en/search.json | 2 +- public/locales/zh/common.json | 6 +-- public/locales/zh/home.json | 6 +-- public/locales/zh/profile.json | 4 ++ src/components/collection/AddCollection.tsx | 10 ++--- src/components/dialog/RepoModal.tsx | 4 +- src/components/dialog/TagModal.tsx | 2 +- src/components/home/Item.tsx | 14 +++++-- src/components/respository/Info.tsx | 10 ++--- src/components/respository/Tabs.tsx | 4 +- src/components/side/Recommend.tsx | 2 +- src/components/user/CollectionList.tsx | 1 - src/components/user/RepoRecord.tsx | 6 ++- src/components/user/User.tsx | 2 +- src/pages/notification/index.tsx | 4 +- src/pages/periodical/volume/[id].tsx | 2 +- src/pages/repository/[rid]/index.tsx | 4 +- src/services/base.ts | 46 ++++++++++++++++++--- src/types/home.tsx | 2 + src/types/repository.tsx | 3 ++ src/types/tag.tsx | 1 + 26 files changed, 120 insertions(+), 69 deletions(-) diff --git a/public/locales/en/article.json b/public/locales/en/article.json index cf3f9214..28d447aa 100644 --- a/public/locales/en/article.json +++ b/public/locales/en/article.json @@ -2,7 +2,7 @@ "title": "Articles", "description": "Here you'll find original and high-quality articles focused on open source projects.", "bottom_text_login": "You've reached the end.", - "bottom_text_nologin": "End of content! Log in to see more.", + "bottom_text_nologin": "End of content! Login to see more.", "nav": { "title": "Articles", "hot": "Popular", diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 200bcb16..07de2aad 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -12,9 +12,9 @@ }, "login": { "text": "Login", - "title": "Choose a login method", - "tips": "By logging in, you agree to the", - "agreement": "User Agreement", + "title": "Choose login method", + "tips": "Login agree to the", + "agreement": "Agreement", "oauth": "Login via {{platform}}", "redirect": "Waiting for redirection...", "redirect_bar_text": "Logging in, waiting for redirection..." @@ -41,7 +41,7 @@ "desc": "HelloGitHub is a platform for discovering and sharing beginner-friendly open source projects.\nWe help users find joy in programming, solve technical challenges, and explore amazing tools to start their open-source journey." }, "recommend": { - "title": "Recommended", + "title": "Recommend", "desc": "Content is collected from spdx and GitHub, following the", "desc2": "protocol.", "change": "Refresh" @@ -60,7 +60,7 @@ }, "submit_repo": { "text": "Submit", - "title": "Recommend or Submit an Open Source Project", + "title": "Recommend or Submit an Project", "description": "Only approved projects will be displayed on the homepage", "url_placeholder": "Project URL", "url_tip": "👆 Only projects on GitHub are accepted", @@ -80,16 +80,16 @@ }, "collect": { "title": "New", - "edit_success": "Successfully Edited", - "edit_fail": "Edit Failed", "create_success": "Successfully Created", "create_fail": "Creation Failed", + "edit_success": "Successfully Edited", + "edit_fail": "Edit Failed", "name": "Name", "name_placeholder": "Enter folder name", - "desc": "Description", + "desc": "Desc", "desc_placeholder": "Enter folder description (up to 100 characters, optional)", "pravite": "Private", - "pravite_desc": "", + "pravite_desc": "Visible only to you", "public": "Public", "public_desc": "Visible to everyone", "button": { diff --git a/public/locales/en/home.json b/public/locales/en/home.json index 7d3e991c..82431ed6 100644 --- a/public/locales/en/home.json +++ b/public/locales/en/home.json @@ -21,10 +21,6 @@ "save": "Save", "save_success_msg": "Save successful!", "save_fail_msg": "Save failed!", - "max_tag_msg": "You can only select up to {{maxTotal}} tags!", - "编程语言": "Programming", - "技术栈": "Technology", - "应用类型": "Application", - "其它": "Other" + "max_tag_msg": "You can only select up to {{maxTotal}} tags!" } } diff --git a/public/locales/en/notification.json b/public/locales/en/notification.json index a84e50cd..411bf48d 100644 --- a/public/locales/en/notification.json +++ b/public/locales/en/notification.json @@ -2,7 +2,7 @@ "title": "Message Center", "empty": "No messages", "repository": { - "desc": "You {{content}} open source project " + "desc": "You {{content}} project " }, "reply": { "desc": "replied to you on", @@ -11,6 +11,6 @@ "comment": { "desc": "commented on your", "desc2": "commented on the project you shared", - "desc3": "open source project:" + "desc3": "project:" } } diff --git a/public/locales/en/profile.json b/public/locales/en/profile.json index 9f9599a0..e501c647 100644 --- a/public/locales/en/profile.json +++ b/public/locales/en/profile.json @@ -4,24 +4,24 @@ "page_next": "Next", "read_button": "View", "tabs": { - "dynamic": "Activity", + "dynamic": "Dynamic", "favorite": "Favorites", - "comment": "Comments", - "vote": "Likes", - "repo": "Projects" + "comment": "Comment", + "vote": "Vote", + "repo": "Project" }, "user_info": { "desc": "User #{{rank}} of HelloGitHub community, joined on {{date}}", - "desc2": "Shared {{share_repo}} open source projects, posted {{comment_repo}} project reviews, and earned {{contribute}} contribution points.", + "desc2": "Shared {{share_repo}} projects, posted {{comment_repo}} project reviews, and earned {{contribute}} contribution points.", "desc3": "User #{{rank}} of HelloGitHub community", "desc4": "Joined on {{date}}, earned {{contribute}} contribution points", - "desc5": "Shared {{share_repo}} open source projects, posted {{comment_repo}} project reviews" + "desc5": "Shared {{share_repo}} projects, posted {{comment_repo}} project reviews" }, "dynamic": { "time_desc": "Activity", "desc": "No activity", "value_text": ", earned {{value}} contribution points.", - "comment": "Commented on open source project", + "comment": "Commented on project", "comment_hot": "Hot comment on", "comment_hot2": "project", "comment_bad": "Posted meaningless/spam comment, deducted 2 contribution points.", @@ -47,8 +47,8 @@ "share": "Share" }, "dialog": { - "del_title": "Are you sure to delete the favorites folder?", - "del_desc": "Deleting the folder will remove all projects in it", + "del_title": "Delete the favorites folder?", + "del_desc": "Deleting folder removes all projects within", "edit_title": "Edit Favorites Folder" }, "status": { @@ -72,10 +72,14 @@ "button": { "appeal": "Appeal", "vote": "Likes {{total}}" + }, + "item": { + "expand": "Expand", + "collapse": "Collapse" } }, "vote": { - "empty": "No likes" + "empty": "No Votes" }, "repo": { "empty": "No projects", diff --git a/public/locales/en/search.json b/public/locales/en/search.json index 6b0b4750..1492fece 100644 --- a/public/locales/en/search.json +++ b/public/locales/en/search.json @@ -1,6 +1,6 @@ { "title": "Open Source Project Search Results", "description": "Find interesting and beginner-friendly open source projects on HelloGitHub", - "bottom_text_nologin": "That's all! Log in to see more content", + "bottom_text_nologin": "That's all! Login to see more content", "navbar": "Search Results" } diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index f1b4826e..b007fffa 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -80,16 +80,16 @@ }, "collect": { "title": "新建收藏夹", - "edit_success": "修改成功", - "edit_fail": "修改失败", "create_success": "新建成功", "create_fail": "新建失败", + "edit_success": "修改成功", + "edit_fail": "修改失败", "name": "名称", "name_placeholder": "请输入收藏夹名称", "desc": "描述", "desc_placeholder": "请输入收藏描述(限100字,选填)", "pravite": "私有", - "pravite_desc": "", + "pravite_desc": "仅个人可见", "public": "公开", "public_desc": "所有人可见", "button": { diff --git a/public/locales/zh/home.json b/public/locales/zh/home.json index 1437e619..e834a5b7 100644 --- a/public/locales/zh/home.json +++ b/public/locales/zh/home.json @@ -21,10 +21,6 @@ "save": "保存", "save_success_msg": "保存成功!", "save_fail_msg": "保存失败!", - "max_tag_msg": "最多只能选择 {{maxTotal}} 个标签!", - "编程语言": "编程语言", - "技术栈": "技术栈", - "应用类型": "应用类型", - "其它": "其它" + "max_tag_msg": "最多只能选择 {{maxTotal}} 个标签!" } } diff --git a/public/locales/zh/profile.json b/public/locales/zh/profile.json index fb661f62..7f4540c4 100644 --- a/public/locales/zh/profile.json +++ b/public/locales/zh/profile.json @@ -72,6 +72,10 @@ "button": { "appeal": "申诉", "vote": "点赞 {{total}}" + }, + "item": { + "expand": "展开", + "collapse": "收起" } }, "vote": { diff --git a/src/components/collection/AddCollection.tsx b/src/components/collection/AddCollection.tsx index 212b5935..cddcd7ac 100644 --- a/src/components/collection/AddCollection.tsx +++ b/src/components/collection/AddCollection.tsx @@ -20,14 +20,15 @@ type EditCollectionProps = { type: 'add' | 'edit'; title: string; visible: boolean; - t: (key: string) => string; initValue?: EditCollectionFormData; onFinish?: () => void; onClose: () => void; }; export const EditCollectionMoal = (props: EditCollectionProps) => { - const { t, visible, title = t('collect.title') } = props; + const { t } = useTranslation('common'); + + const { visible, title } = props; const initFormData = React.useMemo( () => ({ name: '', @@ -170,7 +171,7 @@ export const EditCollectionMoal = (props: EditCollectionProps) => { readOnly checked={formData.status === 2} /> -