Skip to content

Commit

Permalink
feat: home, side, repo page
Browse files Browse the repository at this point in the history
  • Loading branch information
521xueweihan committed Jul 12, 2024
1 parent c65c013 commit a101357
Show file tree
Hide file tree
Showing 42 changed files with 997 additions and 482 deletions.
7 changes: 1 addition & 6 deletions next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ module.exports = {
defaultLocale: 'zh',
locales: ['zh', 'en'],
},
ns: ['common'],
interpolation: {
prefix: '{',
suffix: '}',
},
localeStructure: '{lng}/{ns}',

// eslint-disable-next-line @typescript-eslint/no-var-requires
localePath: require('path').resolve('./public/locales'), // 指定翻译文件的路径
};
50 changes: 47 additions & 3 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
{
"a": "1111",
"b": "1111",
"c": "1111"
"header": {
"search": "Search Open Source Projects",
"home": "Home",
"periodical": "Monthly",
"rank": "Ranking",
"article": "Articles",
"submit": "Submit"
},
"user_side": {
"contribute_label": "Contributions",
"profile": "Profile",
"admin": "Settings",
"logout": "Sign Out",
"login": "Sign In"
},
"advert": {
"desc": "Server will expire in",
"desc2": "WeChat Sponsorship",
"next": "Short of this target by",
"next2": "Short of next target by",
"day": "D",
"year": "Y"
},
"site_stats": {
"user": "Total Users",
"repo": "Projects",
"title": "About Us",
"desc": "HelloGitHub is a platform to discover and share interesting, beginner-friendly open source projects.\nWe aim to help everyone find joy in programming, easily solve technical challenges,\nexplore amazing open-source tools, and naturally embark on their open-source journey."
},
"recommend": {
"title": "Recommended",
"desc": "Content is collected from spdx and GitHub, following the",
"desc2": "protocol.",
"change": "Refresh"
},
"footer": {
"feedback": "Feedback",
"business": "Business",
"contact": "Contact Us",
"agreement": "Agreement",
"source": "Source Code",
"sitemap": "Sitemap",
"server_sponsor": "Server is sponsored by",
"server_sponsor2": "",
"cdn_sponsor": "Cloud service is sponsored by",
"cdn_sponsor2": ""
}
}
28 changes: 28 additions & 0 deletions public/locales/en/home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"title": "Home",
"description": "Sharing interesting and beginner-friendly open-source projects on GitHub",
"bottom_text_login": "You have reached the bottom of the page",
"bottom_text_nologin": "End of the page! Sign in to read more",
"nav": {
"all": "All",
"featured": "Featured",
"tag": "Tags",
"submit": "Submit"
},
"tag_side": {
"title": "Hot Tags",
"manage": "Preference",
"all_tags_label": "All"
},
"tag_modal": {
"default_tag": "All",
"tips": "Tips: Click the tag on the left to 'Select', drag the selected tags on the right to 'Sort'",
"selected": "Selected: ",
"fetch_fail_msg": "Failed to fetch tags",
"add": "Add Tag",
"save": "Save",
"save_success_msg": "Save successful!",
"save_fail_msg": "Save failed!",
"max_tag_msg": "You can only select up to {{maxTotal}} tags!"
}
}
99 changes: 99 additions & 0 deletions public/locales/en/repository.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"nav": {
"title": "Project Details",
"desc": "Shared by",
"desc2": ""
},
"info": {
"claimed": "Claimed",
"unclaim": "Unclaimed",
"score_desc": "HelloGitHub Rating",
"score_user_desc": "{{count}} ratings",
"vite": "Visit",
"voted": "Liked",
"vote": "Like",
"opensource": "Open Source",
"discuss": "Discuss",
"share": "Share",
"collect": "Collect",
"copy_desc": "More details at:",
"copy_success": "Project information copied successfully, share it now!",
"copy_fail": "Copy failed"
},
"url": {
"home": "Website",
"document": "Documentation",
"download": "Download",
"online": "Demo",
"source": "Source Code"
},
"favorite": {
"default": "Default Favorites",
"cancel": "Unfavorite",
"success": "Added to Favorites",
"fail": "Failed to add to Favorites",
"title": "Select Favorites",
"desc": "You can find favorited projects in 'My Homepage'",
"save": "Save"
},
"history": {
"past_day_desc": "Past {{days}} days",
"total_desc": "Received {{total}} stars ✨",
"fail_desc": "No star history data available"
},
"more": {
"yes": "Yes",
"no": "No",
"null": "None",
"star": "Stars",
"chinese": "Chinese",
"language": "Main Language",
"activity": "Active",
"contributors": "Contributors",
"org": "Organization",
"version": "Latest Version",
"license": "License",
"expand": "More",
"collapse": "Collapse"
},
"content": {
"desc_tab": "Description",
"code_tab": "Code",
"volume_label": "Included in:",
"volume": "Issue {{volume}}",
"tag_label": "Tags:"
},
"comment": {
"title": "Comments",
"sort_hot": "Hot",
"sort_new": "Newest",
"total": "{{total}} selected comments",
"more_reply": "View all {{total}} replies",
"load_more": "Load more...",
"no_comment": "No selected comments yet",
"used": "Used",
"unused": "Not Used",
"score": "Rating:",
"reply": "Reply",
"cancel": "Cancel",
"item": {
"featured": "Featured",
"unfeatured": "Not Featured",
"vote": "Like",
"expand": "Expand",
"collapse": "Collapse",
"login": "Please log in first"
},
"submit": {
"reply_placeholder": "Replying to: {{nickname}}",
"placeholder": "Write your comment: share your experience, pros/cons, use cases, or any surprising aspects of this open-source project...",
"save": "Submit",
"success": "Posted successfully! Will be displayed after approval",
"fail": "Submission failed",
"err1": "Comment content cannot be empty",
"err2": "Comment content must be at least 5 characters",
"err3": "Comment content cannot exceed 500 characters",
"err4": "Please provide a rating"
}
}
}
48 changes: 47 additions & 1 deletion public/locales/zh/common.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
{
"a": "某个中文翻译"
"header": {
"search": "搜索开源项目",
"home": "首页",
"periodical": "月刊",
"rank": "榜单",
"article": "文章",
"submit": "提交项目"
},
"user_side": {
"contribute_label": "贡献值",
"profile": "我的主页",
"admin": "管理中心",
"logout": "退出登录",
"login": "立即登录"
},
"advert": {
"desc": "服务器还剩",
"desc2": "微信扫码赞助本站",
"next": "距离目标还差",
"next2": "距离下个目标还差",
"day": "",
"year": ""
},
"site_stats": {
"user": "用户总数",
"repo": "开源项目",
"title": "关于本站",
"desc": "HelloGitHub 是一个发现和分享有趣、入门级开源项目的平台。\n希望大家能够在这里找到编程的快乐、 轻松搞定问题的技术方案、\n大呼过瘾的开源神器, 顺其自然地开启开源之旅。"
},
"recommend": {
"title": "推荐项目",
"desc": "内容整理自 spdx 和 GitHub 网站,并遵循",
"desc2": "协议。",
"change": "换一换"
},
"footer": {
"feedback": "问题反馈",
"business":"商务合作",
"contact": "联系我们",
"agreement": "用户协议",
"source": "社区源码",
"sitemap": "站点地图",
"server_sponsor": "服务器由",
"server_sponsor2": "提供",
"cdn_sponsor": "专业的",
"cdn_sponsor2": "提供云存储服务"
}
}
28 changes: 28 additions & 0 deletions public/locales/zh/home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"title": "首页",
"description": "分享 GitHub 上有趣、入门级的开源项目",
"bottom_text_login": "你不经意间触碰到了底线",
"bottom_text_nologin": "到底啦!登录可查看更多内容",
"nav": {
"all": "全部",
"featured": "精选",
"tag": "标签",
"submit": "提交"
},
"tag_side": {
"title": "热门标签",
"manage": "管理标签",
"all_tags_label": "综合"
},
"tag_modal": {
"default_tag": "综合",
"tips": "操作提示:点击左侧标签为「选择」,拖拽右侧已选标签可「排序」",
"selected": "已选:",
"fetch_fail_msg": "获取标签失败",
"add": "添加标签",
"save": "保存",
"save_success_msg": "保存成功!",
"save_fail_msg": "保存失败!",
"max_tag_msg": "最多只能选择 {{maxTotal}} 个标签!"
}
}
100 changes: 100 additions & 0 deletions public/locales/zh/repository.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"nav": {
"title": "项目详情",
"desc": "",
"desc2": "分享"
},
"info": {
"claimed": "已认领",
"unclaim": "未认领",
"socre_desc": "HelloGitHub 评分",
"socre_user_desc": "{{count}} 人评分",
"vite": "访问",
"voted": "已赞",
"vote": "点赞",
"opensource": "开源",
"discuss": "讨论",
"share": "分享",
"collect": "收藏",
"copy_desc": "更多详情尽在:",
"copy_success": "项目信息已复制,快去分享吧!",
"copy_fail": "复制失败"
},
"url": {
"home": "官网",
"document": "文档",
"download": "下载",
"online": "演示",
"source": "源码"
},
"favorite": {
"default": "默认收藏夹",
"cancel": "取消收藏",
"success": "收藏成功",
"fail": "收藏失败",
"title": "选择收藏夹",
"desc": "收藏的项目在「我的主页」可以找到",
"save": "确定"
},
"history": {
"past_day_desc": "过去 {{days}} 天",
"total_desc": "共收获 {{total}} 颗 Star ✨",
"fail_desc": "暂无 Star 历史数据"
},
"more": {
"yes": "",
"no": "",
"null": "",
"star": "星数",
"chinese": "中文",
"language": "主语言",
"activity": "活跃",
"contributors": "贡献者",
"org": "组织",
"version": "最新版本",
"license": "协议",
"expand": "更多",
"collapse": "收起"
},
"content": {
"desc_tab": "介绍",
"code_tab": "代码",
"volume_label": "收录于:",
"volume": "第 {{volume}} 期",
"tag_label": "标签:"
},
"comment": {
"title": "评论",
"sort_hot": "热门",
"sort_new": "最新",
"total": "{{total}} 条精选评论",
"more_reply": "查看全部 {{total}} 条回复",
"load_more": "加载更多...",
"no_comment": "暂无精选评论",
"used": "用过",
"unused": "没用过",
"score": "评分:",
"reply": "回复",
"cancel": "取消",
"item": {
"featured": "精选",
"unfeatured": "未精选",
"vote": "点赞",
"expand": "展开",
"collapse": "收起",
"login": "请先登录"
},
"submit": {
"reply_placeholder": "正在回复:{{nickname}}",
"placeholder": "写下你的评论:分享开源项目的使用体验、优点/吐槽、适用场景、惊艳之处...",
"save": "发表",
"success": "发布成功!通过审核后展示",
"fail": "提交失败",
"err1":"评论内容不能为空",
"err2":"评论内容不能少于 5 个字",
"err3":"评论内容不能超过 500 个字",
"err4":"请评分"

}
}
}
Loading

0 comments on commit a101357

Please sign in to comment.