diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js index 8f28bd3674..3c0199d7bd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js @@ -4,8 +4,11 @@ function QueryBuilderOverlayController($scope, templateQueryResource, localizationService) { var everything = localizationService.localize("template_allContent"); - var myWebsite = localizationService.localize("template_myWebsite"); + var myWebsite = localizationService.localize("template_websiteRoot"); + var ascendingTranslation = localizationService.localize("template_ascending"); + var descendingTranslation = localizationService.localize("template_descending"); + var vm = this; vm.properties = []; @@ -36,7 +39,13 @@ alias: "", name: "", }, - direction: "ascending" + direction: "ascending", //This is the value for sorting sent to server + translation: { + currentLabel: ascendingTranslation, //This is the localized UI value in the the dialog + ascending: ascendingTranslation, + descending: descendingTranslation + } + } }; @@ -77,7 +86,6 @@ vm.contentPickerOverlay = { view: "contentpicker", show: true, - submitButtonLabel: "Insert", submit: function(model) { var selectedNodeId = model.selection[0].id; @@ -86,7 +94,7 @@ if (selectedNodeId > 0) { query.source = { id: selectedNodeId, name: selectedNodeName }; } else { - query.source.name = "My website"; + query.source.name = myWebsite; delete query.source.id; } @@ -127,8 +135,10 @@ function changeSortOrder(query) { if (query.sort.direction === "ascending") { query.sort.direction = "descending"; + query.sort.translation.currentLabel = query.sort.translation.descending; } else { query.sort.direction = "ascending"; + query.sort.translation.currentLabel = query.sort.translation.ascending; } throttledFunc(); } @@ -137,8 +147,10 @@ query.sort.property = property; if (property.type === "datetime") { query.sort.direction = "descending"; + query.sort.translation.currentLabel = query.sort.translation.descending; } else { query.sort.direction = "ascending"; + query.sort.translation.currentLabel = query.sort.translation.ascending; } throttledFunc(); }