Skip to content

Commit

Permalink
feat: Add missing strings
Browse files Browse the repository at this point in the history
  • Loading branch information
RiverTwilight committed Oct 18, 2024
1 parent 0b1df2c commit badb544
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ const Layout = ({ currentPage, children, enableFrame }) => {

const metaTitle = `${
currentPage
? `${currentPage.title} - ${siteConfig.title}`
: siteConfig.title
? `${currentPage.title} - ${siteConfig.appName}`
: siteConfig.appName
}`;

const activeDescription = currentPage.description || siteConfig.description;
Expand Down Expand Up @@ -140,7 +140,7 @@ const Layout = ({ currentPage, children, enableFrame }) => {
/>
<meta
property="og:site_name"
content={siteConfig.title}
content={siteConfig.appName}
/>
<meta
property="og:image"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export default (props: { title: string; PageAction; repo: string }) => {
cursor: "pointer",
}}
>
{siteConfig.title}
{siteConfig.appName}
</Typography>
</Link>
<Typography
Expand Down
2 changes: 1 addition & 1 deletion src/data/i18n.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"zh-CN":{"homePage.appSection.Media":"图片视频","homePage.meta.description":"轻盈好用的在线工具,无需下载即可免费使用,解决生活学习工作中的大小问题","homePage.meta.title":"首页","homePage.searchBarAriaLabel":"在此键入以搜索","homePage.searchBarPlaceholder":"搜索(Ctrl+F)","navbar.home":"首页","navbar.donation":"免费捐赠","navbar.about":"关于","navbar.settings":"设置","navbar.feedback":"反馈","navbar.copyright.subtitle":"Geekits 完全开源和免费","navbar.copyright.title":"YGeeker 出品","navbar.log":"更新日志","channel.life":"生活常用","channel.ai":"人工智能","channel.image":"图片视频","channel.developer":"编程开发","channel.external":"第三方APP","channel.wip":"开发中","appMenu.github":"在 GitHub 上编辑","appMenu.bookmark":"收藏","appMenu.bookmark.undo":"移除收藏","settings.language.title":"语言","settings.language.auto":"跟随系统","settings.language.zh_cn":"简体中文","settings.language.en_us":"English","feedback.send":"提交","feedback.hero":"我们会阅读每一条反馈","feedback.subtitle":"你可以畅所欲言","feedback.debug":"发送错误日志","feedback.content.placeholder":"输入内容","feedback.contact.placeholder":"适合我们联系你的方式","general.chooseFile":"选择文件","general.confirm":"确认","general.save":"保存","general.download":"下载","qrcode.basic.title":"基本","qrcode.basic.placeholder":"链接或文本","qrcode.basic.type":"类型","qrcode.basic.wifi":"WI-FI","qrcode.basic.text":"文本","qrcode.advanced.title":"高级","qrcode.advanced.icon":"图标","qrcode.advanced.light":"亮色","qrcode.advanced.dark":"暗色","aboutPage.meta.title":"关于","app.decision.addOption":"添加选项","app.decision.savePreset":"保存预设","app.decision.currentOption":"当前备选项"},"en-US":{"homePage.meta.description":"Effortless solutions at your fingertips. Streamline your workflow with our intuitive online toolbox. No installation. No hassle. Just pure productivity.","homePage.meta.title":"Home","homePage.searchBarAriaLabel":"Type to Search","homePage.searchBarPlaceholder":"Search (Ctrl+F)","navbar.home":"Home","navbar.donation":"Free Donation","navbar.about":"About","navbar.settings":"Settings","navbar.feedback":"Feedback","navbar.copyright.subtitle":"Geekits is 100% open source and free","navbar.copyright.title":"Created by YGeeker","navbar.log":"What’s New","channel.life":"Lifestyle","channel.ai":"AI","channel.image":"Media Process","channel.developer":"Developer","channel.external":"External App","channel.wip":"WIP","appMenu.github":"Edit on GitHub","appMenu.bookmark":"Bookmark","appMenu.bookmark.undo":"Remove Bookmark","settings.language.title":"Language","settings.language.auto":"Auto","settings.language.zh_cn":"简体中文","settings.language.en_us":"English","feedback.send":"Submit","feedback.hero":"We Read Every Feedback","feedback.subtitle":"New app request, bug report, or anything you want to tell us.","feedback.debug":"Send Error Log","feedback.content.placeholder":"Write something you want to tell us","feedback.contact.placeholder":"How can we contact you?","general.chooseFile":"Choose File","general.confirm":"Confirm","general.save":"Save","general.download":"Download","qrcode.basic.title":"Basic","qrcode.basic.placeholder":"URL or Text","qrcode.basic.type":"Type","qrcode.basic.wifi":"WI-FI","qrcode.basic.text":"Text","qrcode.advanced.title":"Advanced","qrcode.advanced.icon":"Icon","qrcode.advanced.light":"Light Color","qrcode.advanced.dark":"Dark Color","aboutPage.meta.title":"About","app.decision.addOption":"Add Option","app.decision.savePreset":"Save Preset","app.decision.currentOption":"Current Options"},"zh-HK":{"homePage.searchBarPlaceholder":"搜寻"}}
{"zh-CN":{"homePage.meta.description":"轻盈好用的在线工具,无需下载即可免费使用 30+ 工具,解决生活学习工作中的大小问题","homePage.meta.title":"首页","homePage.appSection.Media":"图片视频","homePage.searchBarAriaLabel":"在此键入以搜索","homePage.searchBarPlaceholder":"搜索(Ctrl+F)","navbar.home":"首页","navbar.donation":"免费捐赠","navbar.about":"关于","navbar.settings":"设置","navbar.feedback":"反馈","navbar.copyright.subtitle":"Geekits 完全开源和免费","navbar.copyright.title":"YGeeker 出品","navbar.log":"更新日志","channel.life":"生活常用","channel.ai":"人工智能","channel.image":"图片视频","channel.developer":"编程开发","channel.external":"第三方APP","channel.wip":"开发中","appMenu.github":"在 GitHub 上编辑","appMenu.bookmark":"收藏","appMenu.bookmark.undo":"移除收藏","settings.language.title":"语言","settings.language.auto":"跟随系统","settings.language.zh_cn":"简体中文","settings.language.en_us":"English","donation.paid.title":"付费方式","feedback.send":"提交","feedback.hero":"我们会阅读每一条反馈","feedback.subtitle":"你可以畅所欲言","feedback.debug":"发送错误日志","feedback.content.placeholder":"输入内容","feedback.contact.placeholder":"适合我们联系你的方式","general.chooseFile":"选择文件","general.confirm":"确认","general.save":"保存","general.download":"下载","qrcode.basic.title":"基本","qrcode.basic.placeholder":"链接或文本","qrcode.basic.type":"类型","qrcode.basic.wifi":"WI-FI","qrcode.basic.text":"文本","qrcode.advanced.title":"高级","qrcode.advanced.icon":"图标","qrcode.advanced.light":"亮色","qrcode.advanced.dark":"暗色","aboutPage.meta.title":"关于","app.decision.addOption":"添加选项","app.decision.savePreset":"保存预设","app.decision.currentOption":"当前备选项","app.roman.inputHint":"输入整数"},"en-US":{"homePage.meta.description":"Your all-in-one digital toolkit. 30+ free tools including AI chat, calculators, converters, and creative utilities. Solve daily challenges effortlessly.","homePage.meta.title":"Home","homePage.appSection.Media":"Media","homePage.searchBarAriaLabel":"Type to Search","homePage.searchBarPlaceholder":"Search (Ctrl+F)","navbar.home":"Home","navbar.donation":"Free Donation","navbar.about":"About","navbar.settings":"Settings","navbar.feedback":"Feedback","navbar.copyright.subtitle":"Geekits is 100% open source and free","navbar.copyright.title":"Created by YGeeker","navbar.log":"What’s New","channel.life":"Lifestyle","channel.ai":"AI","channel.image":"Media Process","channel.developer":"Developer","channel.external":"External App","channel.wip":"WIP","appMenu.github":"Edit on GitHub","appMenu.bookmark":"Bookmark","appMenu.bookmark.undo":"Remove Bookmark","settings.language.title":"Language","settings.language.auto":"Auto","settings.language.zh_cn":"简体中文","settings.language.en_us":"English","donation.paid.title":"Paid Option","feedback.send":"Submit","feedback.hero":"We Read Every Feedback","feedback.subtitle":"New app request, bug report, or anything you want to tell us.","feedback.debug":"Send Error Log","feedback.content.placeholder":"Write something you want to tell us","feedback.contact.placeholder":"How can we contact you?","general.chooseFile":"Choose File","general.confirm":"Confirm","general.save":"Save","general.download":"Download","qrcode.basic.title":"Basic","qrcode.basic.placeholder":"URL or Text","qrcode.basic.type":"Type","qrcode.basic.wifi":"WI-FI","qrcode.basic.text":"Text","qrcode.advanced.title":"Advanced","qrcode.advanced.icon":"Icon","qrcode.advanced.light":"Light Color","qrcode.advanced.dark":"Dark Color","aboutPage.meta.title":"About","app.decision.addOption":"Add Option","app.decision.savePreset":"Save Preset","app.decision.currentOption":"Current Options","app.roman.inputHint":"Input integer"},"zh-HK":{"homePage.searchBarPlaceholder":"搜寻"}}
Binary file modified src/data/i18n.numbers
Binary file not shown.
Binary file modified src/data/i18n.xlsx
Binary file not shown.
35 changes: 22 additions & 13 deletions src/pages/donate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import Dialog from "@mui/material/Dialog";
import DialogTitle from "@mui/material/DialogTitle";
import DialogContent from "@mui/material/DialogContent";
import DialogActions from "@mui/material/DialogActions";
import Popover from "@mui/material/Popover";
import Image from "next/image";
import Accordion from "@mui/material/Accordion";
import AccordionSummary from "@mui/material/AccordionSummary";
Expand All @@ -44,6 +43,7 @@ import {
useStripe,
useElements,
} from "@stripe/react-stripe-js";
import Text from "@/components/i18n";

const FREE_DONATION_WAYS = [
{
Expand Down Expand Up @@ -203,7 +203,9 @@ const ProductItem = ({ href, ...props }) => (
const PaidOptionItem = ({ href, ...props }) => {
const [open, setOpen] = useState(false);
const [paymentIntent, setPaymentIntent] = useState(null);
const [expandedAccordion, setExpandedAccordion] = useState<string | false>("gumroad");
const [expandedAccordion, setExpandedAccordion] = useState<string | false>(
"gumroad"
);

const handleClick = () => {
setOpen(true);
Expand All @@ -214,17 +216,22 @@ const PaidOptionItem = ({ href, ...props }) => {
setExpandedAccordion("gumroad");
};

const handleAccordionChange = (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => {
setExpandedAccordion(isExpanded ? panel : false);
};
const handleAccordionChange =
(panel: string) =>
(event: React.SyntheticEvent, isExpanded: boolean) => {
setExpandedAccordion(isExpanded ? panel : false);
};

const handleStripePayment = async () => {
const response = await fetch("/api/create-payment-intent", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ amount: props.amount, description: props.title }),
body: JSON.stringify({
amount: props.amount,
description: props.title,
}),
});
const data = await response.json();
setPaymentIntent(data.clientSecret);
Expand All @@ -242,10 +249,10 @@ const PaidOptionItem = ({ href, ...props }) => {
<ListItemAvatar>
<Avatar>{props.icon}</Avatar>
</ListItemAvatar>
{!!props.amount ? (
{!!props.tag ? (
<ListItemText
primary={props.title}
secondary={props.amount}
secondary={props.tag}
/>
) : (
<ListItemText primary={props.title} />
Expand All @@ -257,7 +264,7 @@ const PaidOptionItem = ({ href, ...props }) => {
<Dialog open={open} onClose={handleClose} fullWidth maxWidth="sm">
<DialogTitle>选择支付方式</DialogTitle>
<DialogContent>
<Accordion
<Accordion
expanded={expandedAccordion === "gumroad"}
onChange={handleAccordionChange("gumroad")}
>
Expand All @@ -277,7 +284,7 @@ const PaidOptionItem = ({ href, ...props }) => {
</Button>
</AccordionDetails>
</Accordion>
<Accordion
<Accordion
expanded={expandedAccordion === "wechat"}
onChange={handleAccordionChange("wechat")}
>
Expand All @@ -296,7 +303,7 @@ const PaidOptionItem = ({ href, ...props }) => {
</Box>
</AccordionDetails>
</Accordion>
<Accordion
<Accordion
expanded={expandedAccordion === "alipay"}
onChange={handleAccordionChange("alipay")}
>
Expand All @@ -315,7 +322,7 @@ const PaidOptionItem = ({ href, ...props }) => {
</Box>
</AccordionDetails>
</Accordion>
<Accordion
<Accordion
expanded={expandedAccordion === "stripe"}
onChange={handleAccordionChange("stripe")}
>
Expand Down Expand Up @@ -441,7 +448,9 @@ export default function Donate() {
<br />
<br />

<Typography variant="h6">其他方式</Typography>
<Typography variant="h6">
<Text k="donation.paid.title" />
</Typography>

<br />

Expand Down
2 changes: 1 addition & 1 deletion src/site.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
title: "Geekits",
appName: "Geekits",
description: "Geekits 是一个工具集合,旨在为开发者提供便捷的工具和资源。",
keywords: [
"Geekits",
Expand Down

0 comments on commit badb544

Please sign in to comment.