From: Tiago Melo Date: Tue, 1 Oct 2019 14:40:06 +0000 (+0000) Subject: mgr/dashboard: Fix translation of variables X-Git-Tag: v15.1.0~1246^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fdd16517928d3cd34a0e289b028c4bb5451ef3d3;p=ceph.git mgr/dashboard: Fix translation of variables Translation of variables is not supported. Had to pass the string directly into the i18n method. Signed-off-by: Tiago Melo --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.ts index 26f0965ae98..8504584c736 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.ts @@ -46,15 +46,17 @@ export class OsdSmartListComponent implements OnInit, OnChanges { if (this.isSmartError(smartData)) { let userMessage = ''; if (smartData.smartctl_error_code === -22) { - const msg = - `Smartctl has received an unknown argument (error code ` + - `${smartData.smartctl_error_code}). You may be using an incompatible version of ` + - `smartmontools. Version >= 7.0 of smartmontools is required to ` + - `succesfully retrieve data.`; - userMessage = this.i18n(msg); + userMessage = this.i18n( + `Smartctl has received an unknown argument (error code + {{smartData.smartctl_error_code}}). You may be using an + incompatible version of smartmontools. Version >= 7.0 of + smartmontools is required to succesfully retrieve data.`, + { code: smartData.smartctl_error_code } + ); } else { - const msg = `An error with error code ${smartData.smartctl_error_code} occurred.`; - userMessage = this.i18n(msg); + userMessage = this.i18n('An error with error code {{code}} occurred.', { + code: smartData.smartctl_error_code + }); } result[deviceId] = { error: smartData.error,