]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/placement.pipe.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / services / placement.pipe.ts
index 3114b1c15ac4a17bd716d0ba23d221394343bed0..bd461bceb2f9fc5345ddf434793d91386e31b577 100644 (file)
@@ -1,14 +1,11 @@
 import { Pipe, PipeTransform } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-import * as _ from 'lodash';
+import _ from 'lodash';
 
 @Pipe({
   name: 'placement'
 })
 export class PlacementPipe implements PipeTransform {
-  constructor(private i18n: I18n) {}
-
   /**
    * Convert the placement configuration into human readable form.
    * The output is equal to the column 'PLACEMENT' in 'ceph orch ls'.
@@ -17,10 +14,10 @@ export class PlacementPipe implements PipeTransform {
    */
   transform(serviceSpec: object | undefined): string {
     if (_.isUndefined(serviceSpec)) {
-      return this.i18n('no spec');
+      return $localize`no spec`;
     }
     if (_.get(serviceSpec, 'unmanaged', false)) {
-      return this.i18n('unmanaged');
+      return $localize`unmanaged`;
     }
     const kv: Array<any> = [];
     const hosts: Array<string> = _.get(serviceSpec, 'placement.hosts');
@@ -31,10 +28,10 @@ export class PlacementPipe implements PipeTransform {
       kv.push(...hosts);
     }
     if (_.isNumber(count)) {
-      kv.push(this.i18n('count:{{count}}', { count }));
+      kv.push($localize`count:${count}`);
     }
     if (_.isString(label)) {
-      kv.push(this.i18n('label:{{label}}', { label }));
+      kv.push($localize`label:${label}`);
     }
     if (_.isString(hostPattern)) {
       kv.push(...hostPattern);