From b885ec9826fcd303a5bad8f15107eaa4625933a9 Mon Sep 17 00:00:00 2001 From: "severoiuliano@gmail.com" Date: Mon, 13 Jan 2020 15:50:20 +0100 Subject: [PATCH 1/5] i18n vuejs and more --- cache/lastCache.txt | 2 +- settings/languages/en.yaml | 61 +++++++++++++++++++++++ settings/languages/it.yaml | 61 +++++++++++++++++++++++ settings/languages/vuejs-en.yaml | 56 ++++++++++++++++++++++ settings/languages/vuejs-it.yaml | 56 ++++++++++++++++++++++ system/Settings.php | 17 ++++++- system/author/editor/editor-blox.twig | 4 +- system/author/editor/editor-raw.twig | 2 +- system/author/js/vue-blox.js | 55 +++++++++++---------- system/author/js/vue-i18n.min.js | 6 +++ system/author/js/vue-meta.js | 64 ++++++++++++++----------- system/author/layouts/layoutBlox.twig | 57 +++++++++++----------- system/author/layouts/layoutEditor.twig | 14 ++++-- system/author/partials/fields.twig | 8 ++-- system/author/settings/themes.twig | 6 +-- 15 files changed, 372 insertions(+), 97 deletions(-) create mode 100644 settings/languages/vuejs-en.yaml create mode 100644 settings/languages/vuejs-it.yaml create mode 100644 system/author/js/vue-i18n.min.js diff --git a/cache/lastCache.txt b/cache/lastCache.txt index 4e98754..9be57e2 100644 --- a/cache/lastCache.txt +++ b/cache/lastCache.txt @@ -1 +1 @@ -1578580890 \ No newline at end of file +1578926925 \ No newline at end of file diff --git a/settings/languages/en.yaml b/settings/languages/en.yaml index b06f608..7001473 100644 --- a/settings/languages/en.yaml +++ b/settings/languages/en.yaml @@ -1,4 +1,65 @@ # English + +# themes/typemill/typemill.yaml +ACTIVATE_SPECIAL_STARTPAGE_DESIGN: Activate Special Startpage-Design +AUTHOR_INTRO: Author Intro +BOTTOM: Bottom +BY: by +COUNT_CHAPTERS_IN_NAVIGATION?: Count chapters in navigation? +DIFFERENT_DESIGN_FOR_STARTPAGE: Different Design for Startpage +FACEBOOK: Facebook +FORMAT: Format +GITHUB: GitHub +LABEL_FOR_CHAPTER: Label for Chapter +LABEL_FOR_START_BUTTON: Label for Start Button +LAST_MODIFIED_FORMAT: Last Modified Format +LAST_MODIFIED: Last Modified +LAST_MODIFIED_TEXT: Last Modified Text +LINKEDIN: Linkedin +LINK_TO_GIT_REPOSITORY: Link to git repository +MAIL: Mail +POSITION_OF_AUTHOR: Position of Author +POSITION_OF_GIT_EDIT_LINK: Position of Git Edit Link +POSITION_OF_MODIFIED_TEXT: Position of Modified Text +POSITION_OF_SHARE_BUTTONS: Position of Share-Buttons +SELECT_SHARE_BUTTONS: Select Share Buttons +SHARE: Share +SHOW_CHAPTER_NUMBERS: Show Chapter Numbers +TOP: Top +TWITTER: Twitter +TYPEMILL_DESCRIPTION: The standard theme for Typemill. Responsive, minimal and without any dependencies. It uses the system fonts Calibri and Helvetica. No JavaScript is used. +WHATSAPP: WhatsApp +XING: Xing + +# system/author/layouts/layoutBlox.twig +ADD: add +BOLD: bold +BULLET_LIST: Bullet List +CHECK: check +CODE: Code +COG: cog +CROSS: cross +DEFINITION: Definition List +DELETE_CLOSE: delete/close +DELETE: delete +EXTERNAL_LINK: external-link +FOLDER: folder +HEADLINE: Headline +HOME: home +HORIZONTAL_LINE: Horizontal Line +IMAGE: Image +ITALIC: italic +LINK: link +MOVE_VERTICAL: move vertical +NUMBERED_LIST: Numbered List +PARAGRAPH: Paragraph +POWER_OFF: power-off +QUOTES: Quote +TABLE_OF_CONTENTS: Table of Contents +TABLE: Table +TEXT_FILE: text-file +VIDEO: Video + ACCOUNT: Account ACTIVE: Active ACTUAL_PASSWORD: Actual Password diff --git a/settings/languages/it.yaml b/settings/languages/it.yaml index 3d90b2c..9294297 100644 --- a/settings/languages/it.yaml +++ b/settings/languages/it.yaml @@ -1,4 +1,65 @@ # Italiano + +# themes/typemill/typemill.yaml +ACTIVATE_SPECIAL_STARTPAGE_DESIGN: Attiva il disegno speciale della pagina iniziale +AUTHOR_INTRO: Introduzione dell'autore +BOTTOM: Sotto +BY: di +COUNT_CHAPTERS_IN_NAVIGATION?: Contare i capitoli nella navigazione? +DIFFERENT_DESIGN_FOR_STARTPAGE: Disegno diverso per la pagina iniziale +FACEBOOK: Facebook +FORMAT: Format +GITHUB: GitHub +LABEL_FOR_CHAPTER: Etichetta per capitolo +LABEL_FOR_START_BUTTON: Etichetta per il pulsante Comincia +LAST_MODIFIED_FORMAT: Ultimo formato modificato +LAST_MODIFIED_TEXT: Ultimo testo modificato +LAST_MODIFIED: Ultima modifica +LINKEDIN: Linkedin +LINK_TO_GIT_REPOSITORY: Collegamento al deposito git +MAIL: Mail +POSITION_OF_AUTHOR: Posizione dell'autore +POSITION_OF_GIT_EDIT_LINK: Posizione del collegamento modifica Git +POSITION_OF_MODIFIED_TEXT: Posizione del testo modificato +POSITION_OF_SHARE_BUTTONS: Posizione dei pulsanti di condivisione +SELECT_SHARE_BUTTONS: Seleziona i pulsanti pulsanti di condivisione +SHARE: Condividere +SHOW_CHAPTER_NUMBERS: Mostra i numeri dei capitoli +TOP: Sopra +TWITTER: Twitter +TYPEMILL_DESCRIPTION: Il tema standard per Typemill. Reattivo, minimo e senza dipendenze. Utilizza i caratteri di sistema Calibri ed Helvetica. Non viene utilizzato JavaScript. +WHATSAPP: WhatsApp +XING: Xing + +# system/author/layouts/layoutBlox.twig +ADD: aggiungi +BOLD: grassetto +BULLET_LIST: Elenco puntato +CHECK: controllo +CODE: Codice +COG: ingranaggio +CROSS: croce +DEFINITION: Elenco delle definizioni +DELETE_CLOSE: elimina/chiudi +DELETE: elimina +EXTERNAL_LINK: collegamento esterno +FOLDER: cartella +HEADLINE: Titolo +HOME: home +HORIZONTAL_LINE: Linea orizzontale +IMAGE: Immagine +ITALIC: corsivo +LINK: collegamento +MOVE_VERTICAL: spostare in verticale +NUMBERED_LIST: Elenco numerato +PARAGRAPH: Paragrafo +POWER_OFF: spegni +QUOTES: Citazione +TABLE_OF_CONTENTS: Sommario +TABLE: Tabella +TEXT_FILE: file di testo +VIDEO: Video + ACCOUNT: Utenza ACTIVE: Attivo ACTUAL_PASSWORD: Parola d'ordine corrente diff --git a/settings/languages/vuejs-en.yaml b/settings/languages/vuejs-en.yaml new file mode 100644 index 0000000..e9533b2 --- /dev/null +++ b/settings/languages/vuejs-en.yaml @@ -0,0 +1,56 @@ +# English +en: + add content-block: add content-block + cancel: cancel + delete content-block: delete content-block + save: save + Paragraph: Paragraph + Headline: Headline + Bullet List: Bullet List + Numbered List: Numbered List + Table: Table + Quote: Quote + Image: Image + Video: Video + table of contents: Table of Contents + Horizontal Line: Horizontal Line + Definition List: Definition List + Code: Code + drag a picture or click to select: drag a picture or click to select + Alt-Text: Alt-Text + Title: Title + Caption: Caption + Link: Link + Class: Class + Center: Center + Left: Left + Right: Right + Link to video: Link to video + add right column: add right column + add left column: add left column + delete column: delete column + add row above: add row above + add row below: add row below + delete row: delete row + Head: Head + cell: cell + term: term + description: description + add definition: add definition + + # metatabs.yaml + Meta title: Meta title + Meta description: Meta description + author: author + Manual date: Manual date + Last modified live (readonly): Last modified live (readonly) + Created at (readonly): Created at (readonly) + If not filled, the description is extracted from content.: If not filled, the description is extracted from content. + Taken from your user account if set.: Taken from your user account if set. + Used as fallback when no manual date is set.: Used as fallback when no manual date is set. + save: save + + Content: Content + meta: meta + Saved successfully: Saved successfully + Please correct the errors above: Please correct the errors above diff --git a/settings/languages/vuejs-it.yaml b/settings/languages/vuejs-it.yaml new file mode 100644 index 0000000..9d44f28 --- /dev/null +++ b/settings/languages/vuejs-it.yaml @@ -0,0 +1,56 @@ +# Italiano +it: + add content-block: aggiungi blocco contenuto + cancel: Annulla + delete content-block: elimina blocco contenuto + save: Salva + Paragraph: Paragrafo + Headline: Titolo + Bullet List: Elenco puntato + Numbered List: Elenco numerato + Table: Tabella + Quote: Citazione + Image: Immagine + Video: Video + table of contents: Sommario + Horizontal Line: Linea orizzontale + Definition List: Elenco delle definizioni + Code: Codice + drag a picture or click to select: trascina un'immagine o fai clic per selezionare + Alt-Text: Testo alternativo + Title: Titolo + Caption: Didascalia + Link: Collegamento + Class: Classe + Center: Centro + Left: Sinistra + Right: Destra + Link to video: Collega al video + add right column: aggiungi colonna a destra + add left column: aggiungi colonna a sinistra + delete column: elimina colonna + add row above: aggiungi la riga sopra + add row below: aggiungi la riga sotto + delete row: elimina riga + Head: Intestazione + cell: cella + term: termine + description: descrizione + add definition: aggiungi definizione + + # metatabs.yaml + Meta title: Titolo + Meta description: Descrizione + author: autore + Manual date: Data manuale + Last modified live (readonly): Ultima modifica (sola lettura) + Created at (readonly): Creato il (sola lettura) + If not filled, the description is extracted from content.: Se non compilato, la descrizione viene estratta dal contenuto. + Taken from your user account if set.: Tratto dalla tua utenza, se impostata. + Used as fallback when no manual date is set.: Utilizzato come ripiego quando non è impostata alcuna data manuale. + save: salva + + Content: Contenuto + meta: Metadati + Saved successfully: Salvato con successo + Please correct the errors above: Si prega di correggere gli errori sopra diff --git a/system/Settings.php b/system/Settings.php index e3c245c..c933a86 100644 --- a/system/Settings.php +++ b/system/Settings.php @@ -20,7 +20,7 @@ class Settings // load the strings of the set language $language = $settings['language']; $settings['labels'] = self::getLanguageLabels($language); - + $settings['vuejsLabels'] = self::getVuejsLabels($language); # We know the used theme now so create the theme path $settings['themePath'] = $settings['rootPath'] . $settings['themeFolder'] . DIRECTORY_SEPARATOR . $settings['theme']; @@ -92,6 +92,21 @@ class Settings return $labels; } + //public static function getVuejsLabels() + public static function getVuejsLabels($language) + { + if( empty($language) ){//temp + $language = 'en';//temp + }//temp + + // load the strings of the set language + $yaml = new Models\WriteYaml(); + //$labels = $yaml->getYaml('settings/languages', 'vue-blox.yaml'); + $labels = $yaml->getYaml('settings/languages', 'vuejs-'.$language.'.yaml');//temp + + return $labels; + } + public static function getObjectSettings($objectType, $objectName) { diff --git a/system/author/editor/editor-blox.twig b/system/author/editor/editor-blox.twig index c7a8579..41111c3 100644 --- a/system/author/editor/editor-blox.twig +++ b/system/author/editor/editor-blox.twig @@ -12,7 +12,7 @@ v-bind:key="tab" v-bind:class="['tab-button', { active: currentTab === tab }]" v-on:click="currentTab = tab" - >${tab} + >${ $t(tab) } - + diff --git a/system/author/editor/editor-raw.twig b/system/author/editor/editor-raw.twig index 3a93ede..e818498 100644 --- a/system/author/editor/editor-raw.twig +++ b/system/author/editor/editor-raw.twig @@ -12,7 +12,7 @@ v-bind:key="tab" v-bind:class="['tab-button', { active: currentTab === tab }]" v-on:click="currentTab = tab" - >${tab} + >${ $t(tab) } Choose a content-type ' + '
' + '
' + - '' + - '' + + '' + + '' + '
' + '
' + '
' + @@ -15,8 +15,8 @@ const contentComponent = Vue.component('content-block', { '' + '' + '
' + - '' + - '' + + '' + + '' + '
' + '
' + '
' + @@ -895,25 +895,25 @@ const tableComponent = Vue.component('table-component', { '' + '{{value}} ' + '
' + - '
add right column
' + - '
add left column
' + - '
delete column
' + + '
{{ $t(\'add right column\') }}
' + + '
{{ $t(\'add left column\') }}
' + + '
{{ $t(\'delete column\') }}
' + '
' + '' + '' + '
' + - '
add row above
' + - '
add row below
' + - '
delete row
' + + '
{{ $t(\'add row above\') }}
' + + '
{{ $t(\'add row below\') }}
' + + '
{{ $t(\'delete row\') }}
' + '
' + - '{{value}}' + + '{{ $t(value) }}' + '' + '
' + - '
add row above
' + - '
add row below
' + - '
delete row
' + + '
{{ $t(\'add row above\') }}
' + + '
{{ $t(\'add row below\') }}
' + + '
{{ $t(\'delete row\') }}
' + '
' + - '{{ value }}' + + '{{ $t(value) }}' + '' + '' + '' + @@ -1092,13 +1092,13 @@ const definitionComponent = Vue.component('definition-component', { '' + '
' + '' + - '' + + '' + '' + - '' + + '' + '' + '
' + '
' + - '' + + '' + '
' + '
', mounted: function(){ @@ -1169,7 +1169,7 @@ const videoComponent = Vue.component('video-component', { props: ['compmarkdown', 'disabled', 'load'], template: '
' + '
' + - '' + + '' + '
' + '
', methods: { @@ -1185,16 +1185,16 @@ const imageComponent = Vue.component('image-component', { template: '
' + '' + ' ' + - '

drag a picture or click to select

' + + '

{{ $t(\'drag a picture or click to select\') }}

' + '
' + '' + '
' + '
' + - '' + - '' + - '' + - '' + - '' + + '' + + '' + + '' + + '' + + '' + '' + '
', data: function(){ @@ -1467,6 +1467,11 @@ for(var i = 0; i < formatConfig.length; i++) } let editor = new Vue({ + i18n: new VueI18n({ + locale: language, + messages: vuejsLabels + }), + delimiters: ['${', '}'], el: '#blox', /* components: componentList, */ diff --git a/system/author/js/vue-i18n.min.js b/system/author/js/vue-i18n.min.js new file mode 100644 index 0000000..d3cc572 --- /dev/null +++ b/system/author/js/vue-i18n.min.js @@ -0,0 +1,6 @@ +/*! + * vue-i18n v8.15.3 + * (c) 2019 kazuya kawaguchi + * Released under the MIT License. + */ +var t,e;t=this,e=function(){"use strict";var t=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher","unit"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}function n(t){return null!==t&&"object"==typeof t}var r=Object.prototype.toString,i="[object Object]";function a(t){return r.call(t)===i}function s(t){return null==t}function o(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=null,i=null;return 1===t.length?n(t[0])||Array.isArray(t[0])?i=t[0]:"string"==typeof t[0]&&(r=t[0]):2===t.length&&("string"==typeof t[0]&&(r=t[0]),(n(t[1])||Array.isArray(t[1]))&&(i=t[1])),{locale:r,params:i}}function l(t){return JSON.parse(JSON.stringify(t))}var c=Object.prototype.hasOwnProperty;function u(t,e){return c.call(t,e)}function f(t){for(var e=arguments,r=Object(t),i=1;i0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var i=this.$i18n;return i._tc.apply(i,[t,i.locale,i._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}(y),y.mixin(p),y.directive("t",{bind:d,update:F,unbind:k}),y.component(m.name,m),y.component(b.name,b),y.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var T=function(){this._caches=Object.create(null)};T.prototype.interpolate=function(t,e){if(!e)return[t];var r=this._caches[t];return r||(r=function(t){var e=[],n=0,r="";for(;n0)f--,u=N,h[I]();else{if(f=0,void 0===n)return!1;if(!1===(n=z(n)))return!1;h[O]()}};null!==u;)if("\\"!==(e=t[++c])||!p()){if(i=P(e),(a=(o=V[u])[i]||o.else||R)===R)return;if(u=a[0],(s=h[a[1]])&&(r=void 0===(r=a[2])?e:r,!1===s()))return;if(u===H)return l}}(t))&&(this._cache[t]=e),e||[]},J.prototype.getPathValue=function(t,e){if(!n(t))return null;var r=this.parsePath(e);if(0===r.length)return null;for(var i=r.length,a=t,s=0;s/,B=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,G=/^@(?:\.([a-z]+))?:/,X=/[()]/g,Z={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()}},K=new T,Q=function(t){var e=this;void 0===t&&(t={}),!y&&"undefined"!=typeof window&&window.Vue&&D(window.Vue);var n=t.locale||"en-US",r=t.fallbackLocale||"en-US",i=t.messages||{},a=t.dateTimeFormats||{},o=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||K,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new J,this._dataListeners=[],this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._exist=function(t,n){return!(!t||!n)&&(!s(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(i).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,i[t])}),this._initVM({locale:n,fallbackLocale:r,messages:i,dateTimeFormats:a,numberFormats:o})},Y={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0}};return Q.prototype._checkLocaleMessage=function(t,n,r){var i=function(t,n,r,s){if(a(r))Object.keys(r).forEach(function(e){var o=r[e];a(o)?(s.push(e),s.push("."),i(t,n,o,s),s.pop(),s.pop()):(s.push(e),i(t,n,o,s),s.pop())});else if(Array.isArray(r))r.forEach(function(e,r){a(e)?(s.push("["+r+"]"),s.push("."),i(t,n,e,s),s.pop(),s.pop()):(s.push("["+r+"]"),i(t,n,e,s),s.pop())});else if("string"==typeof r){if(q.test(r)){var o="Detected HTML in message '"+r+"' of keypath '"+s.join("")+"' at '"+n+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?e(o):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(o)}}};i(n,t,r,[])},Q.prototype._initVM=function(t){var e=y.config.silent;y.config.silent=!0,this._vm=new y({data:t}),y.config.silent=e},Q.prototype.destroyVM=function(){this._vm.$destroy()},Q.prototype.subscribeDataChanging=function(t){this._dataListeners.push(t)},Q.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)t.splice(n,1)}}(this._dataListeners,t)},Q.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",function(){for(var e=t._dataListeners.length;e--;)y.nextTick(function(){t._dataListeners[e]&&t._dataListeners[e].$forceUpdate()})},{deep:!0})},Q.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(e){t.$set(t,"locale",e),t.$forceUpdate()},{immediate:!0})},Y.vm.get=function(){return this._vm},Y.messages.get=function(){return l(this._getMessages())},Y.dateTimeFormats.get=function(){return l(this._getDateTimeFormats())},Y.numberFormats.get=function(){return l(this._getNumberFormats())},Y.availableLocales.get=function(){return Object.keys(this.messages).sort()},Y.locale.get=function(){return this._vm.locale},Y.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},Y.fallbackLocale.get=function(){return this._vm.fallbackLocale},Y.fallbackLocale.set=function(t){this._vm.$set(this._vm,"fallbackLocale",t)},Y.formatFallbackMessages.get=function(){return this._formatFallbackMessages},Y.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},Y.missing.get=function(){return this._missing},Y.missing.set=function(t){this._missing=t},Y.formatter.get=function(){return this._formatter},Y.formatter.set=function(t){this._formatter=t},Y.silentTranslationWarn.get=function(){return this._silentTranslationWarn},Y.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},Y.silentFallbackWarn.get=function(){return this._silentFallbackWarn},Y.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},Y.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},Y.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},Y.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},Y.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})}},Q.prototype._getMessages=function(){return this._vm.messages},Q.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},Q.prototype._getNumberFormats=function(){return this._vm.numberFormats},Q.prototype._warnDefault=function(t,e,n,r,i){if(!s(n))return n;if(this._missing){var a=this._missing.apply(null,[t,e,r,i]);if("string"==typeof a)return a}if(this._formatFallbackMessages){var l=o.apply(void 0,i);return this._render(e,"string",l.params,e)}return e},Q.prototype._isFallbackRoot=function(t){return!t&&!s(this._root)&&this._fallbackRoot},Q.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},Q.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},Q.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},Q.prototype._interpolate=function(t,e,n,r,i,o,l){if(!e)return null;var c,u=this._path.getPathValue(e,n);if(Array.isArray(u)||a(u))return u;if(s(u)){if(!a(e))return null;if("string"!=typeof(c=e[n]))return null}else{if("string"!=typeof u)return null;c=u}return(c.indexOf("@:")>=0||c.indexOf("@.")>=0)&&(c=this._link(t,e,c,r,"raw",o,l)),this._render(c,i,o,n)},Q.prototype._link=function(t,e,n,r,i,a,s){var o=n,l=o.match(B);for(var c in l)if(l.hasOwnProperty(c)){var u=l[c],f=u.match(G),h=f[0],p=f[1],m=u.replace(h,"").replace(X,"");if(s.includes(m))return o;s.push(m);var g=this._interpolate(t,e,m,r,"raw"===i?"string":i,"raw"===i?void 0:a,s);if(this._isFallbackRoot(g)){if(!this._root)throw Error("unexpected error");var _=this._root.$i18n;g=_._translate(_._getMessages(),_.locale,_.fallbackLocale,m,r,i,a)}g=this._warnDefault(t,m,g,r,Array.isArray(a)?a:[a]),this._modifiers.hasOwnProperty(p)?g=this._modifiers[p](g):Z.hasOwnProperty(p)&&(g=Z[p](g)),s.pop(),o=g?o.replace(u,g):o}return o},Q.prototype._render=function(t,e,n,r){var i=this._formatter.interpolate(t,n,r);return i||(i=K.interpolate(t,n,r)),"string"===e?i.join(""):i},Q.prototype._translate=function(t,e,n,r,i,a,o){var l=this._interpolate(e,t[e],r,i,a,o,[r]);return s(l)&&s(l=this._interpolate(n,t[n],r,i,a,o,[r]))?null:l},Q.prototype._t=function(t,e,n,r){for(var i,a=[],s=arguments.length-4;s-- >0;)a[s]=arguments[s+4];if(!t)return"";var l=o.apply(void 0,a),c=l.locale||e,u=this._translate(n,c,this.fallbackLocale,t,r,"string",l.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(i=this._root).$t.apply(i,[t].concat(a))}return this._warnDefault(c,t,u,r,a)},Q.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},Q.prototype._i=function(t,e,n,r,i){var a=this._translate(n,e,this.fallbackLocale,t,r,"raw",i);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,i)}return this._warnDefault(e,t,a,r,[i])},Q.prototype.i=function(t,e,n){return t?("string"!=typeof e&&(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},Q.prototype._tc=function(t,e,n,r,i){for(var a,s=[],l=arguments.length-5;l-- >0;)s[l]=arguments[l+5];if(!t)return"";void 0===i&&(i=1);var c={count:i,n:i},u=o.apply(void 0,s);return u.params=Object.assign(c,u.params),s=null===u.locale?[u.params]:[u.locale,u.params],this.fetchChoice((a=this)._t.apply(a,[t,e,n,r].concat(s)),i)},Q.prototype.fetchChoice=function(t,e){if(!t&&"string"!=typeof t)return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},Q.prototype.getChoiceIndex=function(t,e){var n,r;return this.locale in this.pluralizationRules?this.pluralizationRules[this.locale].apply(this,[t,e]):(n=t,r=e,n=Math.abs(n),2===r?n?n>1?1:0:1:n?Math.min(n,2):0)},Q.prototype.tc=function(t,e){for(var n,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},Q.prototype._te=function(t,e,n){for(var r=[],i=arguments.length-3;i-- >0;)r[i]=arguments[i+3];var a=o.apply(void 0,r).locale||e;return this._exist(n[a],t)},Q.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},Q.prototype.getLocaleMessage=function(t){return l(this._vm.messages[t]||{})},Q.prototype.setLocaleMessage=function(t,e){("warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||(this._checkLocaleMessage(t,this._warnHtmlInMessage,e),"error"!==this._warnHtmlInMessage))&&this._vm.$set(this._vm.messages,t,e)},Q.prototype.mergeLocaleMessage=function(t,e){("warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||(this._checkLocaleMessage(t,this._warnHtmlInMessage,e),"error"!==this._warnHtmlInMessage))&&this._vm.$set(this._vm.messages,t,f({},this._vm.messages[t]||{},e))},Q.prototype.getDateTimeFormat=function(t){return l(this._vm.dateTimeFormats[t]||{})},Q.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e)},Q.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,f(this._vm.dateTimeFormats[t]||{},e))},Q.prototype._localizeDateTime=function(t,e,n,r,i){var a=e,o=r[a];if((s(o)||s(o[i]))&&(o=r[a=n]),s(o)||s(o[i]))return null;var l=o[i],c=a+"__"+i,u=this._dateTimeFormatters[c];return u||(u=this._dateTimeFormatters[c]=new Intl.DateTimeFormat(a,l)),u.format(t)},Q.prototype._d=function(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);var r=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return r||""},Q.prototype.d=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=this.locale,a=null;return 1===e.length?"string"==typeof e[0]?a=e[0]:n(e[0])&&(e[0].locale&&(i=e[0].locale),e[0].key&&(a=e[0].key)):2===e.length&&("string"==typeof e[0]&&(a=e[0]),"string"==typeof e[1]&&(i=e[1])),this._d(t,i,a)},Q.prototype.getNumberFormat=function(t){return l(this._vm.numberFormats[t]||{})},Q.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e)},Q.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,f(this._vm.numberFormats[t]||{},e))},Q.prototype._getNumberFormatter=function(t,e,n,r,i,a){var o=e,l=r[o];if((s(l)||s(l[i]))&&(l=r[o=n]),s(l)||s(l[i]))return null;var c,u=l[i];if(a)c=new Intl.NumberFormat(o,Object.assign({},u,a));else{var f=o+"__"+i;(c=this._numberFormatters[f])||(c=this._numberFormatters[f]=new Intl.NumberFormat(o,u))}return c},Q.prototype._n=function(t,e,n,r){if(!Q.availabilities.numberFormat)return"";if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).format(t);var i=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),a=i&&i.format(t);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},r))}return a||""},Q.prototype.n=function(e){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];var a=this.locale,s=null,o=null;return 1===r.length?"string"==typeof r[0]?s=r[0]:n(r[0])&&(r[0].locale&&(a=r[0].locale),r[0].key&&(s=r[0].key),o=Object.keys(r[0]).reduce(function(e,n){var i;return t.includes(n)?Object.assign({},e,((i={})[n]=r[0][n],i)):e},null)):2===r.length&&("string"==typeof r[0]&&(s=r[0]),"string"==typeof r[1]&&(a=r[1])),this._n(e,a,s,o)},Q.prototype._ntp=function(t,e,n,r){if(!Q.availabilities.numberFormat)return[];if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).formatToParts(t);var i=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),a=i&&i.formatToParts(t);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,r)}return a||[]},Object.defineProperties(Q.prototype,Y),Object.defineProperty(Q,"availabilities",{get:function(){if(!U){var t="undefined"!=typeof Intl;U={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return U}}),Q.install=D,Q.version="8.15.3",Q},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueI18n=e(); diff --git a/system/author/js/vue-meta.js b/system/author/js/vue-meta.js index b55a452..cbab707 100644 --- a/system/author/js/vue-meta.js +++ b/system/author/js/vue-meta.js @@ -3,7 +3,7 @@ const FormBus = new Vue(); Vue.component('component-text', { props: ['class', 'id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -28,7 +28,7 @@ Vue.component('component-text', { Vue.component('component-textarea', { props: ['class', 'id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -52,7 +52,7 @@ Vue.component('component-textarea', { Vue.component('component-url', { props: ['class', 'id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -77,7 +77,7 @@ Vue.component('component-url', { Vue.component('component-number', { props: ['class', 'id', 'description', 'min', 'max', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -104,7 +104,7 @@ Vue.component('component-number', { Vue.component('component-email', { props: ['class', 'id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -129,7 +129,7 @@ Vue.component('component-email', { Vue.component('component-tel', { props: ['class', 'id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -154,7 +154,7 @@ Vue.component('component-tel', { Vue.component('component-password', { props: ['class', 'id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -179,7 +179,7 @@ Vue.component('component-password', { Vue.component('component-date', { props: ['class', 'id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -203,7 +203,7 @@ Vue.component('component-date', { Vue.component('component-color', { props: ['class', 'id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -227,7 +227,7 @@ Vue.component('component-color', { Vue.component('component-select', { props: ['class', 'id', 'description', 'readonly', 'required', 'disabled', 'label', 'name', 'type', 'options', 'value', 'errors'], template: '
' + - '' + + '' + '{{option}}' + '' + '{{ errors[name] }}' + - '{{ description }}' + + '{{ $t(description) }}' + '
', methods: { update: function($event, name) @@ -251,7 +251,7 @@ Vue.component('component-select', { Vue.component('component-checkbox', { props: ['class', 'id', 'description', 'readonly', 'required', 'disabled', 'label', 'checkboxlabel', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '
', methods: { @@ -277,7 +277,7 @@ Vue.component('component-checkbox', { Vue.component('component-checkboxlist', { props: ['class', 'description', 'readonly', 'required', 'disabled', 'label', 'checkboxlabel', 'options', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '
', methods: { update: function($event, value, optionvalue, name) @@ -304,7 +304,7 @@ Vue.component('component-checkboxlist', { Vue.component('component-radio', { props: ['class', 'id', 'description', 'readonly', 'required', 'disabled', 'options', 'label', 'name', 'type', 'value', 'errors'], template: '
' + - '' + + '' + '' + '
', methods: { @@ -339,9 +339,9 @@ Vue.component('tab-meta', { 'v-model="formdata[index]"' + 'v-bind="field">' + '' + - '
Saved successfully
' + - '
Please correct the errors above
' + - '
' + + '
{{ $t(\'Saved successfully\') }}
' + + '
{{ $t(\'Please correct the errors above\') }}
' + + '
' + '', methods: { selectComponent: function(field) @@ -356,6 +356,12 @@ Vue.component('tab-meta', { }) let meta = new Vue({ + + i18n: new VueI18n({ + locale: language, + messages: vuejsLabels + }), + delimiters: ['${', '}'], el: '#metanav', data: function () { diff --git a/system/author/layouts/layoutBlox.twig b/system/author/layouts/layoutBlox.twig index f6f0542..e299a9b 100644 --- a/system/author/layouts/layoutBlox.twig +++ b/system/author/layouts/layoutBlox.twig @@ -28,118 +28,118 @@ - external-link + {{ __('EXTERNAL_LINK') }} - text-file + {{ __('TEXT_FILE') }} - cog + {{ __('COG') }} - power-off + {{ __('POWER_OFF') }} - delete + {{ __('DELETE') }} - add + {{ __('ADD') }} - delete/close + {{ __('DELETE_CLOSE') }} - home + {{ __('HOME') }} - move vertical + {{ __('MOVE_VERTICAL') }} - folder + {{ __('FOLDER') }} - image + {{ __('IMAGE') }} - video + {{ __('VIDEO') }} - quotes + {{ __('QUOTES') }} - numbered list + {{ __('NUMBERED_LIST') }} - bullet list + {{ __('BULLET_LIST') }} - link + {{ ('LINK') }} - bold + {{ __('BOLD') }} - italic + {{ __('ITALIC') }} - horizontal line + {{ __('HORIZONTAL_LINE') }} - table + {{ __('TABLE') }} - paragraph + {{ __('PARAGRAPH') }} - code + {{ __('CODE') }} - headline + {{ __('HEADLINE') }} - table of contents + {{ __('TABLE_OF_CONTENTS') }} - definition + {{ __('DEFINITION') }} - check + {{ __('CHECK') }} - cross + {{ __('CROSS') }} {{ assets.renderSvg() }} @@ -165,6 +165,7 @@ myaxios.defaults.baseURL = "{{ base_url }}"; + @@ -173,6 +174,8 @@ {{ assets.renderEditorJS() }} diff --git a/system/author/layouts/layoutEditor.twig b/system/author/layouts/layoutEditor.twig index deaecd0..f3a5b1a 100644 --- a/system/author/layouts/layoutEditor.twig +++ b/system/author/layouts/layoutEditor.twig @@ -28,19 +28,19 @@ - external-link + {{ __('EXTERNAL_LINK') }} - text-file + {{ __('TEXT_FILE') }} - cog + {{ __('COG') }} - power-off + {{ __('POWER_OFF') }} @@ -65,11 +65,17 @@ myaxios.defaults.baseURL = "{{ base_url }}"; + + + {{ assets.renderEditorJS() }} diff --git a/system/author/partials/fields.twig b/system/author/partials/fields.twig index dce1ed7..3e60ac7 100644 --- a/system/author/partials/fields.twig +++ b/system/author/partials/fields.twig @@ -1,7 +1,7 @@
-
' + '
' + '
' + - '' + - '' + + '' + + '' + '
' + '
' + '
' + @@ -15,8 +15,8 @@ const contentComponent = Vue.component('content-block', { '' + '' + '
' + - '' + - '' + + '' + + '' + '
' + '
' + '
' + @@ -895,25 +895,25 @@ const tableComponent = Vue.component('table-component', { '' + '{{value}} ' + '
' + - '
add right column
' + - '
add left column
' + - '
delete column
' + + '
{{ $t(\'add right column\') }}
' + + '
{{ $t(\'add left column\') }}
' + + '
{{ $t(\'delete column\') }}
' + '
' + '' + '' + '
' + - '
add row above
' + - '
add row below
' + - '
delete row
' + + '
{{ $t(\'add row above\') }}
' + + '
{{ $t(\'add row below\') }}
' + + '
{{ $t(\'delete row\') }}
' + '
' + - '{{value}}' + + '{{ $t(value) }}' + '' + '
' + - '
add row above
' + - '
add row below
' + - '
delete row
' + + '
{{ $t(\'add row above\') }}
' + + '
{{ $t(\'add row below\') }}
' + + '
{{ $t(\'delete row\') }}
' + '
' + - '{{ value }}' + + '{{ $t(value) }}' + '' + '' + '' + @@ -1092,13 +1092,13 @@ const definitionComponent = Vue.component('definition-component', { '' + '
' + '' + - '' + + '' + '' + - '' + + '' + '' + '
' + '
' + - '' + + '' + '
' + '
', mounted: function(){ @@ -1169,7 +1169,7 @@ const videoComponent = Vue.component('video-component', { props: ['compmarkdown', 'disabled', 'load'], template: '
' + '
' + - '' + + '' + '
' + '
', methods: { @@ -1185,16 +1185,16 @@ const imageComponent = Vue.component('image-component', { template: '
' + '' + ' ' + - '

drag a picture or click to select

' + + '

{{ $t(\'drag a picture or click to select\') }}

' + '
' + '' + '
' + '
' + - '' + - '' + - '' + - '' + - '' + + '' + + '' + + '' + + '' + + '' + '' + '
', data: function(){ @@ -1467,6 +1467,11 @@ for(var i = 0; i < formatConfig.length; i++) } let editor = new Vue({ + i18n: new VueI18n({ + locale: language, + messages: vuejsLabels + }), + delimiters: ['${', '}'], el: '#blox', /* components: componentList, */ diff --git a/system/author/js/vue-i18n.min.js b/system/author/js/vue-i18n.min.js new file mode 100644 index 0000000..d3cc572 --- /dev/null +++ b/system/author/js/vue-i18n.min.js @@ -0,0 +1,6 @@ +/*! + * vue-i18n v8.15.3 + * (c) 2019 kazuya kawaguchi + * Released under the MIT License. + */ +var t,e;t=this,e=function(){"use strict";var t=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher","unit"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}function n(t){return null!==t&&"object"==typeof t}var r=Object.prototype.toString,i="[object Object]";function a(t){return r.call(t)===i}function s(t){return null==t}function o(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=null,i=null;return 1===t.length?n(t[0])||Array.isArray(t[0])?i=t[0]:"string"==typeof t[0]&&(r=t[0]):2===t.length&&("string"==typeof t[0]&&(r=t[0]),(n(t[1])||Array.isArray(t[1]))&&(i=t[1])),{locale:r,params:i}}function l(t){return JSON.parse(JSON.stringify(t))}var c=Object.prototype.hasOwnProperty;function u(t,e){return c.call(t,e)}function f(t){for(var e=arguments,r=Object(t),i=1;i0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var i=this.$i18n;return i._tc.apply(i,[t,i.locale,i._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}(y),y.mixin(p),y.directive("t",{bind:d,update:F,unbind:k}),y.component(m.name,m),y.component(b.name,b),y.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var T=function(){this._caches=Object.create(null)};T.prototype.interpolate=function(t,e){if(!e)return[t];var r=this._caches[t];return r||(r=function(t){var e=[],n=0,r="";for(;n0)f--,u=N,h[I]();else{if(f=0,void 0===n)return!1;if(!1===(n=z(n)))return!1;h[O]()}};null!==u;)if("\\"!==(e=t[++c])||!p()){if(i=P(e),(a=(o=V[u])[i]||o.else||R)===R)return;if(u=a[0],(s=h[a[1]])&&(r=void 0===(r=a[2])?e:r,!1===s()))return;if(u===H)return l}}(t))&&(this._cache[t]=e),e||[]},J.prototype.getPathValue=function(t,e){if(!n(t))return null;var r=this.parsePath(e);if(0===r.length)return null;for(var i=r.length,a=t,s=0;s/,B=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,G=/^@(?:\.([a-z]+))?:/,X=/[()]/g,Z={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()}},K=new T,Q=function(t){var e=this;void 0===t&&(t={}),!y&&"undefined"!=typeof window&&window.Vue&&D(window.Vue);var n=t.locale||"en-US",r=t.fallbackLocale||"en-US",i=t.messages||{},a=t.dateTimeFormats||{},o=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||K,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new J,this._dataListeners=[],this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._exist=function(t,n){return!(!t||!n)&&(!s(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(i).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,i[t])}),this._initVM({locale:n,fallbackLocale:r,messages:i,dateTimeFormats:a,numberFormats:o})},Y={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0}};return Q.prototype._checkLocaleMessage=function(t,n,r){var i=function(t,n,r,s){if(a(r))Object.keys(r).forEach(function(e){var o=r[e];a(o)?(s.push(e),s.push("."),i(t,n,o,s),s.pop(),s.pop()):(s.push(e),i(t,n,o,s),s.pop())});else if(Array.isArray(r))r.forEach(function(e,r){a(e)?(s.push("["+r+"]"),s.push("."),i(t,n,e,s),s.pop(),s.pop()):(s.push("["+r+"]"),i(t,n,e,s),s.pop())});else if("string"==typeof r){if(q.test(r)){var o="Detected HTML in message '"+r+"' of keypath '"+s.join("")+"' at '"+n+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?e(o):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(o)}}};i(n,t,r,[])},Q.prototype._initVM=function(t){var e=y.config.silent;y.config.silent=!0,this._vm=new y({data:t}),y.config.silent=e},Q.prototype.destroyVM=function(){this._vm.$destroy()},Q.prototype.subscribeDataChanging=function(t){this._dataListeners.push(t)},Q.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)t.splice(n,1)}}(this._dataListeners,t)},Q.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",function(){for(var e=t._dataListeners.length;e--;)y.nextTick(function(){t._dataListeners[e]&&t._dataListeners[e].$forceUpdate()})},{deep:!0})},Q.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(e){t.$set(t,"locale",e),t.$forceUpdate()},{immediate:!0})},Y.vm.get=function(){return this._vm},Y.messages.get=function(){return l(this._getMessages())},Y.dateTimeFormats.get=function(){return l(this._getDateTimeFormats())},Y.numberFormats.get=function(){return l(this._getNumberFormats())},Y.availableLocales.get=function(){return Object.keys(this.messages).sort()},Y.locale.get=function(){return this._vm.locale},Y.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},Y.fallbackLocale.get=function(){return this._vm.fallbackLocale},Y.fallbackLocale.set=function(t){this._vm.$set(this._vm,"fallbackLocale",t)},Y.formatFallbackMessages.get=function(){return this._formatFallbackMessages},Y.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},Y.missing.get=function(){return this._missing},Y.missing.set=function(t){this._missing=t},Y.formatter.get=function(){return this._formatter},Y.formatter.set=function(t){this._formatter=t},Y.silentTranslationWarn.get=function(){return this._silentTranslationWarn},Y.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},Y.silentFallbackWarn.get=function(){return this._silentFallbackWarn},Y.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},Y.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},Y.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},Y.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},Y.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})}},Q.prototype._getMessages=function(){return this._vm.messages},Q.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},Q.prototype._getNumberFormats=function(){return this._vm.numberFormats},Q.prototype._warnDefault=function(t,e,n,r,i){if(!s(n))return n;if(this._missing){var a=this._missing.apply(null,[t,e,r,i]);if("string"==typeof a)return a}if(this._formatFallbackMessages){var l=o.apply(void 0,i);return this._render(e,"string",l.params,e)}return e},Q.prototype._isFallbackRoot=function(t){return!t&&!s(this._root)&&this._fallbackRoot},Q.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},Q.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},Q.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},Q.prototype._interpolate=function(t,e,n,r,i,o,l){if(!e)return null;var c,u=this._path.getPathValue(e,n);if(Array.isArray(u)||a(u))return u;if(s(u)){if(!a(e))return null;if("string"!=typeof(c=e[n]))return null}else{if("string"!=typeof u)return null;c=u}return(c.indexOf("@:")>=0||c.indexOf("@.")>=0)&&(c=this._link(t,e,c,r,"raw",o,l)),this._render(c,i,o,n)},Q.prototype._link=function(t,e,n,r,i,a,s){var o=n,l=o.match(B);for(var c in l)if(l.hasOwnProperty(c)){var u=l[c],f=u.match(G),h=f[0],p=f[1],m=u.replace(h,"").replace(X,"");if(s.includes(m))return o;s.push(m);var g=this._interpolate(t,e,m,r,"raw"===i?"string":i,"raw"===i?void 0:a,s);if(this._isFallbackRoot(g)){if(!this._root)throw Error("unexpected error");var _=this._root.$i18n;g=_._translate(_._getMessages(),_.locale,_.fallbackLocale,m,r,i,a)}g=this._warnDefault(t,m,g,r,Array.isArray(a)?a:[a]),this._modifiers.hasOwnProperty(p)?g=this._modifiers[p](g):Z.hasOwnProperty(p)&&(g=Z[p](g)),s.pop(),o=g?o.replace(u,g):o}return o},Q.prototype._render=function(t,e,n,r){var i=this._formatter.interpolate(t,n,r);return i||(i=K.interpolate(t,n,r)),"string"===e?i.join(""):i},Q.prototype._translate=function(t,e,n,r,i,a,o){var l=this._interpolate(e,t[e],r,i,a,o,[r]);return s(l)&&s(l=this._interpolate(n,t[n],r,i,a,o,[r]))?null:l},Q.prototype._t=function(t,e,n,r){for(var i,a=[],s=arguments.length-4;s-- >0;)a[s]=arguments[s+4];if(!t)return"";var l=o.apply(void 0,a),c=l.locale||e,u=this._translate(n,c,this.fallbackLocale,t,r,"string",l.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(i=this._root).$t.apply(i,[t].concat(a))}return this._warnDefault(c,t,u,r,a)},Q.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},Q.prototype._i=function(t,e,n,r,i){var a=this._translate(n,e,this.fallbackLocale,t,r,"raw",i);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,i)}return this._warnDefault(e,t,a,r,[i])},Q.prototype.i=function(t,e,n){return t?("string"!=typeof e&&(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},Q.prototype._tc=function(t,e,n,r,i){for(var a,s=[],l=arguments.length-5;l-- >0;)s[l]=arguments[l+5];if(!t)return"";void 0===i&&(i=1);var c={count:i,n:i},u=o.apply(void 0,s);return u.params=Object.assign(c,u.params),s=null===u.locale?[u.params]:[u.locale,u.params],this.fetchChoice((a=this)._t.apply(a,[t,e,n,r].concat(s)),i)},Q.prototype.fetchChoice=function(t,e){if(!t&&"string"!=typeof t)return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},Q.prototype.getChoiceIndex=function(t,e){var n,r;return this.locale in this.pluralizationRules?this.pluralizationRules[this.locale].apply(this,[t,e]):(n=t,r=e,n=Math.abs(n),2===r?n?n>1?1:0:1:n?Math.min(n,2):0)},Q.prototype.tc=function(t,e){for(var n,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},Q.prototype._te=function(t,e,n){for(var r=[],i=arguments.length-3;i-- >0;)r[i]=arguments[i+3];var a=o.apply(void 0,r).locale||e;return this._exist(n[a],t)},Q.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},Q.prototype.getLocaleMessage=function(t){return l(this._vm.messages[t]||{})},Q.prototype.setLocaleMessage=function(t,e){("warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||(this._checkLocaleMessage(t,this._warnHtmlInMessage,e),"error"!==this._warnHtmlInMessage))&&this._vm.$set(this._vm.messages,t,e)},Q.prototype.mergeLocaleMessage=function(t,e){("warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||(this._checkLocaleMessage(t,this._warnHtmlInMessage,e),"error"!==this._warnHtmlInMessage))&&this._vm.$set(this._vm.messages,t,f({},this._vm.messages[t]||{},e))},Q.prototype.getDateTimeFormat=function(t){return l(this._vm.dateTimeFormats[t]||{})},Q.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e)},Q.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,f(this._vm.dateTimeFormats[t]||{},e))},Q.prototype._localizeDateTime=function(t,e,n,r,i){var a=e,o=r[a];if((s(o)||s(o[i]))&&(o=r[a=n]),s(o)||s(o[i]))return null;var l=o[i],c=a+"__"+i,u=this._dateTimeFormatters[c];return u||(u=this._dateTimeFormatters[c]=new Intl.DateTimeFormat(a,l)),u.format(t)},Q.prototype._d=function(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);var r=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return r||""},Q.prototype.d=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=this.locale,a=null;return 1===e.length?"string"==typeof e[0]?a=e[0]:n(e[0])&&(e[0].locale&&(i=e[0].locale),e[0].key&&(a=e[0].key)):2===e.length&&("string"==typeof e[0]&&(a=e[0]),"string"==typeof e[1]&&(i=e[1])),this._d(t,i,a)},Q.prototype.getNumberFormat=function(t){return l(this._vm.numberFormats[t]||{})},Q.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e)},Q.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,f(this._vm.numberFormats[t]||{},e))},Q.prototype._getNumberFormatter=function(t,e,n,r,i,a){var o=e,l=r[o];if((s(l)||s(l[i]))&&(l=r[o=n]),s(l)||s(l[i]))return null;var c,u=l[i];if(a)c=new Intl.NumberFormat(o,Object.assign({},u,a));else{var f=o+"__"+i;(c=this._numberFormatters[f])||(c=this._numberFormatters[f]=new Intl.NumberFormat(o,u))}return c},Q.prototype._n=function(t,e,n,r){if(!Q.availabilities.numberFormat)return"";if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).format(t);var i=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),a=i&&i.format(t);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},r))}return a||""},Q.prototype.n=function(e){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];var a=this.locale,s=null,o=null;return 1===r.length?"string"==typeof r[0]?s=r[0]:n(r[0])&&(r[0].locale&&(a=r[0].locale),r[0].key&&(s=r[0].key),o=Object.keys(r[0]).reduce(function(e,n){var i;return t.includes(n)?Object.assign({},e,((i={})[n]=r[0][n],i)):e},null)):2===r.length&&("string"==typeof r[0]&&(s=r[0]),"string"==typeof r[1]&&(a=r[1])),this._n(e,a,s,o)},Q.prototype._ntp=function(t,e,n,r){if(!Q.availabilities.numberFormat)return[];if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).formatToParts(t);var i=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),a=i&&i.formatToParts(t);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,r)}return a||[]},Object.defineProperties(Q.prototype,Y),Object.defineProperty(Q,"availabilities",{get:function(){if(!U){var t="undefined"!=typeof Intl;U={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return U}}),Q.install=D,Q.version="8.15.3",Q},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueI18n=e(); diff --git a/system/author/layouts/layoutEditor.twig b/system/author/layouts/layoutEditor.twig index deaecd0..f3a5b1a 100644 --- a/system/author/layouts/layoutEditor.twig +++ b/system/author/layouts/layoutEditor.twig @@ -28,19 +28,19 @@ - external-link + {{ __('EXTERNAL_LINK') }} - text-file + {{ __('TEXT_FILE') }} - cog + {{ __('COG') }} - power-off + {{ __('POWER_OFF') }} @@ -65,11 +65,17 @@ myaxios.defaults.baseURL = "{{ base_url }}"; + + + {{ assets.renderEditorJS() }} diff --git a/system/author/partials/fields.twig b/system/author/partials/fields.twig index dce1ed7..3e60ac7 100644 --- a/system/author/partials/fields.twig +++ b/system/author/partials/fields.twig @@ -1,7 +1,7 @@
-