Skip to content

Conversation

@Programador-jr
Copy link
Owner

Description:
This PR introduces improvements to the search error handling and language fallback mechanism:

  • Enhanced Search Suggestions: Now suggests the closest matching exercise when a typo is detected.
  • Language Availability Handling: If an exercise is not available in the requested language, it returns a message with the available translation.
  • Dynamic Language Fallback: If an unsupported language (e.g., "es") is requested, the system will use the device's language if it's "en" or "pt"; otherwise, it defaults to English.
  • Validation and Fixes:
    • Fixed an issue where invalid languages returned an empty array instead of an error message.
    • Improved search response consistency across different language settings.

Checklist:

  • Implemented search term suggestion for mistyped queries.
  • Added handling for unavailable exercises in the selected language.
  • Improved error messages and language fallback.
  • Fixed empty array response for unsupported languages.

Impact:
These updates make search results more user-friendly, reducing errors and improving clarity for users searching in different languages.

@vercel
Copy link

vercel bot commented Feb 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
exercise-api ✅ Ready (Inspect) Visit Preview Feb 8, 2025 7:08pm

@Programador-jr Programador-jr merged commit b2d1e13 into main Feb 8, 2025
1 check passed
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