Maximiliano Sandoval <m.sando...@proxmox.com> writes: > @@ -112,6 +136,20 @@ function gettext(buf) { > } > return data[0] || buf; > } > + > +function ngettext(singular, plural, n) { > + const msg_idx = Number($plural_forms); > + const digest = fnv31a(singular); > + const translation = __proxmox_i18n_plurals_msgcat__[digest]; > + if (!translation[msg_idx]) {
This should be: if (!translation || msg_idx >= translation.length) { or similar. It is possible a message might be missing translations for certain plural forms. > + if (n === 1) { > + return singular; > + } else { > + return plural; > + } > + } > + return translation[msg_idx]; > +} > __EOD > > if ($outfile) { -- Maximiliano _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel