Search code examples
ruby-on-railsinternationalizationpluralizesingular

pluralize and singularize for spanish language


sorry for my english...

I have a rails application developed to spain, therefore, all content is in spanish, so, I have a search box to search in a mysql database, all rows are in spanish, I'd like to improve my search to allow to users to search keywords in singular or plural form, for example:

keyword: patatas
found: patata

keyword: veces
found: vez

keyword: vez
found: veces

keyword: actividades
found: actividad

In english, this could be relatively easy with help of singularize and pluralize methods ...

where `searching_field` like '%singularized_keyword%' or `searching_field` like '%pluralized_keyword%'

But, for spanish....

Some help?

Thanks!


Solution

  • I found this great way: http://www.slideshare.net/crnixon/advanced-internationalization-with-rails

    Regards.