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: 4 additions & 3 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 as 'es' | 'en' | 'pt'
const lang = i18n.language
const [releases, setReleases] = useState<GhRelease[]>([])
const { stats, isLoading: statsLoading } = useStats()

Expand All @@ -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 (
Expand Down
1 change: 1 addition & 0 deletions public/locales/de/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
1 change: 1 addition & 0 deletions public/locales/zh/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -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。"
}
Loading