Skip to content
Merged
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
7 changes: 3 additions & 4 deletions components/community/routes/HomeRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
const lang = i18n.language as 'es' | 'en' | 'pt'
const [releases, setReleases] = useState<GhRelease[]>([])
const { stats, isLoading: statsLoading } = useStats()

Expand All @@ -51,9 +51,8 @@ export function HomeRoute({ ghVersion }: { ghVersion: string }) {

function fmtDate(iso: string) {
const d = new Date(iso)
const months = MONTH_NAMES[lang]
if (months) return `${months[d.getMonth()]} ${d.getFullYear()}`
return d.toLocaleString(lang, { month: 'short', year: 'numeric' })
const months = MONTH_NAMES[lang] ?? MONTH_NAMES.es
return `${months[d.getMonth()]} ${d.getFullYear()}`
}

return (
Expand Down
3 changes: 1 addition & 2 deletions public/locales/de/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,5 @@
"tag.tab": "tabellarisch",
"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": "Downloads insgesamt"
}
3 changes: 1 addition & 2 deletions public/locales/zh/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,5 @@
"tag.tab": "表格",
"tag.tr": "翻译",
"hero.stat.stars": "为我们点亮一颗 Star",
"hero.stat.dl": "总下载量",
"hero.stat.updated": "最后更新:{{date}}"
"hero.stat.dl": "总下载量"
}
Loading