Skip to content

Auto update download links from GitHub releases#6

Merged
cristian-tamblay merged 2 commits into
mainfrom
fix/download-links
May 4, 2026
Merged

Auto update download links from GitHub releases#6
cristian-tamblay merged 2 commits into
mainfrom
fix/download-links

Conversation

@Irozuku
Copy link
Copy Markdown
Collaborator

@Irozuku Irozuku commented Apr 30, 2026

This pull request updates the download section to fetch asset links dynamically from the GitHub API instead of using hardcoded URLs, and fixes a React hydration error caused by the i18n language detection setup.

Download link changes:

  • Added a lib/github.ts utility that fetches the latest release from the GitHub API, maps assets by filename pattern to each platform, and formats file sizes.
  • Updated DownloadSection to fetch the latest release on mount and update each platform card with the direct asset URL, version, and file size, falling back to SourceForge if the request fails.

Hydration fix:

  • Removed LanguageDetector from the i18n initialization chain and set a fixed initial language of "en", so the SSG build and the initial client render always produce matching HTML.
  • Added a useEffect in the home page that detects the browser language after mount and calls i18n.changeLanguage(), preserving auto-detection without causing a hydration mismatch.

Irozuku added 2 commits April 30, 2026 09:50
…Forge

On mount, fetch the latest release from the GitHub API and update each
platform card with the direct asset URL, version, and file size.
Falls back to the SourceForge latest-download URL if the request fails.
LanguageDetector ran synchronously at init, but Node.js (SSG build)
has no navigator, so it fell back to English. The browser then detected
the user's actual language and rendered different text, causing React
hydration errors. Fix: remove LanguageDetector from init, lock initial
language to 'en', and detect + apply browser language after mount.
@Irozuku Irozuku marked this pull request as draft April 30, 2026 18:59
@Irozuku Irozuku marked this pull request as ready for review April 30, 2026 18:59
@cristian-tamblay cristian-tamblay merged commit b57ba2d into main May 4, 2026
1 of 2 checks passed
@Irozuku Irozuku deleted the fix/download-links branch May 25, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants