Skip to content

fix(settings): validate language against supported locales#798

Open
Olasunkanmi975 wants to merge 4 commits into
rinafcode:mainfrom
Olasunkanmi975:fix/language-allowlist-validation
Open

fix(settings): validate language against supported locales#798
Olasunkanmi975 wants to merge 4 commits into
rinafcode:mainfrom
Olasunkanmi975:fix/language-allowlist-validation

Conversation

@Olasunkanmi975

Copy link
Copy Markdown

##closed #779

Summary

Replaces the language length check with allowlist validation to ensure only supported locales are stored in the settings store. Unsupported locale values now automatically fall back to the default language.

Changes

  • Imported SUPPORTED_LANGUAGES and DEFAULT_LANGUAGE from src/locales/config.ts.
  • Updated patchSettings to validate language values against the supported locale allowlist.
  • Replaced unsupported locales with the default language before storing.
  • Removed the previous 24-character length clamp.
  • Added tests covering valid and unsupported locale behavior.

Testing

Covered:

  • Valid locale is stored successfully.
  • Unsupported locale falls back to the default language.
  • Supported locales continue to behave as expected.

Validation

npm test
npm run lint
npm run build

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Olasunkanmi975 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Kindly resolve conflict and fix workflow.

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Great job so far

There’s are just two blockers — the workflow is failing and the conflict. Could you take a look and fix it so all checks pass?

Happy to review again once that’s done.
You can pull from the main first before pushing. The workflow should pass

@Olasunkanmi975

Copy link
Copy Markdown
Author

Hi maintainer, please review this pr

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

The workflow is still failing

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.

[Refactor] settingsStore clamps language to 24 chars without validating against allowed locales

2 participants