diff --git a/components/community/routes/HomeRoute.tsx b/components/community/routes/HomeRoute.tsx index 6af525d..093a6c7 100644 --- a/components/community/routes/HomeRoute.tsx +++ b/components/community/routes/HomeRoute.tsx @@ -34,7 +34,7 @@ function formatUpdatedAt(iso: string, lang: string): string { export function HomeRoute({ ghVersion }: { ghVersion: string }) { const { t, i18n } = useTranslation('home') const th = (key: string) => ({ __html: t(key) }) - const lang = i18n.language as 'es' | 'en' | 'pt' + const lang = i18n.language const [releases, setReleases] = useState([]) const { stats, isLoading: statsLoading } = useStats() @@ -51,8 +51,9 @@ export function HomeRoute({ ghVersion }: { ghVersion: string }) { function fmtDate(iso: string) { const d = new Date(iso) - const months = MONTH_NAMES[lang] ?? MONTH_NAMES.es - return `${months[d.getMonth()]} ${d.getFullYear()}` + const months = MONTH_NAMES[lang] + if (months) return `${months[d.getMonth()]} ${d.getFullYear()}` + return d.toLocaleString(lang, { month: 'short', year: 'numeric' }) } return ( diff --git a/public/locales/de/home.json b/public/locales/de/home.json index 6a3b18c..b07902a 100644 --- a/public/locales/de/home.json +++ b/public/locales/de/home.json @@ -130,5 +130,6 @@ "tag.tr": "Übersetzung", "hero.stat.stars": "Unterstütze uns mit einem Stern", "hero.stat.dl": "Downloads insgesamt", + "hero.stat.updated": "Letzte Aktualisierung: {{date}}", "hero.stat.dl.note": "* Downloads gezählt über SourceForge, PyPI (via Google BigQuery), diese Website und GitHub." } diff --git a/public/locales/zh/home.json b/public/locales/zh/home.json index c80222e..8cafa39 100644 --- a/public/locales/zh/home.json +++ b/public/locales/zh/home.json @@ -130,5 +130,6 @@ "tag.tr": "翻译", "hero.stat.stars": "为我们点亮一颗 Star", "hero.stat.dl": "总下载量", + "hero.stat.updated": "最后更新:{{date}}", "hero.stat.dl.note": "* 下载量统计自 SourceForge、PyPI(通过 Google BigQuery)、本网站和 GitHub。" }