Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion website/app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ import Footer from "@/components/Footer";
import LocaleSwitcher from "@/components/LocaleSwitcher";
import { getDictionary } from "@/getDictionary";
import {Locale} from "../../i18n-config";
import localFont from "next/font/local";

const fushion_12 = localFont({
src: "../fonts/zh_hans-12px.ttf.woff2",
variable: "--font-fushion-12",
display: "swap",
});

const geistSans = Geist({
variable: "--font-geist-sans",
Expand Down Expand Up @@ -50,7 +57,7 @@ export default async function RootLayout({
const dict = await getDictionary(lang as Locale);

return (
<html lang={lang} className={`${geistSans.variable} ${geistMono.variable} ${pressStart2P.variable}`}>
<html lang={lang} className={`${geistSans.variable} ${geistMono.variable} ${pressStart2P.variable} ${fushion_12.variable}`}>
<body className="antialiased">
<div className="min-h-screen flex flex-col bg-gradient-to-b from-green-100 via-white to-green-50">
<LocaleSwitcher />
Expand Down
Binary file added website/app/fonts/zh_hans-12px.ttf.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion website/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
--font-arcade: var(--font-press-start-2p);
--font-arcade: var(--font-press-start-2p), var(--font-fushion-12);
}

@media (prefers-color-scheme: dark) {
Expand Down
1 change: 1 addition & 0 deletions website/components/LocaleSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useState } from "react";
const languageNames: Record<string, string> = {
en: "English",
el: "Ελληνικά",
zh_cn: "简体中文",
};

export default function LocaleSwitcher() {
Expand Down
4 changes: 2 additions & 2 deletions website/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function NavBar({ lang, dict }: { lang: string; dict: any }) {
>
<path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z" />
</svg>
Star
{dict.NavBar.star}
</a>

<a
Expand All @@ -106,7 +106,7 @@ export default function NavBar({ lang, dict }: { lang: string; dict: any }) {
>
<path d="M8 15C-7.333 4.868 3.278-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.723-3.042 23.333 4.868 8 15z" />
</svg>
Sponsor
{dict.NavBar.sponsor}
</a>
</div>

Expand Down
116 changes: 116 additions & 0 deletions website/dictionaries/zh_cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"switcherLabel": "语言:",

"homePage": {
"title": "Retro Arcade",
"subtitle": "Shoot 'em up",
"description": [
"恐龙终结者(Dinosaur Exploder)",
"是一款开源的经典街机射击游戏",
"使用Java,JavaFX和FXGL编写",
"纯粹的像素射击,纯粹的乐趣!"
],
"button": "GitHub",
"sponsorDescr": {
"title": "Sponsor Julien Von Der Marck on GitHub Sponsors",
"heart": "Sponsor",
"descr": "Passionate open-source dev. I maintain Dinosaur Exploder, a free Java/FXGL shoot ’em up. Welcoming & guiding new contributors every day! 🦖✨"
}
},

"NavBar": {
"howGameWorks": "游戏机制",
"credits": "特别鸣谢",
"contact": "联系我们",
"star": "Star",
"sponsor": "赞助我们"
},

"features": [
{"icon": "🦖", "title": "复古像素\n恐龙激战"},
{"icon": "🕹️", "title": "原汁原味\n街机体验"},
{"icon": "🌍","title": "开源免费\n用爱发电"}
],

"footer": "Dinosaur Exploder — 用爱发电 — Java/JavaFX/FXGL — 开源",

"howGameWorks": {
"title": "游戏机制",
"goal": {
"title": "游戏目标",
"descr": "你控制着一个飞船行驶在一个复古街机风格的竞技场中。你的目标很简单:在不断袭来的恐龙浪潮中生存下来,并尽可能获得高分。"
},
"gameplay":{
"title": "核心玩法",
"steps": [
"移动你的飞船来躲避敌人和子弹。",
"射击恐龙以获得分数并清屏。",
"在危急时刻使用护盾来求生。",
"当屏幕上挤满敌人时使用炸弹(它会清除所有恐龙)。"
],
"difficulty": "随着时间推移,出现的恐龙会越来越多,难度也会随之提升。"
},
"controls": {
"title": "控制",
"headers": {
"key": "按键",
"action": "操作"
},
"list": [
{"key": "↑ ↓ ← →", "action": "移动飞船"},
{"key": "Space", "action": "开火"},
{"key": "E", "action": "激活护盾(短时间)"},
{"key": "B", "action": "炸弹(清除屏幕上的所有恐龙)"},
{"key": "Esc", "action": "暂停"}
]
},
"demo": {
"title": "游戏演示",
"error": "哎呀,你的浏览器不支持视频标签。",
"description": "一个简短的游戏演示,展示了移动、射击和敌人的攻击波次。"
},
"help":{
"title": "想出一份力吗?",
"description": "你可以为游戏(Java/FXGL)或网站(Next.js)做贡献。查看GitHub issues并选择一个小任务开始。"
}
},

"credits": {
"title": "特别鸣谢",
"description": "多亏了社区,这个项目才能长久运营下去。如下是GitHub贡献者们 ❤️",
"error": "目前无法加载贡献者们(GitHub API限制或网络问题)。请稍后再试。",
"single": "contribution",
"plural": "contributions",
"addName": {
"title": "留下你的名字",
"description": "想要让你的名字出现在列表中吗?提交一个PR(游戏或网站),GitHub会自动将你包含在内。"
}
},

"contact": {
"title": "联系我们",
"description": "如果你有任何问题、建议,或者只是想说声嗨,欢迎通过以下方式联系我们!",
"links": {
"github": {
"title": "GitHub Discussions",
"description": "提出问题,分享想法,参与社区讨论。"
},
"discord": {
"title": "Discord",
"description": "加入社区日常交流。"
},
"twitter": {
"title": "Twitter",
"description": "跟进最新动态和开发进展。"
},
"sponsor": {
"title": "Sponsor",
"description": "如果你喜欢这个项目,可以赞助我们的开发。"
}
},
"contribute": {
"title": "加入我们",
"description": "想要支持这个项目吗?在GitHub上选择一个Issue,修改/website文件夹中的内容。"
}
}
}
5 changes: 3 additions & 2 deletions website/getDictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import 'server-only'
//define language options
const dictionaries = {
en: () => import('./dictionaries/en.json').then((module) => module.default),
el: () => import('./dictionaries/el.json').then((module) => module.default)
el: () => import('./dictionaries/el.json').then((module) => module.default),
zh_cn: () => import('./dictionaries/zh_cn.json').then((module) => module.default)
}

export const getDictionary = async (locale: 'en' | 'el') => {
export const getDictionary = async (locale: 'en' | 'el' | 'zh_cn') => {
//set english as default language
return dictionaries[locale] ? dictionaries[locale]() : dictionaries.en()
}
2 changes: 1 addition & 1 deletion website/i18n-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

export const i18n = {
defaultLocale: 'en',
locales: ['en', 'el'], // language options
locales: ['en', 'el', 'zh_cn'], // language options
} as const

export type Locale = (typeof i18n)['locales'][number]