apply locale to header and footer.

This commit is contained in:
Xin Feng
2025-09-04 22:50:52 +03:00
parent 1df7c8fd69
commit 98d3263f35
5 changed files with 55 additions and 37 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="./fallout2-ce.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>fallout2-ce</title>
<title>Fallout 2 Community Edition</title>
</head>
<body class="dark">
<div id="root"></div>
+39 -34
View File
@@ -1,41 +1,46 @@
import useLang from "@/lib/hooks/useLang";
import translations from "@/locale";
import { SiDiscord, SiTelegram } from "react-icons/si";
// TODO: plz update the links
const Footer = () => (
<footer className="w-full h-16 lg:h-12 shrink-0 flex items-center justify-center bg-background/10 sticky bottom-0 z-20 backdrop-blur-xs border-t-background">
<div className="w-full max-w-4xl justify-between p-4 items-center flex flex-col lg:flex-row gap-2 my-2 text-sm">
<div className="flex gap-6">
<a
href="https://discord.gg/"
target="_blank"
rel="noopener noreferrer"
className="hover:scale-105"
>
<SiDiscord className="h-6 w-6" />
</a>
<a
href="https://t.me/"
target="_blank"
rel="noopener noreferrer"
className="hover:scale-105"
>
<SiTelegram className="h-6 w-6" />
</a>
const Footer = () => {
const { currLang } = useLang();
return (
<footer className="w-full h-16 lg:h-12 shrink-0 flex items-center justify-center bg-background/10 sticky bottom-0 z-20 backdrop-blur-xs border-t-background">
<div className="w-full max-w-4xl justify-between p-4 items-center flex flex-col lg:flex-row gap-2 my-2 text-sm">
<div className="flex gap-6">
<a
href="https://discord.gg/"
target="_blank"
rel="noopener noreferrer"
className="hover:scale-105"
>
<SiDiscord className="h-6 w-6" />
</a>
<a
href="https://t.me/"
target="_blank"
rel="noopener noreferrer"
className="hover:scale-105"
>
<SiTelegram className="h-6 w-6" />
</a>
</div>
<div className="flex justify-center items-center text-xs gap-1">
{translations[currLang].developedBy}{" "}
<a
href="https://github.com/fallout2-ce"
target="_blank"
rel="noopener noreferrer"
className="underline hover:scale-101"
>
https://github.com/fallout2-ce
</a>
</div>
</div>
<div className="flex justify-center items-center text-xs gap-1">
Developed with by{" "}
<a
href="https://github.com/fallout2-ce"
target="_blank"
rel="noopener noreferrer"
className="underline hover:scale-101"
>
https://github.com/fallout2-ce
</a>
</div>
</div>
</footer>
);
</footer>
);
};
export default Footer;
+1 -1
View File
@@ -1,5 +1,5 @@
import { Link } from "react-router";
import LangToggle from "./LangToggle";
import LangToggle from "@/components/LangToggle";
const Header = () => (
<header className="w-full h-16 shrink-0 flex items-center justify-center bg-background/20 sticky top-0 z-20 backdrop-blur-xs border-b-background">
+1 -1
View File
@@ -1,6 +1,6 @@
import { atomWithStorage } from "jotai/utils";
const SupportedLangs = ["sys", "en", "ru"] as const;
const SupportedLangs = ["sys", "en"] as const;
type LangWithSys = (typeof SupportedLangs)[number];
type Lang = Exclude<LangWithSys, "sys">;
+13
View File
@@ -0,0 +1,13 @@
import type { Lang } from "@/lib/stores/langStore";
type TranslationKey = "developedBy" | "title";
const translations: Record<Lang, Record<TranslationKey, string>> = {
en: {
developedBy: "Developed with ❤️ by",
title: "Fallout 2 Community Edition",
},
};
export default translations;
export type { TranslationKey };