Skip to content

fix(validation): validate lang parameter against supported languages keys#1889

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
Thacker-Meet:fix/lang-validation
May 30, 2026
Merged

fix(validation): validate lang parameter against supported languages keys#1889
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
Thacker-Meet:fix/lang-validation

Conversation

@Thacker-Meet
Copy link
Copy Markdown
Contributor

Description

Fixes #1796

Changes Made

  • Added supportedLanguages derived from translation keys in badgeLabels.ts
  • Updated streakParamsSchema to validate lang using z.enum()
  • Added .catch('en') fallback behavior for unsupported language inputs
  • Preserved default English fallback behavior

Verification

  • npm run format
  • npm run lint
  • npm run test
  • npm run typecheck
  • Verified invalid lang values fall back to en

Result

  • Valid language inputs continue to work correctly
  • Unsupported language values now safely fall back to English (en)
  • Prevents downstream localization lookup failures during SVG generation

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 30, 2026

@Thacker-Meet is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@JhaSourav07 JhaSourav07 merged commit bd23853 into JhaSourav07:main May 30, 2026
2 of 6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 Congratulations @Thacker-Meet! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@JhaSourav07 JhaSourav07 added GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:exceptional Outstanding contribution with exceptional implementation quality, testing. gssoc:approved PR has been reviewed and accepted for valid contribution points mentor:Aamod007 labels May 30, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone May 30, 2026
@github-actions github-actions Bot added the type:bug Something isn't working as expected label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Validate lang parameter against supported i18n languages

2 participants