Properly pluralize everything (closes #19)

This commit is contained in:
Bernd Bestel
2018-07-27 19:39:34 +02:00
parent 419445f5ae
commit f583810d5c
16 changed files with 59 additions and 19 deletions

View File

@@ -19,6 +19,16 @@ U = function(relativePath)
return Grocy.BaseUrl.replace(/\/$/, '') + relativePath;
}
Pluralize = function(number, singularForm, pluralForm)
{
var text = singularForm;
if (number != 1 && pluralForm !== null && !pluralForm.isEmpty())
{
text = pluralForm;
}
return text;
}
if (!Grocy.ActiveNav.isEmpty())
{
var menuItem = $('#sidebarResponsive').find("[data-nav-for-page='" + Grocy.ActiveNav + "']");