Describe the bug
September 22, 2019
[21:22]馃挅 KoBa 馃挅: Vacation Accrued: (Supporter) out of 60 Days
[21:22]馃挅 KoBa 馃挅: that thing only says "out of 60 days" if player has less than 1 day of vacation time available
Expected behavior
Display "0 Days" not ""
Screenshots

Expected behavior
Display "0 Days" not ""
Or make it show "<1 days" instead "0 days" for the sake of clarity?
Or make it show "<1 days" instead "0 days" for the sake of clarity?
It'll depend on whether I need to hardcode it or just change a setting...
I can't tell exactly what this line does;
...but I suspect this is why the function returns "" instead of "0 Days"
any chance @GreenAsJade or @flovo could take a quick look at this for me? I'd rather not hardcode in a back door if I can avoid it.
Below is the whole function the above snippet came from
export function ngettext(singular, plural, count) {
let key = singular + "" + plural;
if (key in catalog) {
if (catalog[key].length === 1) {
count = 1;
}
return catalog[key][count === 1 ? 0 : 1];
}
return debug_wrap(count === 1 ? singular : plural);
}
As a first observation, this works for me:
console.log("NGT DBG", ngettext("a", "b", 1));
console.log("NGT DBG", ngettext("a", "b", 2));
console.log("NGT DBG", ngettext("a", "b", 0));
NGT DBG a
NGT DBG b
NGT DBG b
grr... that's how anoek said it should work... so why isn't it then? :/
_() is just a gettext so I guess it must be inside interpolate() somewhere
... which strongly hints that vacation_time_accrued is not '0' but rather an empty string or some other thing by the time it hits ngettext.
IE check your code and assumptions before blaming the libraries ;)
hmm ok good call maybe math.round small/big doesn't = 0 like I assumed... time for some of my own console logs lol
Thanks @GreenAsJade
It turns out if(0) returns false, who knew 馃槢