1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#include "lix/libutil/english.hh"

namespace nix {

std::ostream & pluralize(
    std::ostream & output,
    unsigned int count,
    const std::string_view single,
    const std::string_view plural)
{
    if (count == 1)
        output << "1 " << single;
    else
        output << count << " " << plural;
    return output;
}

}