Using such special cases is a terrible idea in l10n, since many languages have all kinds of different plural forms, while _(" tasks have been removed") assumes only two forms: n<=1 and n>1.
// char * ngettext (const char * msgid, const char * msgid_plural,
unsigned long int n);
show_notification (_("Task finished"), N_(counter.to_string () + " tasks have been removed", "A task has been removed", counter));
Of course, you can do better and use some format strings, since fmt strs can give translators more flexibility and more sense about what they are translating. See https://www.gnu.org/software/gettext/manual/gettext.html#Preparing-Strings. Unfortunately I don't want to look at things like snprintf for now.
Oops, I shouldn't be looking at the C gettext manpage.
Regardless, there is ngettext in Glib (vala): http://valadoc.org/#!api=glib-2.0/GLib.ngettext
// public unowned string ngettext (string msgid, string msgid_plural, ulong n)
// basically the same thing
And you should be able to do format strings like this now:
show_notification (_("Task finished"), N_("%d tasks have been removed", "A task has been removed", counter).printf(counter));
I don't get the point, sorry.
Could you explain what's wrong?