If I have a node called "Widget", I'd like to be able to Freelink it using either [[Widget]] or [[Widgets]].

Likewise, if I have a node called "Widgets", I'd like to be able to Freelink it using either [[Widget]] or [[Widgets]].

The following set of rules handles almost all pluralizations (and depluralizations) in English:

  • Add an "s"
  • Add an "es"
  • Change the trailing "y" to "ies" ("cherry" -> "cherries")
  • Change the trailing "f" or "fe" to "ves" ("leaf" -> "leaves", "knife" -> "knives")
  • Change the trailing "us" to "i" ("fungus" -> "fungi")
  • Change the trailing "um" to "a" ("datum" -> "data")

Alternatively, integrating with http://drupal.org/project/l10n_pconfig or http://drupal.org/project/helpers (#300820: Add functions to pluralize and singularize English nouns) might be useful.

Comments

juampynr’s picture

smokris, sounds good, but I have seen the source code of the pluralize patch and seems to me that there is a lot of work pending there. I have also asked it in the #IRC channels and did not get any good response.

Could you help me out to get the best solution for this? It could be nice, as you say, to make it as a dependency on an API which evolves (and ideally takes into account different languages). If there is no such thing already in the community, we could use that patch and offer it as an option in the settings area for Nodetitle plugin (somethink like "Search for pluralized - singularized versions of node titles").

juampynr’s picture

Not sure if http://drupal.org/project/l10n_pconfig is what you are looking for. Please @smokris give me a hand if you have time checking the internals of the module. I am catching up with bug issues for this module at the moment.

gisle’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Issue summary: View changes
Status: Active » Closed (won't fix)

No progress on this in three years.

This will be very hard to do in a way that is language independent. I am not even going to try, so I am closing for now.

Feel free to reopen if you can provide a short patch that implements this feature in a language independent way.