From ea642621974c6c6ee1472945f131a6e0aac75e44 Mon Sep 17 00:00:00 2001 From: Fredrik Karlsson Date: Tue, 20 Oct 2020 17:44:22 +0200 Subject: [PATCH 1/3] Added lang param to App.Utils.renderValue --- assets/app/js/app.utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/app/js/app.utils.js b/assets/app/js/app.utils.js index ca61862b0..7c8b46030 100755 --- a/assets/app/js/app.utils.js +++ b/assets/app/js/app.utils.js @@ -372,8 +372,8 @@ App.Utils.renderer.textarea = App.Utils.renderer.text; - App.Utils.renderValue = function (renderer, v, meta) { - return (this.renderer[renderer] || this.renderer.default)(v, meta); + App.Utils.renderValue = function (renderer, v, meta, lang) { + return (this.renderer[renderer] || this.renderer.default)(v, meta, lang); }; // riot enhancments From 65e01f8a81dfa4f815e92c3107a9eed237099a44 Mon Sep 17 00:00:00 2001 From: Fredrik Karlsson Date: Wed, 21 Oct 2020 10:08:22 +0200 Subject: [PATCH 2/3] Added lang param to localize collectionlink renderer --- modules/Collections/assets/link-collectionitem.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Collections/assets/link-collectionitem.js b/modules/Collections/assets/link-collectionitem.js index 04ea25353..f1f9aea2f 100644 --- a/modules/Collections/assets/link-collectionitem.js +++ b/modules/Collections/assets/link-collectionitem.js @@ -2,9 +2,9 @@ var linkCache = {}; - App.Utils.renderer.collectionlink = function (v, field) { + App.Utils.renderer.collectionlink = function (v, field, lang) { - if (!v) { + if (!v || v.length === 0) { return ''; } @@ -19,7 +19,7 @@ linkCache[v._id] = new Promise(function (resolve) { - App.request('/collections/find', { collection: field.options.link, options: { filter: { _id: v._id } } }).then(function (data) { + App.request('/collections/find', { collection: field.options.link, options: { lang: lang, filter: { _id: v._id } } }).then(function (data) { if (!data.entries || !data.entries.length) { v.display = 'n/a'; From fee3b2cb47567ff1fdea21f2f20d770a569c97bc Mon Sep 17 00:00:00 2001 From: Fredrik Karlsson Date: Wed, 21 Oct 2020 10:37:55 +0200 Subject: [PATCH 3/3] Pass lang to App.Utils.renderValue --- modules/Collections/assets/field-collectionlink.tag | 2 +- modules/Collections/views/partials/entries.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Collections/assets/field-collectionlink.tag b/modules/Collections/assets/field-collectionlink.tag index 38c5b553e..d7b308667 100644 --- a/modules/Collections/assets/field-collectionlink.tag +++ b/modules/Collections/assets/field-collectionlink.tag @@ -119,7 +119,7 @@ - + { App.Utils.dateformat( new Date( 1000 * entry._modified )) } diff --git a/modules/Collections/views/partials/entries.php b/modules/Collections/views/partials/entries.php index 5f5a990f7..2e45e0245 100755 --- a/modules/Collections/views/partials/entries.php +++ b/modules/Collections/views/partials/entries.php @@ -194,7 +194,7 @@
{ field.label || field.name } - +
@@ -226,7 +226,7 @@ - +