feat(i18n): centralize more UI texts in messages
Move hardcoded labels/strings in About, Projects, Contact form, Footer and Consent banner into next-intl message files (en/de) so content is maintained in one place. Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
@@ -5,17 +5,15 @@ import { motion } from 'framer-motion';
|
||||
import { Heart, Code } from 'lucide-react';
|
||||
import { SiGithub, SiLinkedin } from 'react-icons/si';
|
||||
import Link from 'next/link';
|
||||
import { useLocale } from "next-intl";
|
||||
import { useLocale, useTranslations } from "next-intl";
|
||||
import { useConsent } from "./ConsentProvider";
|
||||
|
||||
const Footer = () => {
|
||||
const [currentYear, setCurrentYear] = useState(2024);
|
||||
const locale = useLocale();
|
||||
const t = useTranslations("footer");
|
||||
const { resetConsent } = useConsent();
|
||||
|
||||
useEffect(() => {
|
||||
setCurrentYear(new Date().getFullYear());
|
||||
}, []);
|
||||
const [currentYear] = useState(() => new Date().getFullYear());
|
||||
|
||||
const socialLinks = [
|
||||
{ icon: SiGithub, href: 'https://github.com/Denshooter', label: 'GitHub' },
|
||||
@@ -45,7 +43,7 @@ const Footer = () => {
|
||||
<Link href={`/${locale}`} className="text-xl font-bold font-mono text-stone-800 hover:text-liquid-blue transition-colors">
|
||||
dk<span className="text-liquid-rose">0</span>
|
||||
</Link>
|
||||
<p className="text-xs text-stone-500">Software Engineer</p>
|
||||
<p className="text-xs text-stone-500">{t("role")}</p>
|
||||
</div>
|
||||
</motion.div>
|
||||
|
||||
@@ -88,7 +86,7 @@ const Footer = () => {
|
||||
>
|
||||
<Heart size={14} className="text-liquid-rose fill-liquid-rose" />
|
||||
</motion.div>
|
||||
<span>Made in Germany</span>
|
||||
<span>{t("madeIn")}</span>
|
||||
</motion.div>
|
||||
</div>
|
||||
|
||||
@@ -105,21 +103,21 @@ const Footer = () => {
|
||||
href={`/${locale}/legal-notice`}
|
||||
className="text-stone-500 hover:text-stone-800 transition-colors duration-200"
|
||||
>
|
||||
Impressum
|
||||
{t("legalNotice")}
|
||||
</Link>
|
||||
<Link
|
||||
href={`/${locale}/privacy-policy`}
|
||||
className="text-stone-500 hover:text-stone-800 transition-colors duration-200"
|
||||
>
|
||||
Privacy Policy
|
||||
{t("privacyPolicy")}
|
||||
</Link>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => resetConsent()}
|
||||
className="text-stone-500 hover:text-stone-800 transition-colors duration-200"
|
||||
title="Show privacy settings banner again"
|
||||
title={t("privacySettingsTitle")}
|
||||
>
|
||||
Privacy settings
|
||||
{t("privacySettings")}
|
||||
</button>
|
||||
<Link
|
||||
href="/404"
|
||||
@@ -131,7 +129,7 @@ const Footer = () => {
|
||||
</div>
|
||||
|
||||
<div className="text-xs text-stone-400 flex items-center space-x-1">
|
||||
<span>Built with</span>
|
||||
<span>{t("builtWith")}</span>
|
||||
<span className="text-stone-600 font-semibold">Next.js</span>
|
||||
<span className="text-stone-300">•</span>
|
||||
<span className="text-stone-600 font-semibold">TypeScript</span>
|
||||
|
||||
Reference in New Issue
Block a user