From 0f469ee332fc0b5c8003486b51bb43264e3f8b70 Mon Sep 17 00:00:00 2001 From: Vildan Softic Date: Wed, 1 Aug 2018 08:22:52 +0200 Subject: [PATCH] fix(service): provide params on updateTranslations when updateTranslations is called for a element, it now passes on params related issue https://github.com/aurelia/i18n/issues/273 --- src/i18n.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/i18n.js b/src/i18n.js index bbdc396d..3c33f05c 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -143,16 +143,23 @@ export class I18N { for (i = 0, l = nodes.length; i < l; i++) { let node = nodes[i]; let keys; + let params; //test every attribute and get the first one that has a value for (let i2 = 0, l2 = this.i18next.options.attributes.length; i2 < l2; i2++) { keys = node.getAttribute(this.i18next.options.attributes[i2]); + const pname = this.i18next.options.attributes[i2] + '-params'; + + if (pname && node.au && node.au[pname]) { + params = node.au[pname].viewModel.value; + } + if (keys) break; } //skip if nothing was found if (!keys) continue; //split the keys into multiple keys separated by a ; - this.updateValue(node, keys); + this.updateValue(node, keys, params); } }