chromawoods / instaFilta

jQuery plugin for performing in-page filtering
MIT License
41 stars 12 forks source link

Ability to do 'accent insensitive' searches #2

Closed alexbrahastoll closed 9 years ago

alexbrahastoll commented 9 years ago

Hey Andreas,

Great job with the instaFilta plugin! One requirement I had in a project I'm currently working on was to be able to do 'accent insensitive' searches (e.g. the search term 'jose' will match both 'jose' and 'josé'). Since the project was already using your plugin (and it works great!), I decided to fork the repo and extend it so it can also support this functionality. I made my best to respect the coding practices / style I have observed in this codebase. Do you think this feature will also be useful to other users? Maybe we can expand the accentsToFind and replaceWith options default values so they will also work nice for other languages? The default values I put are perfect for Portuguese and probably good for a couple other languages too.

Greetings from Brazil,

Alex.

chromawoods commented 9 years ago

Hi Alex,

Great to hear that instaFilta works for your project! I currently have one other pull request in review, but I will have a look at your changes after that. Your feature makes sense for me too considering my own language (Swedish) has some special characters and I know the feeling of running into frustrating localization issue because of it. I'll get back to you soon!

Regards /Andreas

alexbrahastoll commented 9 years ago

Sure, Andreas, take your time =) If you need me to change anything in the implementation of this new feature, please let me know.

Cheers.

chromawoods commented 9 years ago

Hi Alex, sorry for the late reply.

I gave your pull request some thinking and instead came up with the concept of synonyms, which can be used in a more flexible manner. It basically gives you the freedom of defining any kind of aliases that should match certain user input. It's not bound to single characters either, so for example the Danish character æ can be matched with ae (two characters).

So what I'm trying to say is that I'm closing this pull request. :) No hard feelings!

/Andreas

alexbrahastoll commented 9 years ago

Hey Andreas,

No problem at all! Your solution looks better than what I have proposed, it is more flexible indeed. I will definitely study in detail your implementation as soon as I have some free time. Good job!

Best wishes,

Alex.