Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance Reciter Search: Support for Bilingual Names (Arabic/English) #1613

Open
YassinNouh21 opened this issue Mar 3, 2025 · 0 comments

Comments

@YassinNouh21
Copy link
Contributor

Description

Currently, the reciter search functionality in the app only allows searching for reciters by the name in the current app language. This feature enhancement will enable users to search for reciters by their names in both Arabic and English, regardless of the app's language setting.

For example:

  • If the app language is set to Arabic, users should be able to search using English names (e.g., searching for "Abdul Basit" while in Arabic mode)
  • If the app language is set to English, users should be able to search using Arabic names (e.g., searching for "عبد الباسط" while in English mode)

This bilingual search functionality will be implemented in the reciter selection screen to improve user experience for those who may know reciters by different name variants.

Current Implementation

The current search functionality in recite_notifier.dart only filters reciters based on the displayed name:

List<ReciterModel> _filterReciters(List<ReciterModel> reciters, String query) {
  if (query.isEmpty) {
    return reciters;
  }
  return reciters.where((reciter) => reciter.name.toLowerCase().contains(query)).toList();
}

Proposed Changes

  1. Update the ReciterModel class to store both Arabic and English names for each reciter
  2. Modify the _filterReciters method in ReciteNotifier class to search in both name fields:
    List<ReciterModel> _filterReciters(List<ReciterModel> reciters, String query) {
      if (query.isEmpty) {
        return reciters;
      }
      return reciters.where((reciter) => 
        reciter.name.toLowerCase().contains(query) || 
        reciter.nameAlternate.toLowerCase().contains(query)
      ).toList();
    }
  3. Ensure the backend API returns both Arabic and English names for each reciter
  4. Update the UI in reciter_selection_screen.dart to handle and display results properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant