Skip to content

Commit

Permalink
fix(service): provide params on updateTranslations
Browse files Browse the repository at this point in the history
when updateTranslations is called for a element, it now passes on params

related issue #273
  • Loading branch information
zewa666 committed Aug 1, 2018
1 parent 5aa4af8 commit 0f469ee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 0f469ee

Please sign in to comment.