Pluralize Flag/Unflag Link Text I want to rewrite the link text for Flags such that it includes the number of flaggings for that node, as pluralizing the output.

e.g.


1 Flag
3 Flags


I can get as far as getting the flag count and pluralizing the output using a field rewrite, but the Ajax link breaks, and the field can no longer be clicked to flag or unflag the node.

I've tried the dlike module, but this doesn't seem help with pluralizing the flag/unflag link
I found I was able to do this by changing the flag link text (in the flag configuration) to [node:flag-machinename-vote-count], which gave the number of flag for that node.

Then, modifying line 57 of the flag theme file: flag.tpl.php to

&lt;a href="&lt;?php print $link_href; ?&gt;" title="&lt;?php print $link_title; ?&gt;" class="&lt;?php print $flag_classes ?&gt;" rel="nofollow"&gt;&lt;?php print format_plural($link_text, '1 Flag', '@count Flags') ; ?&gt;&lt;/a&gt;&lt;span class="flag-throbber"&gt;&amp;nbsp;&lt;/span&gt;


Note that this is actually only changing the small php snippet that displays the link text to us the format_plural function:

this &lt;?php print $link_text; ?&gt;

to this &lt;?php print format_plural($link_text, '1 Flag', '@count Flags') ; ?&gt;