diff --git a/data/onefile_join.md b/data/onefile.md
similarity index 100%
rename from data/onefile_join.md
rename to data/onefile.md
diff --git a/data/onefile_en.md b/data/onefile_en.md
new file mode 100644
index 00000000..bc343810
--- /dev/null
+++ b/data/onefile_en.md
@@ -0,0 +1,44 @@
+## I. Introduction
+
+Are you already overwhelmed by the monotonous CRUD business code, and tired of the endless process of installing dependencies and deploying environments just to create a webpage, followed by the never-ending updates of dependency versions?
+
+The OneFile programming challenge with a single file is here to awaken your interest and pleasure in coding!
+
+Write the code you want, with the simplest code in **just one file**, and find back the original joy of programming.
+
+## II. Requirements
+
+When you step away from modern frameworks and libraries, the opportunity to showcase your talent comes! If you have an idea, you should write it down quickly. It may not need to be very complex; perhaps one file is enough.
+
+The **one-file** programming challenge has the following requirements:
+
+- A single file, not compressed, with a size smaller than 1 MB
+- Clear code structure, including comments, and fewer than 5000 lines of code
+- Any programming language is allowed, but cannot only contain Markdown files
+- No external files are introduced (images, videos, CSS, etc.)
+- The project function is complete and has learning or usage value
+- (Optional) Up to one open-source library or framework may be depended on
+
+The collected works will be promoted through HelloGitHub's accounts across the entire network (more than 200,000 fans), allowing your project to help more people and be loved by more people.
+
+In addition to submitting your own works, you can also share projects collected from the internet, but the author and source of the code must be indicated.
+
+## III. Submission Methods
+
+**First Method**: Submit through the form: [Click Here](https://hellogithub.yuque.com/forms/share/4f0bf06b-2991-4f7e-a860-5b76337b7b5b)
+
+**Second Method**: Submit through GitHub Pull Request steps:
+
+1. Fork this project
+2. Categorize the work according to the language and put it in the `src/appropriate directory`
+3. Submit PR
+4. Fill in the relevant information in the PR description area
+5. You will receive a reply on whether to include it within three days
+
+Tips: [Click Here](https://docs.github.com/cn/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) to view the PR method
+
+## IV. Final Thoughts
+
+Every project starts with a single file and becomes what you see today through continuous iteration. The one file you submit today is a seed.
+
+> The best time to plant a tree is twenty years ago. The second-best time is now.
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index 07451f41..200bcb16 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -27,12 +27,12 @@
"login": "Sign In"
},
"advert": {
- "desc": "Server expires by",
+ "desc": "expire in",
"desc2": "Buy me a coffee",
"next": "Need to gold",
"next2": "Next target by",
"day": "D",
- "year": ""
+ "year": "Y"
},
"site_stats": {
"user": "#Users",
diff --git a/public/locales/en/onefile.json b/public/locales/en/onefile.json
new file mode 100644
index 00000000..aa64daad
--- /dev/null
+++ b/public/locales/en/onefile.json
@@ -0,0 +1,26 @@
+{
+ "title": "Single-File Open Source Projects",
+ "description": "A collection of single-file, copy-to-run open source projects",
+ "click": "Click",
+ "p_text": "OneFile gathers open source projects that are single-file, easy to run, and straightforward to understand. Including games, compilers, servers, tools, utility libraries, and other interesting open source projects that you can run just by copying the code. Click to view the source code and try it online.",
+ "p_text2": "OneFile is an open source project where you can find interesting and easy-to-run programs. It's also a programming challenge where you can submit a single file to take on the challenge.",
+ "p_text3": "Join the OneFile programming challenge and write some interesting code with just one file!",
+ "code": {
+ "copy_success": "Source code copied, paste it into a file to run",
+ "copy_fail": "Copy failed",
+ "title": "OneFile: {{name}} Source Code",
+ "nav": "Code",
+ "author": "Author: {{author}}",
+ "language": "Language: {{language}}",
+ "package": "Deps",
+ "nopackage": "No Deps",
+ "read": "{{num}} views",
+ "play": "Play",
+ "vite": "Visit",
+ "copy": "Copy"
+ },
+ "join": {
+ "title": "Join the OneFile Programming Challenge",
+ "nav": "Join"
+ }
+}
diff --git a/public/locales/zh/onefile.json b/public/locales/zh/onefile.json
new file mode 100644
index 00000000..3cd219a3
--- /dev/null
+++ b/public/locales/zh/onefile.json
@@ -0,0 +1,26 @@
+{
+ "title": "仅一个文件的开源项目",
+ "description": "仅一个文件、复制即可运行的开源项目集合",
+ "click": "点击",
+ "p_text": "OneFile 是汇集了仅一个文件、运行简单、一看就懂的开源项目。包括:游戏、编译器、服务器、工具、实用库等有趣的开源项目,而且复制代码就能跑,点击即可在线查看源码和试玩。",
+ "p_text2": "「OneFile」是一个开源项目,在这里你可以找到有趣运行简单的程序。同时它也是一个编程挑战,你也可以提交一个文件接受挑战。",
+ "p_text3": "加入 OneFile 编程挑战,一个文件而已就写点有趣的代码吧!",
+ "code": {
+ "copy_success": "源码已复制,粘贴到文件中即可运行",
+ "copy_fail": "复制失败",
+ "title": "OneFile: {{name}} 源码",
+ "nav": "源码",
+ "author": "作者 {{author}}",
+ "language": "主语言 {{language}}",
+ "package": "有依赖",
+ "nopackage": "无依赖",
+ "read": "{{num}} 次查看",
+ "play": "试玩",
+ "vite": "访问",
+ "copy": "复制"
+ },
+ "join": {
+ "title": "加入 OneFile 编程挑战",
+ "nav": "加入"
+ }
+}
diff --git a/src/components/buttons/LanguageSwitcher.tsx b/src/components/buttons/LanguageSwitcher.tsx
index 8214bcff..01cfeeab 100644
--- a/src/components/buttons/LanguageSwitcher.tsx
+++ b/src/components/buttons/LanguageSwitcher.tsx
@@ -37,7 +37,7 @@ const LanguageSwitcher = (props: LanguageSwitchProps) => {
};
if (props.type === 'text') {
- const isChinese = locale == 'en' ? false : true;
+ const isChinese = locale == 'zh' ? true : false;
const buttonText = isChinese ? 'English' : '简体中文';
return (
changeLanguage(isChinese ? 'en' : 'zh')}>
@@ -74,7 +74,7 @@ const LanguageSwitcher = (props: LanguageSwitchProps) => {
aria-haspopup='true'
aria-expanded={isHovered ? 'true' : 'false'}
>
- {selectedLocale === 'en' ? 'EN' : '中文'}
+ {selectedLocale === 'zh' ? '中文' : 'EN'}
diff --git a/src/components/side/Ad.tsx b/src/components/side/Ad.tsx
index 19d95a95..389413c6 100644
--- a/src/components/side/Ad.tsx
+++ b/src/components/side/Ad.tsx
@@ -1,5 +1,6 @@
import Link from 'next/link';
import { MouseEventHandler, useState } from 'react';
+import { GoServer } from 'react-icons/go';
import { VscClose } from 'react-icons/vsc';
import { redirectRecord } from '@/services/home';
@@ -19,6 +20,7 @@ interface Props {
interface AdContentProps {
t: (key: string) => string;
data: AdvertItem;
+ i18n_lang?: string;
}
interface ImageAdContentProps {
@@ -71,11 +73,12 @@ export default function Ad({ data, className, t, i18n_lang }: Props) {
);
- const AdServerInfo = ({ data, t }: AdContentProps) => (
+ const AdServerInfo = ({ data, t, i18n_lang }: AdContentProps) => (