diff --git a/client/coral-admin/src/translations.json b/client/coral-admin/src/translations.json index cd598df08..04d810fb4 100644 --- a/client/coral-admin/src/translations.json +++ b/client/coral-admin/src/translations.json @@ -54,7 +54,7 @@ }, "bandialog": { "ban_user": "Ban User?", - "are_you_sure": "Are you sure you would like to ban {props.author.displayName}?", + "are_you_sure": "Are you sure you would like to ban {0}?", "note": "Note: Banning this user will also place this comment in the Rejected queue.", "cancel": "Cancel", "yes_ban_user": "Yes, Ban User" diff --git a/client/coral-framework/modules/i18n/i18n.js b/client/coral-framework/modules/i18n/i18n.js index afe8606d1..b00ea0179 100644 --- a/client/coral-framework/modules/i18n/i18n.js +++ b/client/coral-framework/modules/i18n/i18n.js @@ -48,7 +48,7 @@ class i18n { * it works with nested translations (my.page.title) */ - this.t = (key) => { + this.t = (key, att) => { const arr = key.split('.'); let translation = this.translations; try { @@ -58,8 +58,9 @@ class i18n { return key; } - const val = String(translation); + let val = String(translation); if (val) { + val = val.replace(/\{0\}/g, att); return val; } else { console.warn(`${key} language key not set`);