From 7e49d012735f2cedf64ec3bae26046226815df0d Mon Sep 17 00:00:00 2001 From: gearsdigital Date: Tue, 16 Aug 2022 21:23:52 +0200 Subject: [PATCH] fix(localization): add missing localizations and translations --- README.md | 52 ++++++++++++++++--- index.css | 2 +- index.js | 2 +- .../EnhancedToolbarAutosuggestField.vue | 8 ++- translations.php | 9 ++++ 5 files changed, 62 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d04554e..3695a36 100755 --- a/README.md +++ b/README.md @@ -15,12 +15,13 @@ This plugin extends the default link dialog with a search functionality. This ma These are all available configuration options and their default values. -| Option | Description | Type | Default | -|-------------|-----------------------------------------------------------------------------------------------------------------------------------|-----------|--------------------| -| `title` | Format the page title of the result list using [Kirby Query Language](https://getkirby.com/docs/guide/blueprints/query-language). | `string` | `{{ page.title }}` | -| `filter` | Filter the result list. Learn how to use [`filterBy`](https://getkirby.com/docs/reference/objects/toolkit/collection/filter-by). | `array` | `null` | -| `sort` | Sort the result list. Learn how to use [`sortBy`](https://getkirby.com/docs/reference/objects/toolkit/collection/sort-by). | `array` | `null` | -| `qualified` | Prefix every link with your current [Site-Url](https://getkirby.com/docs/reference/objects/cms/site/url). | `boolean` | `false` | +| Option | Description | Type | Default | +|----------------|-----------------------------------------------------------------------------------------------------------------------------------|-----------|--------------------| +| `title` | Format the page title of the result list using [Kirby Query Language](https://getkirby.com/docs/guide/blueprints/query-language). | `string` | `{{ page.title }}` | +| `filter` | Filter the result list. Learn how to use [`filterBy`](https://getkirby.com/docs/reference/objects/toolkit/collection/filter-by). | `array` | `null` | +| `sort` | Sort the result list. Learn how to use [`sortBy`](https://getkirby.com/docs/reference/objects/toolkit/collection/sort-by). | `array` | `null` | +| `qualified` | Prefix every link with your current [Site-Url](https://getkirby.com/docs/reference/objects/cms/site/url). | `boolean` | `false` | +| `translations` | [Override plugin translations](#localization). | `array` | `[]` | ### Usage @@ -31,7 +32,8 @@ return [ "title" => "{{ page.title }}", "filter" => null, "sort" => null, - "qualified" => false + "qualified" => false, + "translations" => [] ] ]; ``` @@ -89,6 +91,42 @@ Filtering compendium to learn more about filtering collections in Kirby.

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. +## Localization + +This is the list of all available translation keys: + +| Key | Value | +|---------------------------------------------------------------------------|-----------------------------| +| `gearsdigital.enhanced-toolbar-link-dialog.anchor.title` | Anchor | +| `gearsdigital.enhanced-toolbar-link-dialog.field.autosuggest.placeholder` | Enter a URL or search term… | + + +You can override translations by adding this to your site config. + +```php +// site/config/config.php +return [ + "gearsdigital.enhanced-toolbar-link-dialog" => [ + "translations" => [ + "en" => [ + "gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder" => "I'm overridden!", + ], + ], + ] +] +``` + +### Available languages + +- English (default) +- German 🇩🇪 +- French 🇫🇷 +- Dutch 🇳🇱 +- Danish 🇩🇰 +- Norwegian 🇳🇴 +- Swedish 🇸🇪 +- Islandic 🇮🇸 + ## License [MIT](https://choosealicense.com/licenses/mit/) diff --git a/index.css b/index.css index 2a64ccc..c4b9642 100644 --- a/index.css +++ b/index.css @@ -1 +1 @@ -.k-input[data-theme=field] .k-input-before{user-select:none}.k-dialog-body form{min-height:340px}dialog[open][data-v-521b6e04]{z-index:var(--z-dialog);background-color:var(--color-gray-100);box-shadow:var(--shadow-dropdown);margin:0;padding:4px;border:0;top:70px;width:100%;height:268px;display:flex;flex-direction:column}dialog>div[data-v-521b6e04]{margin-bottom:4px}[data-v-521b6e04] .k-pagination{margin-top:auto;margin-bottom:0}[data-v-521b6e04] .k-pagination-details{pointer-events:none}[data-v-521b6e04] .k-item{margin-bottom:4px}[data-v-521b6e04] .k-item:last-child{margin-bottom:0}[data-v-521b6e04] img{object-fit:cover}dialog>div[data-v-521b6e04]:focus{outline:none}dialog>div[data-v-521b6e04]:focus>.k-item{outline:2px solid var(--color-black)}.enhanced-toolbar-autosuggest-field[data-v-158d91ac]{position:relative} +.k-input[data-theme=field] .k-input-before{user-select:none}.k-dialog-body form{min-height:340px}dialog[open][data-v-b8f6aa9f]{z-index:var(--z-dialog);background-color:var(--color-gray-100);box-shadow:var(--shadow-dropdown);margin:0;padding:4px;border:0;top:70px;width:100%;height:268px;display:flex;flex-direction:column}[data-v-b8f6aa9f] .k-pagination{margin-top:auto;margin-bottom:0}[data-v-b8f6aa9f] .k-pagination-details{pointer-events:none}[data-v-b8f6aa9f] .k-item{margin-bottom:4px}[data-v-b8f6aa9f] .k-item:last-child{margin-bottom:0}[data-v-b8f6aa9f] img{object-fit:cover}dialog>div[data-v-b8f6aa9f]{margin-bottom:4px}dialog>div[data-v-b8f6aa9f]:focus{outline:none}dialog>div[data-v-b8f6aa9f]:focus>.k-item{outline:2px solid var(--color-black)}.enhanced-toolbar-autosuggest-field[data-v-f1fbdecd]{position:relative} diff --git a/index.js b/index.js index b26fc98..18efe92 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -(function(){"use strict";function o(t,e,i,n,l,h,c,R){var r=typeof t=="function"?t.options:t;e&&(r.render=e,r.staticRenderFns=i,r._compiled=!0),n&&(r.functional=!0),h&&(r._scopeId="data-v-"+h);var s;if(c?(s=function(a){a=a||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!a&&typeof __VUE_SSR_CONTEXT__<"u"&&(a=__VUE_SSR_CONTEXT__),l&&l.call(this,a),a&&a._registeredComponents&&a._registeredComponents.add(c)},r._ssrRegister=s):l&&(s=R?function(){l.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:l),s)if(r.functional){r._injectStyles=s;var S=r.render;r.render=function(D,u){return s.call(u),S(D,u)}}else{var d=r.beforeCreate;r.beforeCreate=d?[].concat(d,s):[s]}return{exports:t,options:r}}const g={data(){return{link:{href:null,title:null,target:!1,text:null,anchor:null}}},computed:{fields(){return{href:{label:this.$t("link"),type:"autosuggest",id:this.link.href},text:{label:this.$t("link.text"),type:"text",icon:"title"},title:{label:this.$t("title"),type:"text",counter:!1,icon:"title"},anchor:{label:this.$t("gearsdigital.enhanced-toolbar-link-dialog.anchor.title"),type:"text",counter:!1,before:"#",width:"1/2"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")],width:"1/2"}}},kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.link.text=e,this.$refs.dialog.open(),this.addListener()},close(){this.$emit("cancel"),this.removeListener(),this.link={href:null,title:null,target:!1,text:null,anchor:null}},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.link={href:null,title:null,target:!1,text:null,anchor:null},this.$refs.dialog.close()},createKirbytext(){const t=[];return t.push(`link: ${this.appendAnchor(this.link.href)}`),this.link.text&&this.link.text.length>0&&t.push(`text: ${this.link.text}`),this.link.title&&this.link.title.length>0&&t.push(`title: ${this.link.title}`),this.link.target&&t.push("target: _blank"),`(${t.join(" ")})`},createMarkdown(){return this.link.text.length>0?`[${this.link.text}](${this.link.href})`:`<${this.link.href}>`},appendAnchor(t){let e=this.$refs.dialog.model.anchor;return e?(t||(t=""),e.startsWith("#")?t+e:t+"#"+e):t},listener(t){t.detail.page!==null&&(this.link={...this.link,href:t.detail.page.link,title:t.detail.page.text})},addListener(){document.addEventListener("enhanced-toolbar-link-dialog/page",this.listener)},removeListener(){document.removeEventListener("enhanced-toolbar-link-dialog/page",this.listener)}}};var f=function(){var e=this,i=e._self._c;return i("k-form-dialog",{ref:"dialog",attrs:{fields:e.fields,"submit-button":e.$t("confirm"),size:"medium"},on:{close:e.close,submit:e.submit},model:{value:e.link,callback:function(n){e.link=n},expression:"link"}})},p=[],m=o(g,f,p,!1,null,null,null,null);const _=m.exports,F="",k={data(){return{link:{href:null,title:null,target:!1,anchor:null}}},computed:{fields(){return{href:{label:this.$t("link"),type:"autosuggest",id:this.link.href},title:{label:this.$t("title"),type:"text",counter:!1,icon:"title"},anchor:{label:this.$t("gearsdigital.enhanced-toolbar-link-dialog.anchor.title"),type:"text",counter:!1,before:"#",width:"1/2"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")],width:"1/2"}}}},methods:{open(t){this.link={title:null,target:!1,anchor:null,...this.extendWithAnchor(t)},this.link.target=Boolean(this.link.target),this.$refs.dialog.open(),this.addListener()},close(){this.$emit("close"),this.removeListener()},submit(){this.link.href=this.appendAnchor(this.link.href),this.$emit("submit",{...this.link,target:this.link.target?"_blank":null}),this.$refs.dialog.close()},extendWithAnchor(t){var i,n;if(!t.href)return t;const e=t.href.split("#");return{...t,href:(i=e[0])!=null?i:null,anchor:(n=e[1])!=null?n:null}},appendAnchor(t){let e=this.$refs.dialog.model.anchor;return e?(t||(t=""),e.startsWith("#")?t+e:t+"#"+e):t},listener(t){t.detail.page===null?this.link={href:null,title:null,target:!1}:this.link={...this.link,href:t.detail.page.link,title:t.detail.page.text}},addListener(){document.addEventListener("enhanced-toolbar-link-dialog/page",this.listener)},removeListener(){document.removeEventListener("enhanced-toolbar-link-dialog/page",this.listener)}}};var b=function(){var e=this,i=e._self._c;return i("k-form-dialog",{ref:"dialog",attrs:{fields:e.fields,"submit-button":e.$t("confirm"),size:"medium"},on:{close:e.close,submit:e.submit},model:{value:e.link,callback:function(n){e.link=n},expression:"link"}})},$=[],v=o(k,b,$,!1,null,null,null,null);const x=v.exports,N="",y={name:"EnhancedToolbarDropdown",props:{pages:{type:Array},pagination:{type:{page:Number,total:Number,limit:Number}}},data(){return{open:!0,currentItem:0}},watch:{pages(){this.focusCurrentItem()}},mounted(){this.focusCurrentItem(),window.addEventListener("keydown",this.keydownListener)},destroyed(){window.removeEventListener("keydown",this.keydownListener)},methods:{select(t){this.$emit("select",t),this.open=!1,this.currentItem=0},focusCurrentItem(){document.querySelector(`.enhanced-toolbar-dialog-element div[data-index="${this.currentItem}"]`).focus()},blurCurrentItem(){document.querySelector(`.enhanced-toolbar-dialog-element div[data-index="${this.currentItem}"]`).blur()},keydownListener(t){var l;const e=this.currentItem0,n=t.code;n==="ArrowDown"&&e&&(this.blurCurrentItem(),this.currentItem++,this.focusCurrentItem()),n==="ArrowUp"&&i&&(this.blurCurrentItem(),this.currentItem--,this.focusCurrentItem()),n==="Tab"&&(this.currentItem=(l=parseInt(document.activeElement.getAttribute("data-index"),10))!=null?l:0),n==="Enter"&&(t.stopPropagation(),t.preventDefault(),this.select(this.pages[this.currentItem]))}}};var w=function(){var e=this,i=e._self._c;return i("dialog",{staticClass:"enhanced-toolbar-dialog-element",attrs:{open:e.open}},[e._l(e.pages,function(n,l){return i("div",{key:n.id,attrs:{"data-index":l,tabindex:0}},[i("k-item",{attrs:{text:n.text,image:n.image,info:n.id},on:{click:function(h){return e.select(n)}}})],1)}),i("k-pagination",{attrs:{align:"center",details:!0,page:e.pagination.page,total:e.pagination.total,limit:e.pagination.limit},on:{paginate:function(n){return e.$emit("paginate",n)}}})],2)},E=[],L=o(y,w,E,!1,null,"521b6e04",null,null);const T=L.exports,U="",C={name:"EnhancedToolbarAutosuggest",components:{EnhancedToolbarDropdown:T},props:{id:String,label:String},data(){return{searchTerm:"",pagination:{},pages:[],selectedPage:[],url:""}},watch:{selectedPage(t){t.length||document.dispatchEvent(new CustomEvent("enhanced-toolbar-link-dialog/page",{detail:{page:null}}))}},async created(){this.updateSearch=this.$helper.debounce(this.updateSearch,200),this.id&&await this.$api.get("enhanced-toolbar-link-dialog/page",{id:this.id}).then(t=>{this.selectedPage=[t]}).catch(t=>{t.code===404&&(this.url=this.id)})},methods:{async fetch(t,e){const i=(e==null?void 0:e.page)||1;if(!this.searchTerm){this.pages=[];return}if(this.searchTerm.startsWith("http")||this.searchTerm.startsWith("/")){this.pages=[];return}const n=await this.$api.get("enhanced-toolbar-link-dialog/pages",{q:this.searchTerm,page:i});this.pages=n.data,this.pagination=n.pagination},updateSearch(t){this.searchTerm=t,this.fetch(),this.$emit("input",t)},selectPage(t){document.dispatchEvent(new CustomEvent("enhanced-toolbar-link-dialog/page",{detail:{page:t}})),this.selectedPage=[t],this.url=""}}};var I=function(){var e=this,i=e._self._c;return i("div",{staticClass:"enhanced-toolbar-autosuggest-field"},[e.selectedPage.length===0?i("k-text-field",{attrs:{counter:!1,icon:"file-document",label:e.label,placeholder:"Enter a URL or search term\u2026",name:"autosuggesttext"},on:{input:e.updateSearch},model:{value:e.url,callback:function(n){e.url=n},expression:"url"}}):e._e(),e.selectedPage.length===1?i("k-tags-field",{attrs:{counter:!1,icon:"file-document",label:e.label,name:"tags",type:"tags",max:"1"},model:{value:e.selectedPage,callback:function(n){e.selectedPage=n},expression:"selectedPage"}}):e._e(),e.pages.length?i("enhanced-toolbar-dropdown",{attrs:{pages:e.pages,pagination:e.pagination},on:{select:e.selectPage,paginate:function(n){return e.fetch(e.searchTerm,n)}}}):e._e()],1)},A=[],P=o(C,I,A,!1,null,"158d91ac",null,null);const W=P.exports;panel.plugin("gearsdigital/enhanced-toolbar-link-dialog",{components:{"k-toolbar-link-dialog":{extends:_},"k-writer":{extends:"k-writer",components:{"k-writer-link-dialog":x}}},fields:{autosuggest:W}})})(); +(function(){"use strict";function o(t,e,i,n,a,h,d,S){var l=typeof t=="function"?t.options:t;e&&(l.render=e,l.staticRenderFns=i,l._compiled=!0),n&&(l.functional=!0),h&&(l._scopeId="data-v-"+h);var s;if(d?(s=function(r){r=r||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!r&&typeof __VUE_SSR_CONTEXT__<"u"&&(r=__VUE_SSR_CONTEXT__),a&&a.call(this,r),r&&r._registeredComponents&&r._registeredComponents.add(d)},l._ssrRegister=s):a&&(s=S?function(){a.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:a),s)if(l.functional){l._injectStyles=s;var R=l.render;l.render=function(D,u){return s.call(u),R(D,u)}}else{var c=l.beforeCreate;l.beforeCreate=c?[].concat(c,s):[s]}return{exports:t,options:l}}const g={data(){return{link:{href:null,title:null,target:!1,text:null,anchor:null}}},computed:{fields(){return{href:{label:this.$t("link"),type:"autosuggest",id:this.link.href},text:{label:this.$t("link.text"),type:"text",icon:"title"},title:{label:this.$t("title"),type:"text",counter:!1,icon:"title"},anchor:{label:this.$t("gearsdigital.enhanced-toolbar-link-dialog.anchor.title"),type:"text",counter:!1,before:"#",width:"1/2"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")],width:"1/2"}}},kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.link.text=e,this.$refs.dialog.open(),this.addListener()},close(){this.$emit("cancel"),this.removeListener(),this.link={href:null,title:null,target:!1,text:null,anchor:null}},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.link={href:null,title:null,target:!1,text:null,anchor:null},this.$refs.dialog.close()},createKirbytext(){const t=[];return t.push(`link: ${this.appendAnchor(this.link.href)}`),this.link.text&&this.link.text.length>0&&t.push(`text: ${this.link.text}`),this.link.title&&this.link.title.length>0&&t.push(`title: ${this.link.title}`),this.link.target&&t.push("target: _blank"),`(${t.join(" ")})`},createMarkdown(){return this.link.text.length>0?`[${this.link.text}](${this.link.href})`:`<${this.link.href}>`},appendAnchor(t){let e=this.$refs.dialog.model.anchor;return e?(t||(t=""),e.startsWith("#")?t+e:t+"#"+e):t},listener(t){t.detail.page!==null&&(this.link={...this.link,href:t.detail.page.link,title:t.detail.page.text})},addListener(){document.addEventListener("enhanced-toolbar-link-dialog/page",this.listener)},removeListener(){document.removeEventListener("enhanced-toolbar-link-dialog/page",this.listener)}}};var f=function(){var e=this,i=e._self._c;return i("k-form-dialog",{ref:"dialog",attrs:{fields:e.fields,"submit-button":e.$t("confirm"),size:"medium"},on:{close:e.close,submit:e.submit},model:{value:e.link,callback:function(n){e.link=n},expression:"link"}})},p=[],m=o(g,f,p,!1,null,null,null,null);const _=m.exports,F="",k={data(){return{link:{href:null,title:null,target:!1,anchor:null}}},computed:{fields(){return{href:{label:this.$t("link"),type:"autosuggest",id:this.link.href},title:{label:this.$t("title"),type:"text",counter:!1,icon:"title"},anchor:{label:this.$t("gearsdigital.enhanced-toolbar-link-dialog.anchor.title"),type:"text",counter:!1,before:"#",width:"1/2"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")],width:"1/2"}}}},methods:{open(t){this.link={title:null,target:!1,anchor:null,...this.extendWithAnchor(t)},this.link.target=Boolean(this.link.target),this.$refs.dialog.open(),this.addListener()},close(){this.$emit("close"),this.removeListener()},submit(){this.link.href=this.appendAnchor(this.link.href),this.$emit("submit",{...this.link,target:this.link.target?"_blank":null}),this.$refs.dialog.close()},extendWithAnchor(t){var i,n;if(!t.href)return t;const e=t.href.split("#");return{...t,href:(i=e[0])!=null?i:null,anchor:(n=e[1])!=null?n:null}},appendAnchor(t){let e=this.$refs.dialog.model.anchor;return e?(t||(t=""),e.startsWith("#")?t+e:t+"#"+e):t},listener(t){t.detail.page===null?this.link={href:null,title:null,target:!1}:this.link={...this.link,href:t.detail.page.link,title:t.detail.page.text}},addListener(){document.addEventListener("enhanced-toolbar-link-dialog/page",this.listener)},removeListener(){document.removeEventListener("enhanced-toolbar-link-dialog/page",this.listener)}}};var b=function(){var e=this,i=e._self._c;return i("k-form-dialog",{ref:"dialog",attrs:{fields:e.fields,"submit-button":e.$t("confirm"),size:"medium"},on:{close:e.close,submit:e.submit},model:{value:e.link,callback:function(n){e.link=n},expression:"link"}})},$=[],v=o(k,b,$,!1,null,null,null,null);const x=v.exports,N="",y={name:"EnhancedToolbarDropdown",props:{pages:{type:Array},pagination:{type:{page:Number,total:Number,limit:Number}}},data(){return{open:!0,currentItem:0}},watch:{pages(){this.focusCurrentItem()}},mounted(){this.focusCurrentItem(),window.addEventListener("keydown",this.keydownListener)},destroyed(){window.removeEventListener("keydown",this.keydownListener)},methods:{select(t){this.$emit("select",t),this.open=!1,this.currentItem=0},focusCurrentItem(){document.querySelector(`.enhanced-toolbar-dialog-element div[data-index="${this.currentItem}"]`).focus()},blurCurrentItem(){document.querySelector(`.enhanced-toolbar-dialog-element div[data-index="${this.currentItem}"]`).blur()},keydownListener(t){var a;const e=this.currentItem0,n=t.code;n==="ArrowDown"&&e&&(this.blurCurrentItem(),this.currentItem++,this.focusCurrentItem()),n==="ArrowUp"&&i&&(this.blurCurrentItem(),this.currentItem--,this.focusCurrentItem()),n==="Tab"&&(this.currentItem=(a=parseInt(document.activeElement.getAttribute("data-index"),10))!=null?a:0),n==="Enter"&&(t.stopPropagation(),t.preventDefault(),this.select(this.pages[this.currentItem]))}}};var w=function(){var e=this,i=e._self._c;return i("dialog",{staticClass:"enhanced-toolbar-dialog-element",attrs:{open:e.open}},[e._l(e.pages,function(n,a){return i("div",{key:n.id,attrs:{"data-index":a,tabindex:0}},[i("k-item",{attrs:{text:n.text,image:n.image,info:n.id},on:{click:function(h){return e.select(n)}}})],1)}),i("k-pagination",{attrs:{align:"center",details:!0,page:e.pagination.page,total:e.pagination.total,limit:e.pagination.limit},on:{paginate:function(n){return e.$emit("paginate",n)}}})],2)},E=[],T=o(y,w,E,!1,null,"b8f6aa9f",null,null);const C=T.exports,U="",L={name:"EnhancedToolbarAutosuggest",components:{EnhancedToolbarDropdown:C},props:{id:String,label:String},data(){return{searchTerm:"",pagination:{},pages:[],selectedPage:[],url:""}},watch:{selectedPage(t){t.length||document.dispatchEvent(new CustomEvent("enhanced-toolbar-link-dialog/page",{detail:{page:null}}))}},async created(){this.updateSearch=this.$helper.debounce(this.updateSearch,200),this.id&&await this.$api.get("enhanced-toolbar-link-dialog/page",{id:this.id}).then(t=>{this.selectedPage=[t]}).catch(t=>{t.code===404&&(this.url=this.id)})},methods:{async fetch(t,e){const i=(e==null?void 0:e.page)||1;if(!this.searchTerm){this.pages=[];return}if(this.searchTerm.startsWith("http")||this.searchTerm.startsWith("/")){this.pages=[];return}const n=await this.$api.get("enhanced-toolbar-link-dialog/pages",{q:this.searchTerm,page:i});this.pages=n.data,this.pagination=n.pagination},updateSearch(t){this.searchTerm=t,this.fetch(),this.$emit("input",t)},selectPage(t){document.dispatchEvent(new CustomEvent("enhanced-toolbar-link-dialog/page",{detail:{page:t}})),this.selectedPage=[t],this.url=""}}};var I=function(){var e=this,i=e._self._c;return i("div",{staticClass:"enhanced-toolbar-autosuggest-field"},[e.selectedPage.length===0?i("k-text-field",{attrs:{counter:!1,icon:"file-document",label:e.label,placeholder:e.$t("gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder"),name:"autosuggesttext"},on:{input:e.updateSearch},model:{value:e.url,callback:function(n){e.url=n},expression:"url"}}):e._e(),e.selectedPage.length===1?i("k-tags-field",{attrs:{counter:!1,icon:"file-document",label:e.label,name:"tags",type:"tags",max:"1"},model:{value:e.selectedPage,callback:function(n){e.selectedPage=n},expression:"selectedPage"}}):e._e(),e.pages.length?i("enhanced-toolbar-dropdown",{attrs:{pages:e.pages,pagination:e.pagination},on:{select:e.selectPage,paginate:function(n){return e.fetch(e.searchTerm,n)}}}):e._e()],1)},A=[],P=o(L,I,A,!1,null,"f1fbdecd",null,null);const W=P.exports;panel.plugin("gearsdigital/enhanced-toolbar-link-dialog",{components:{"k-toolbar-link-dialog":{extends:_},"k-writer":{extends:"k-writer",components:{"k-writer-link-dialog":x}}},fields:{autosuggest:W}})})(); diff --git a/src/components/fields/EnhancedToolbarAutosuggestField.vue b/src/components/fields/EnhancedToolbarAutosuggestField.vue index 358757f..0be65dc 100644 --- a/src/components/fields/EnhancedToolbarAutosuggestField.vue +++ b/src/components/fields/EnhancedToolbarAutosuggestField.vue @@ -6,7 +6,11 @@ :counter="false" icon="file-document" :label="label" - placeholder="Enter a URL or search term…" + :placeholder=" + $t( + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' + ) + " name="autosuggesttext" @input="updateSearch" /> @@ -21,7 +25,7 @@ max="1" /> [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Anchor', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'Enter a URL or search term…', ], 'de' => [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Anker', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'URL oder Suchbegriff eingeben…', ], 'cs' => [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Anchor', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'Zadejte adresu URL nebo hledaný výraz…', ], 'fr' => [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Ancre', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'Entrez une URL ou un terme de recherche…', ], 'nl' => [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Anker', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'Voer een URL of zoekterm in…', ], 'is' => [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Bensli', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'Sláðu inn vefslóð eða leitarorð…', ], 'da' => [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Anker', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'Indtast en URL eller et søgeord…', ], 'se' => [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Ankere', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'Ange en webbadress eller sökterm…', ], 'no' => [ 'gearsdigital.enhanced-toolbar-link-dialog.anchor.title' => 'Anker', + 'gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder' => 'Skriv inn en URL eller et søkeord…', ], ];