Skip to content

Add i18n (14 languages), code quality improvements, and cookie banner#93

Merged
cahaseler merged 2 commits intoSpaceMolt:mainfrom
Ergoth:feature/i18n-and-improvements
Apr 12, 2026
Merged

Add i18n (14 languages), code quality improvements, and cookie banner#93
cahaseler merged 2 commits intoSpaceMolt:mainfrom
Ergoth:feature/i18n-and-improvements

Conversation

@Ergoth
Copy link
Copy Markdown
Contributor

@Ergoth Ergoth commented Apr 10, 2026

Summary

  • i18n: 14 languages (en, de, fr, es, it, pt, pt-PT, nl, pl, ru, ja, ko, zh, zh-TW) with browser auto-detection and English fallback
  • Code quality: Accessibility fixes, image optimization, error boundary, SEO schemas, canvas performance, security hardening, responsive nav
  • Cookie banner: GDPR-compliant notice for essential-only cookies, translated in all 14 languages
  • Dev experience: SafeClerk wrappers for Clerk-less local development

i18n Details

  • Browser language auto-detection via navigator.language with localStorage persistence
  • Language selector dropdown in nav with AI-translated badges
  • Grammar disclaimer banner for non-English locales
  • All marketing and data browsing pages wired with translations
  • Pages with metadata exports split into server + client content components

Code Quality

  • Accessibility: iframe titles, aria-modal on Lightbox
  • Image optimization: Next.js Image on clients page
  • Error boundary app-wide
  • SEO: JSON-LD schemas, sitemap in robots.txt
  • Canvas perf: prefers-reduced-motion + visibility API on Starfield
  • Security: hex color validation in LiveFeed
  • Nav responsiveness for long translated strings

Cookie Banner

  • Essential cookies only (Clerk auth), no tracking
  • Translated in all 14 languages, dismissible

Test plan

  • Verify all pages load without errors (with CLERK_SECRET_KEY)
  • Test language detection and switching
  • Verify grammar + cookie banners appear and dismiss correctly
  • Check nav layout in German, Russian, Japanese
  • TypeScript: npx tsc --noEmit
  • Mobile responsive check

Translations are AI-generated and may contain grammar errors. Native speaker review recommended.

Generated with Claude Code

i18n:
- 14 languages: en, de, fr, es, it, pt (Brazil), pt-PT (Europe), nl, pl, ru, ja, ko, zh (Simplified), zh-TW (Traditional)
- Browser language auto-detection via navigator.language with English fallback
- Language selector in nav with AI-translated badges
- Grammar disclaimer banner for non-English locales
- All marketing pages, nav, footer, and data browsing pages wired with translations
- Translation keys for ships, stations, market, battles, ticker, forum, changelog, news

Code quality:
- Accessibility: iframe titles, aria-modal on Lightbox
- Image optimization: Next.js Image component on clients page
- Error boundary: catches render crashes app-wide
- SEO: JSON-LD Organization + SoftwareApplication schemas, sitemap in robots.txt
- Canvas performance: prefers-reduced-motion + Page Visibility API on Starfield
- Security: hex color validation in LiveFeed
- Progressive enhancement: noscript fallback
- Nav responsiveness: handles long translated strings without overflow

Cookie banner:
- GDPR-compliant notice for essential-only cookies
- Translated in all 14 languages
- Dismissible with localStorage persistence

Dev experience:
- SafeClerk wrappers + AuthContext for graceful Clerk-less local dev
- Conditional middleware bypass when CLERK_SECRET_KEY is absent

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

@Ergoth is attempting to deploy a commit to the SpaceMolt Team on Vercel.

A member of the Team first needs to authorize it.

@cahaseler
Copy link
Copy Markdown
Contributor

Thanks for the PR — the i18n system looks solid and this is a useful contribution.

One issue we need to address before we can merge: the PR includes auth-related changes that aren't necessary for the translation work and that we're not comfortable merging without a separate review:

  • src/components/SafeClerk.tsx (new)
  • src/components/AuthContext.tsx (new)
  • src/proxy.ts (Clerk middleware conditionally disabled)
  • src/app/layout.tsx (ClerkProvider conditionally wrapped)

It looks like these were added so you could run the site locally without Clerk credentials while developing the translations. That makes sense as a local dev workaround, but we'd rather not ship changes to the auth layer in a translation PR — especially the proxy.ts change that can silently disable middleware if an env var is missing.

The good news is these changes aren't needed. Nav.tsx and GetStartedButton.tsx can import SignedIn, SignedOut, and SignUpButton directly from @clerk/nextjs as before, with the translation calls added alongside the existing Clerk imports.

Could you please:

  1. Remove SafeClerk.tsx and AuthContext.tsx
  2. Revert proxy.ts and the auth-related parts of layout.tsx to their current main state
  3. Restore direct Clerk imports in Nav.tsx and GetStartedButton.tsx

The translation changes in those files can stay — it's just the Clerk swap that needs reverting.

Happy to merge once that's cleaned up.

@Ergoth
Copy link
Copy Markdown
Contributor Author

Ergoth commented Apr 10, 2026

sorry just seen, they should of been in the git ignore and changes reverted... will check quick.

- Remove SafeClerk.tsx and AuthContext.tsx
- Revert proxy.ts to original clerkMiddleware()
- Revert layout.tsx to use ClerkProvider directly
- Restore direct @clerk/nextjs imports in Nav.tsx and GetStartedButton.tsx
- Translation changes in those files are preserved

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Ergoth
Copy link
Copy Markdown
Contributor Author

Ergoth commented Apr 10, 2026

Just seen, in the original commit it wasnt mentioned the robot.txt for SEO purposes was added too.

@cahaseler cahaseler merged commit 936f847 into SpaceMolt:main Apr 12, 2026
1 check failed
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