More localization of querybuilder

This commit is contained in:
Per Ploug
2017-01-19 12:53:39 +01:00
parent 86ffd66c8a
commit eefd13547c
5 changed files with 27 additions and 11 deletions

View File

@@ -1,7 +1,10 @@
(function () {
"use strict";
function QueryBuilderOverlayController($scope, templateQueryResource) {
function QueryBuilderOverlayController($scope, templateQueryResource, localizationService) {
var everything = localizationService.localize("template_allContent");
var myWebsite = localizationService.localize("template_myWebsite");
var vm = this;
@@ -17,10 +20,10 @@
vm.query = {
contentType: {
name: "Everything"
name: everything
},
source: {
name: "My website"
name: myWebsite
},
filters: [
{
@@ -113,6 +116,12 @@
function trashFilter(query) {
query.filters.splice(query, 1);
//if we remove the last one, add a new one to generate ui for it.
if (query.filters.length == 0) {
query.filters.push({});
}
}
function changeSortOrder(query) {

View File

@@ -5,7 +5,7 @@
<div class="row">
<div class="query-items">
<span><localize key="template_iWant">I Want</localize></span>
<span><localize key="template_iWant">I want</localize></span>
<div class="btn-group">
@@ -91,7 +91,7 @@
<i class="icon-add"></i>
</a>
<a href ng-if="vm.query.filters.length > 1" ng-click="vm.trashFilter(vm.query)">
<a href ng-click="vm.trashFilter(vm.query)">
<i class="icon-trash"></i>
</a>

View File

@@ -1080,8 +1080,11 @@ Mange hilsner fra Umbraco robotten
<key alias="itemsReturned">sider returneret, på</key>
<key alias="iWant">Returner</key>
<key alias="everything">alt</key>
<key alias="allContent">alt indhold</key>
<key alias="contentOfType">indhold af typen &quot;%0%&quot;</key>
<key alias="from">fra</key>
<key alias="websiteRoot">mit website</key>
<key alias="where">filtre</key>
<key alias="and">og</key>

View File

@@ -1096,15 +1096,17 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="queryBuilder">Query builder</key>
<key alias="itemsReturned">items returned, in</key>
<key alias="iWant">I want</key>
<key alias="everything">everything</key>
<key alias="iWant">I want</key>
<key alias="allContent">all content</key>
<key alias="contentOfType">content of type &quot;%0%&quot;</key>
<key alias="from">from</key>
<key alias="websiteRoot">my website</key>
<key alias="where">where</key>
<key alias="and">and</key>
<key alias="template">Template</key>
</area>
<area alias="grid">

View File

@@ -9,6 +9,7 @@ using System;
using System.Diagnostics;
using Umbraco.Web.Dynamics;
using Umbraco.Web.Models.TemplateQuery;
using Umbraco.Core.Services;
namespace Umbraco.Web.Editors
{
@@ -297,9 +298,10 @@ namespace Umbraco.Web.Editors
{
var contentTypes =
ApplicationContext.Services.ContentTypeService.GetAllContentTypes()
.Select(x => new ContentTypeModel() { Alias = x.Alias, Name = x.Name })
.Select(x => new ContentTypeModel() { Alias = x.Alias, Name = Services.TextService.Localize("template/contentOfType", tokens: new string[] { x.Name } ) })
.OrderBy(x => x.Name).ToList();
contentTypes.Insert(0, new ContentTypeModel() { Alias = string.Empty, Name = "Everything" });
contentTypes.Insert(0, new ContentTypeModel() { Alias = string.Empty, Name = Services.TextService.Localize("template/allContent") });
return contentTypes;
}