]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix translation of variables 30671/head
authorTiago Melo <tmelo@suse.com>
Tue, 1 Oct 2019 14:40:06 +0000 (14:40 +0000)
committerTiago Melo <tmelo@suse.com>
Tue, 1 Oct 2019 14:48:25 +0000 (14:48 +0000)
Translation of variables is not supported.
Had to pass the string directly into the i18n method.

Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-smart-list/osd-smart-list.component.ts

index 26f0965ae98fca043a17d7164fc6490e3623e002..8504584c7363e87bac784f307b5f90aaa49b8430 100644 (file)
@@ -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,