Implementation of the ngettext function.