diff --git a/localization/strings.pot b/localization/strings.pot index 23a70624..aaf2574e 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -2244,3 +2244,6 @@ msgstr "" msgid "Section" msgstr "" + +msgid "Are you sure to empty the shopping list?" +msgstr "" diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 50ef1b74..ec1ae1f9 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -195,8 +195,14 @@ $(document).on('click', '#add-overdue-expired-products', function(e) $(document).on('click', '#clear-shopping-list', function(e) { + var confirmMessage = __t('Are you sure to empty shopping list "%s"?', $("#selected-shopping-list option:selected").text()); + if (!BoolVal(Grocy.FeatureFlags.GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)) + { + confirmMessage = __t('Are you sure to empty the shopping list?'); + } + bootbox.confirm({ - message: __t('Are you sure to empty shopping list "%s"?', $("#selected-shopping-list option:selected").text()), + message: confirmMessage, closeButton: false, buttons: { confirm: {