From 9b9db23461b18d9b5b971f389a800d0fd41b1a34 Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Fri, 13 Jan 2017 13:20:38 +0100 Subject: [PATCH] Replaces the last static strings with language keys --- .../overlays/insert/insert.controller.js | 17 ++++---- .../views/common/overlays/insert/insert.html | 2 +- .../overlays/querybuilder/querybuilder.html | 2 +- .../templatesections/templatesections.html | 40 +++++++------------ .../src/views/templates/edit.controller.js | 15 +++---- .../src/views/templates/edit.html | 2 +- .../Models/ContentEditing/TemplateDisplay.cs | 3 ++ 7 files changed, 37 insertions(+), 44 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js index 59a00a5797..b99dd289b1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js @@ -1,16 +1,16 @@ (function () { "use strict"; - function InsertOverlayController($scope) { + function InsertOverlayController($scope, localizationService) { var vm = this; if(!$scope.model.title) { - $scope.model.title = "Insert"; + $scope.model.title = localizationService.localize("template_insert"); } if(!$scope.model.subtitle) { - $scope.model.subtitle = "Choose what to insert into your template"; + $scope.model.subtitle = localizationService.localize("template_insertDesc"); } vm.openMacroPicker = openMacroPicker; @@ -22,7 +22,7 @@ vm.macroPickerOverlay = { view: "macropicker", - title: "Insert macro", + title: localizationService.localize("template_insertMacro"), dialogData: {}, show: true, submit: function(model) { @@ -45,8 +45,8 @@ function openPageFieldOverlay() { vm.pageFieldOverlay = { - title: "Insert value", - description: "Select a value from the currentpage", + title: localizationService.localize("template_insertPageField"), + description: localizationService.localize("template_insertPageFieldDesc"), submitButtonLabel: "Insert", closeButtonlabel: "Cancel", view: "insertfield", @@ -78,7 +78,8 @@ treeAlias: "dictionary", entityType: "dictionary", multiPicker: false, - title: "Insert dictionary item", + title: localizationService.localize("template_insertDictionaryItem"), + description: localizationService.localize("template_insertDictionaryItemDesc"), show: true, select: function(node){ @@ -108,7 +109,7 @@ entityType: "partialView", multiPicker: false, show: true, - title: "Insert partial view", + title: localizationService.localize("template_insertPartialView"), select: function(node){ diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html index 4b92ea86ad..c2926f6acc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html @@ -24,7 +24,7 @@
-
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html index e9be97b7df..678733f1c8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html @@ -22,7 +22,7 @@ - from + from {{vm.query.source.name}} diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/templatesections/templatesections.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/templatesections/templatesections.html index 1a11d6a46e..ee62c3426d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/templatesections/templatesections.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/templatesections/templatesections.html @@ -1,71 +1,59 @@
-
+
-
Render child template
+
- Renders the contents of a child template, by inserting a - @RenderBody() placeholder. +
-
+
-
Render a named section
+
- Renders a named area of a child template, by insert a @RenderSection(name) placeholder. - This renders an area of a child template which is wrapped in a corresponding @section [name]{ ... } definition. +
- + -
- Set the name of the section to render in this area of the template -
+
- If mandatory, the child template must contain a @section definition, otherwise an error is shown. +
-
+
-
Define a named section
+
- Defines a part of your template as a named section by wrapping it in - a @section { ... }. This can be rendered in a - specific area of the master of this template, by using @RenderSection. +
- + -
- Give the section a name -
- -
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js index 8e2b8337ad..97aa50cbbf 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js @@ -220,7 +220,7 @@ view: "macropicker", dialogData: {}, show: true, - title: "Insert macro", + title: localizationService.localize("template_insertMacro"), submit: function (model) { var macroObject = macroService.collectValueData(model.selectedMacro, model.macroParams, "Mvc"); @@ -247,6 +247,7 @@ closeButtonlabel: "Cancel", view: "insertfield", show: true, + title: localizationService.localize("template_insertPageField"), submit: function (model) { insert(model.umbracoField); vm.pageFieldOverlay.show = false; @@ -271,7 +272,7 @@ entityType: "dictionary", multiPicker: false, show: true, - title: "Insert dictionary item", + title: localizationService.localize("template_insertDictionaryItem"), select: function(node){ //crappy hack due to dictionary items not in umbracoNode table var code = "@Umbraco.GetDictionaryValue(\"" + node.name + "\")"; @@ -298,7 +299,7 @@ entityType: "partialView", multiPicker: false, show: true, - title: "Insert Partial view", + title: localizationService.localize("template_insertPartialView"), select: function(node){ //crappy hack due to dictionary items not in umbracoNode table var nodeNameWithPath = node.id.replace(".cshtml", ""); @@ -322,7 +323,7 @@ vm.queryBuilderOverlay = { view: "querybuilder", show: true, - title: "Query for content", + title: localizationService.localize("template_queryBuilder"), submit: function (model) { @@ -356,7 +357,7 @@ vm.sectionsOverlay = { view: "templatesections", - hasMaster: vm.template.masterTemplateAlias, + isMaster: vm.template.isMasterTemplate, submitButtonLabel: "Insert", show: true, submit: function(model) { @@ -401,7 +402,7 @@ vm.masterTemplateOverlay = { view: "itempicker", - title: "Choose master template", + title: localizationService.localize("template_mastertemplate"), availableItems: availableMasterTemplates, show: true, submit: function(model) { @@ -457,7 +458,7 @@ return templateName; } else { - return "No master"; + return "no master"; } } diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html index b0e15e8ad7..2e5593894c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html @@ -62,7 +62,7 @@
  • Value
  • Partial view
  • Dictionary
  • -
  • Macro
  • +
  • Macro
  • diff --git a/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs index 8e813bd3d3..91c1aefdb0 100644 --- a/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs @@ -36,6 +36,9 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "masterTemplateAlias")] public string MasterTemplateAlias { get; set; } + [DataMember(Name = "isMasterTemplate")] + public bool IsMasterTemplate { get; set; } + /// /// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes. ///