From 194489df360b1ab5e635f7f107e9c822802f01cf Mon Sep 17 00:00:00 2001 From: Zylan Date: Sun, 30 Mar 2025 18:43:52 +0800 Subject: [PATCH] v5.0.0 --- .eslintrc.json | 5 +- README.md | 2 +- app/layout.tsx | 18 +- app/share/page.tsx | 104 ++-- components/LanguageContext.tsx | 511 +++++++++++++++ components/LanguageSwitcher.tsx | 33 + components/ShareCard.tsx | 1036 ++++++++++++++++--------------- components/calculator.tsx | 948 +++++++++++++++++++--------- public/favicon.ico | 0 public/website.png | Bin 0 -> 23885 bytes test.txt | Bin 0 -> 44 bytes test/test.txt | Bin 0 -> 44 bytes 12 files changed, 1808 insertions(+), 849 deletions(-) create mode 100644 components/LanguageContext.tsx create mode 100644 components/LanguageSwitcher.tsx create mode 100644 public/favicon.ico create mode 100644 public/website.png create mode 100644 test.txt create mode 100644 test/test.txt diff --git a/.eslintrc.json b/.eslintrc.json index 3722418..798d8cb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,6 @@ { - "extends": ["next/core-web-vitals", "next/typescript"] + "extends": ["next/core-web-vitals", "next/typescript"], + "rules": { + "@typescript-eslint/no-unused-vars": "off" + } } diff --git a/README.md b/README.md index fbe75bf..17727ca 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ - [ ] 添加更多工作类型模板 - [ ] 支持数据导出功能 - [ ] 添加历史记录功能 -- [ ] 支持多语言 +- [x] 支持多语言 - [ ] 添加更多可视化图表 ## 贡献指南 diff --git a/app/layout.tsx b/app/layout.tsx index 289565b..36b0b5f 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,6 +1,7 @@ import type { Metadata } from "next"; import localFont from "next/font/local"; import "./globals.css"; +import { LanguageProvider } from "@/components/LanguageContext"; const geistSans = localFont({ src: "./fonts/GeistVF.woff", @@ -14,8 +15,17 @@ const geistMono = localFont({ }); export const metadata: Metadata = { - title: "这b班上得值不值", - description: "这b班上得值不值", + title: { + default: "这b班上得值不值", + template: "%s | 这b班上得值不值" + }, + alternates: { + languages: { + "en-US": "/en", + "zh-CN": "/", + }, + }, + description: "这b班上得值不值 - 计算你的工作性价比 | Is This Job Worth It? - Calculate your job's value", verification: { google: "_OQGiIpYz87USAsgJV2C07-JJhQ8myV_4GoM1kDjFic", }, @@ -36,7 +46,9 @@ export default function RootLayout({ - {children} + + {children} +