Skip to content

Feat/russian error free#359

Open
neelavradutta wants to merge 2 commits into
physicshub:mainfrom
neelavradutta:feat/russian-error-free
Open

Feat/russian error free#359
neelavradutta wants to merge 2 commits into
physicshub:mainfrom
neelavradutta:feat/russian-error-free

Conversation

@neelavradutta

Copy link
Copy Markdown
Contributor

📘 Pull Request Template – PhysicsHub

Thank you for contributing to PhysicsHub!
Please complete the sections below to help us review your pull request efficiently.


🔍 Description

support for russian lang is added with a button to switch

Closes #357


✅ Checklist

Before requesting a review, please ensure that you have:

  • [done] Verified that the project builds and runs locally (npm run dev)
  • [done] Ensured no ESLint or TypeScript warnings/errors remain
  • [done] Updated documentation, comments, or in-code explanations where needed
  • Verified responsiveness across devices (desktop, tablet, mobile)
  • Followed the CONTRIBUTING.md guidelines

🎨 Visual Changes (if UI-related)

IF CHANGES ARE RELATED TO SIMULATIONS PLEASE SEND A SHORT CLIP ABOUT IT
(OBLIGATORY)

redpandacompress_Recording.2026-06-20.120534.mp4

📂 Type of Change

  • [yes ] 🐛 Bug fix (non-breaking change that fixes an issue)
  • [ yes] ✨ New feature (non-breaking change that adds functionality)
  • [ yes] 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • ♻️ Refactor / code quality improvement
  • 🎨 UI/UX enhancement
  • 🔒 Security improvement

🧩 Additional Notes for Reviewers

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

@neelavradutta is attempting to deploy a commit to the PhysicsHub's projects Team on Vercel.

A member of the Team first needs to authorize it.

@mattqdev

Copy link
Copy Markdown
Collaborator

Hey thank you for this! I see a lot of more changes than russian translation. Can you please explain all the changes you made?

@neelavradutta

Copy link
Copy Markdown
Contributor Author

Hey thank you for this! I see a lot of more changes than russian translation. Can you please explain all the changes you made?

Summary of Changes

This PR adds Russian language support, improves the translation system, and makes GitHub statistics/contributor data more reliable by introducing build-time fallbacks.

Internationalization (i18n)
Added complete Russian locale (ru.json) and registered Russian as a completed language in meta.json.
Added automatic locale generation scripts (generate-ru-locale.mjs, seed-ru-locale.mjs) with translation caching support.
Improved useTranslation to load locales dynamically and handle fallback languages more reliably.
Updated LanguageSwitcher to synchronize the document language attribute (lang) with the selected language.
Updated Tag component so tag names are translated through the i18n system.

GitHub Stats & Contributors
Added build-time GitHub data generation (scripts/github-stats.js).

Added cached fallback datasets:
githubStats.json
githubContributors.json

Created shared helper utilities (lib/githubStats.js) for loading GitHub stats/contributors with:
timeout handling
API fallback support
graceful failure behavior

Refactored:
GitHubHeaderBadge
ContributorsSection
About page

to use fallback data first and then refresh with live GitHub API data.

UI / Reliability Improvements
Replaced contributor avatars with a fallback strategy when GitHub avatar loading fails.
Added image styling improvements (object-fit: cover) for contributor avatars.
Added hydration warning suppression in layout.tsx to avoid client/server mismatch warnings.
Added missing translation keys for navigation items such as Home, About, Contribute, and Simulations.

Build Process
Updated build pipeline to generate GitHub stats automatically before next build.
Added google-translate-api-x dependency for locale generation workflows.

Reasons :-
Enable Russian localization across the site.
Reduce dependence on live GitHub API availability/rate limits.
Improve SSR hydration stability.
Ensure contributor and repository statistics remain visible even when GitHub requests fail.

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.

[Feat]: Add russian translation

2 participants