]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Use $localize and locl for TS translations
authorTiago Melo <tmelo@suse.com>
Wed, 6 May 2020 17:11:19 +0000 (17:11 +0000)
committerTiago Melo <tmelo@suse.com>
Thu, 16 Jul 2020 16:01:02 +0000 (16:01 +0000)
Fixes: https://tracker.ceph.com/issues/45950
Signed-off-by: Tiago Melo <tmelo@suse.com>
251 files changed:
src/pybind/mgr/dashboard/frontend/angular.json
src/pybind/mgr/dashboard/frontend/ngcc.config.js
src/pybind/mgr/dashboard/frontend/package-lock.json
src/pybind/mgr/dashboard/frontend/package.json
src/pybind/mgr/dashboard/frontend/src/app/app.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/daemon-list/daemon-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/daemon-list/daemon-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-configuration-form/rbd-configuration-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-configuration-list/rbd-configuration-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-configuration-list/rbd-configuration-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-list/rbd-namespace-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-list/rbd-namespace-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-performance/rbd-performance.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-details/host-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-details/mgr-module-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-list/mgr-module-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-list/mgr-module-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/active-alert-list/active-alert-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/active-alert-list/active-alert-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/rules-list/rules-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/rules-list/rules-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-details/service-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mds-summary.pipe.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mds-summary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mgr-summary.pipe.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mgr-summary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mon-summary.pipe.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mon-summary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/osd-summary.pipe.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/osd-summary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-501/nfs-501.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-501/nfs-501.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-details/pool-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-details/pool-details.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form-data.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-swift-key-modal/rgw-user-swift-key-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-swift-key-modal/rgw-user-swift-key-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/device-list/device-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/device-list/device-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/login-password-form/login-password-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/login-password-form/login-password-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/crush-rule.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/crush-rule.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/erasure-code-profile.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/erasure-code-profile.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/nfs.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/nfs.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/alert-panel/alert-panel.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/back-button/back-button.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/notifications-sidebar/notifications-sidebar.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/orchestrator-doc-modal/orchestrator-doc-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/orchestrator-doc-panel/orchestrator-doc-panel.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select-badges/select-badges.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select-badges/select-badges.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select-messages.model.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/sparkline/sparkline.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/telemetry-notification/telemetry-notification.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/telemetry-notification/telemetry-notification.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/form-loading.directive.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/form-loading.directive.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/boolean-text.pipe.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/boolean-text.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/not-available.pipe.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/not-available.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-silence-matcher.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-silence-matcher.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/rbd-configuration.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/rbd-configuration.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/refresh-interval.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-list.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-wrapper.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/setupJest.ts
src/pybind/mgr/dashboard/frontend/src/testing/unit-test-helper.ts

index a29f222f01c9265c3d34fc371d3a03824a29b7f2..3ebca753a2b8f28d2bf38baa1715813845ec5a97 100644 (file)
@@ -54,9 +54,7 @@
               "node_modules/ngx-toastr/toastr.css",
               "src/styles.scss"
             ],
-            "scripts": [
-              "node_modules/chart.js/dist/Chart.bundle.js"
-            ],
+            "scripts": ["node_modules/chart.js/dist/Chart.bundle.js"],
             "stylePreprocessorOptions": {
               "includePaths": [
                 "src"
index 2d0a64d82a6f4307a1c5970db8658d5c6e8819f1..dff8d9b7fb385afd512c6bbab3824744c2055d73 100644 (file)
@@ -1,9 +1,10 @@
 module.exports = {
   packages: {
     'simplebar-angular': {
-      ignorableDeepImportMatchers: [
-        /simplebar-core\.esm/,
-      ]
+      ignorableDeepImportMatchers: [/simplebar-core\.esm/]
     },
-  },
+    '@locl/cli': {
+      ignorableDeepImportMatchers: [/@angular\/localize/]
+    }
+  }
 };
index 69459333e850bc08bac0d7f133ef98c6b6a286a0..7eeb202fed7e7b17fe1aa9854de634b5f54571af 100644 (file)
       }
     },
     "@babel/compat-data": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.10.4.tgz",
-      "integrity": "sha512-t+rjExOrSVvjQQXNp5zAIYDp00KjdvGl/TpDX5REPr0S9IAIPQMTilcfG6q8c0QFmj9lSTVySV2VTsyggvtNIw==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.10.5.tgz",
+      "integrity": "sha512-mPVoWNzIpYJHbWje0if7Ck36bpbtTvIxOi9+6WSK9wjGEXearAqlwBoTQvVjsAY2VIwgcs8V940geY3okzRCEw==",
       "dev": true,
       "requires": {
         "browserslist": "^4.12.0",
       }
     },
     "@babel/generator": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.4.tgz",
-      "integrity": "sha512-toLIHUIAgcQygFZRAQcsLQV3CBuX6yOIru1kJk/qqqvcRmZrYe6WavZTSG+bB8MxhnL9YPf+pKQfuiP161q7ng==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz",
+      "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==",
       "requires": {
-        "@babel/types": "^7.10.4",
+        "@babel/types": "^7.10.5",
         "jsesc": "^2.5.1",
-        "lodash": "4.17.19",
         "source-map": "^0.5.0"
-      },
-      "dependencies": {
-        "lodash": {
-          "version": "4.17.19"
-        }
       }
     },
     "@babel/helper-annotate-as-pure": {
       }
     },
     "@babel/helper-define-map": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.4.tgz",
-      "integrity": "sha512-nIij0oKErfCnLUCWaCaHW0Bmtl2RO9cN7+u2QT8yqTywgALKlyUVOvHDElh+b5DwVC6YB1FOYFOTWcN/+41EDA==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz",
+      "integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==",
       "dev": true,
       "requires": {
         "@babel/helper-function-name": "^7.10.4",
-        "@babel/types": "^7.10.4",
+        "@babel/types": "^7.10.5",
         "lodash": "4.17.19"
       },
       "dependencies": {
       }
     },
     "@babel/helper-member-expression-to-functions": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.4.tgz",
-      "integrity": "sha512-m5j85pK/KZhuSdM/8cHUABQTAslV47OjfIB9Cc7P+PvlAoBzdb79BGNfw8RhT5Mq3p+xGd0ZfAKixbrUZx0C7A==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz",
+      "integrity": "sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.10.4"
+        "@babel/types": "^7.10.5"
       }
     },
     "@babel/helper-module-imports": {
       }
     },
     "@babel/helper-module-transforms": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.4.tgz",
-      "integrity": "sha512-Er2FQX0oa3nV7eM1o0tNCTx7izmQtwAQsIiaLRWtavAAEcskb0XJ5OjJbVrYXWOTr8om921Scabn4/tzlx7j1Q==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.5.tgz",
+      "integrity": "sha512-4P+CWMJ6/j1W915ITJaUkadLObmCRRSC234uctJfn/vHrsLNxsR8dwlcXv9ZhJWzl77awf+mWXSZEKt5t0OnlA==",
       "dev": true,
       "requires": {
         "@babel/helper-module-imports": "^7.10.4",
         "@babel/helper-simple-access": "^7.10.4",
         "@babel/helper-split-export-declaration": "^7.10.4",
         "@babel/template": "^7.10.4",
-        "@babel/types": "^7.10.4",
+        "@babel/types": "^7.10.5",
         "lodash": "4.17.19"
       },
       "dependencies": {
       "dev": true
     },
     "@babel/helper-regex": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.4.tgz",
-      "integrity": "sha512-inWpnHGgtg5NOF0eyHlC0/74/VkdRITY9dtTpB2PrxKKn+AkVMRiZz/Adrx+Ssg+MLDesi2zohBW6MVq6b4pOQ==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.5.tgz",
+      "integrity": "sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg==",
       "dev": true,
       "requires": {
         "lodash": "4.17.19"
       }
     },
     "@babel/parser": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.4.tgz",
-      "integrity": "sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA=="
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz",
+      "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ=="
     },
     "@babel/plugin-proposal-async-generator-functions": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.4.tgz",
-      "integrity": "sha512-MJbxGSmejEFVOANAezdO39SObkURO5o/8b6fSH6D1pi9RZQt+ldppKPXfqgUWpSQ9asM6xaSaSJIaeWMDRP0Zg==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.5.tgz",
+      "integrity": "sha512-cNMCVezQbrRGvXJwm9fu/1sJj9bHdGAgKodZdLqOQIpfoH3raqmRPBM17+lh7CzhiKRRBrGtZL9WcjxSoGYUSg==",
       "dev": true,
       "requires": {
         "@babel/helper-plugin-utils": "^7.10.4",
       }
     },
     "@babel/plugin-transform-block-scoping": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.4.tgz",
-      "integrity": "sha512-J3b5CluMg3hPUii2onJDRiaVbPtKFPLEaV5dOPY5OeAbDi1iU/UbbFFTgwb7WnanaDy7bjU35kc26W3eM5Qa0A==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.5.tgz",
+      "integrity": "sha512-6Ycw3hjpQti0qssQcA6AMSFDHeNJ++R6dIMnpRqUjFeBBTmTDPa8zgF90OVfTvAo11mXZTlVUViY1g8ffrURLg==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.10.4",
-        "lodash": "4.17.19"
-      },
-      "dependencies": {
-        "lodash": {
-          "version": "4.17.19"
-        }
+        "@babel/helper-plugin-utils": "^7.10.4"
       }
     },
     "@babel/plugin-transform-classes": {
       }
     },
     "@babel/plugin-transform-modules-amd": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.4.tgz",
-      "integrity": "sha512-3Fw+H3WLUrTlzi3zMiZWp3AR4xadAEMv6XRCYnd5jAlLM61Rn+CRJaZMaNvIpcJpQ3vs1kyifYvEVPFfoSkKOA==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.5.tgz",
+      "integrity": "sha512-elm5uruNio7CTLFItVC/rIzKLfQ17+fX7EVz5W0TMgIHFo1zY0Ozzx+lgwhL4plzl8OzVn6Qasx5DeEFyoNiRw==",
       "dev": true,
       "requires": {
-        "@babel/helper-module-transforms": "^7.10.4",
+        "@babel/helper-module-transforms": "^7.10.5",
         "@babel/helper-plugin-utils": "^7.10.4",
         "babel-plugin-dynamic-import-node": "^2.3.3"
       }
       }
     },
     "@babel/plugin-transform-modules-systemjs": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.4.tgz",
-      "integrity": "sha512-Tb28LlfxrTiOTGtZFsvkjpyjCl9IoaRI52AEU/VIwOwvDQWtbNJsAqTXzh+5R7i74e/OZHH2c2w2fsOqAfnQYQ==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.5.tgz",
+      "integrity": "sha512-f4RLO/OL14/FP1AEbcsWMzpbUz6tssRaeQg11RH1BP/XnPpRoVwgeYViMFacnkaw4k4wjRSjn3ip1Uw9TaXuMw==",
       "dev": true,
       "requires": {
         "@babel/helper-hoist-variables": "^7.10.4",
-        "@babel/helper-module-transforms": "^7.10.4",
+        "@babel/helper-module-transforms": "^7.10.5",
         "@babel/helper-plugin-utils": "^7.10.4",
         "babel-plugin-dynamic-import-node": "^2.3.3"
       }
       }
     },
     "@babel/plugin-transform-parameters": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.4.tgz",
-      "integrity": "sha512-RurVtZ/D5nYfEg0iVERXYKEgDFeesHrHfx8RT05Sq57ucj2eOYAP6eu5fynL4Adju4I/mP/I6SO0DqNWAXjfLQ==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.5.tgz",
+      "integrity": "sha512-xPHwUj5RdFV8l1wuYiu5S9fqWGM2DrYc24TMvUiRrPVm+SM3XeqU9BcokQX/kEUe+p2RBwy+yoiR1w/Blq6ubw==",
       "dev": true,
       "requires": {
         "@babel/helper-get-function-arity": "^7.10.4",
       }
     },
     "@babel/plugin-transform-template-literals": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.4.tgz",
-      "integrity": "sha512-4NErciJkAYe+xI5cqfS8pV/0ntlY5N5Ske/4ImxAVX7mk9Rxt2bwDTGv1Msc2BRJvWQcmYEC+yoMLdX22aE4VQ==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.5.tgz",
+      "integrity": "sha512-V/lnPGIb+KT12OQikDvgSuesRX14ck5FfJXt6+tXhdkJ+Vsd0lDCVtF6jcB4rNClYFzaB2jusZ+lNISDk2mMMw==",
       "dev": true,
       "requires": {
         "@babel/helper-annotate-as-pure": "^7.10.4",
       }
     },
     "@babel/runtime": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.4.tgz",
-      "integrity": "sha512-UpTN5yUJr9b4EX2CnGNWIvER7Ab83ibv0pcvvHc4UOdrBI5jb8bj+32cCwPX6xu0mt2daFNjYhoi+X7beH0RSw==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.5.tgz",
+      "integrity": "sha512-otddXKhdNn7d0ptoFRHtMLa8LqDxLYwTjB4nYgM1yy5N6gU/MUf8zqyyLltCH3yAVitBzmwK4us+DD0l/MauAg==",
       "dev": true,
       "requires": {
         "regenerator-runtime": "^0.13.4"
       }
     },
     "@babel/traverse": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.4.tgz",
-      "integrity": "sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz",
+      "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==",
       "requires": {
         "@babel/code-frame": "^7.10.4",
-        "@babel/generator": "^7.10.4",
+        "@babel/generator": "^7.10.5",
         "@babel/helper-function-name": "^7.10.4",
         "@babel/helper-split-export-declaration": "^7.10.4",
-        "@babel/parser": "^7.10.4",
-        "@babel/types": "^7.10.4",
+        "@babel/parser": "^7.10.5",
+        "@babel/types": "^7.10.5",
         "debug": "^4.1.0",
         "globals": "^11.1.0",
         "lodash": "4.17.19"
       }
     },
     "@babel/types": {
-      "version": "7.10.4",
-      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz",
-      "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==",
+      "version": "7.10.5",
+      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz",
+      "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==",
       "requires": {
         "@babel/helper-validator-identifier": "^7.10.4",
         "lodash": "4.17.19",
         }
       }
     },
-    "@mrmlnc/readdir-enhanced": {
-      "version": "2.2.1",
-      "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
-      "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==",
-      "dev": true,
-      "requires": {
-        "call-me-maybe": "^1.0.1",
-        "glob-to-regexp": "^0.3.0"
-      }
-    },
-    "@ng-bootstrap/ng-bootstrap": {
-      "version": "6.1.0",
-      "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-6.1.0.tgz",
-      "integrity": "sha512-2GzkNJBKdeHkaUqaCAqSILPft0IzzHjMfAlAuGY6/ZLlVQ0glt5MTbIXtIhSbjR+OvlrljoXFLrvzs1LGdmE+A=="
-    },
-    "@ngtools/webpack": {
-      "version": "9.1.7",
-      "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-9.1.7.tgz",
-      "integrity": "sha512-A7VB2I42Kn+7jl0tDKzGNLAoZLWSqkKo9Hg1bmKpvAAIz+DSbq3uV+JWgGgTprM3tn0lfkVgmqk4H17HKwAOcg==",
+    "@locl/cli": {
+      "version": "0.0.1-beta.9",
+      "resolved": "https://registry.npmjs.org/@locl/cli/-/cli-0.0.1-beta.9.tgz",
+      "integrity": "sha512-sTYl4q585AftySMct/qNF4i3bTsnVxAN6g1STOUinpfx84s4JYWW9WL0sgl0bdM4sL7+AjxlYg21RxCDc6JUkg==",
       "dev": true,
       "requires": {
-        "@angular-devkit/core": "9.1.7",
-        "enhanced-resolve": "4.1.1",
-        "rxjs": "6.5.4",
-        "webpack-sources": "1.4.3"
+        "@babel/core": "^7.8.6",
+        "chalk": "^3.0.0",
+        "find-up": "^4.1.0",
+        "glob": "^7.1.2",
+        "yargs": "^13.1.0"
       },
       "dependencies": {
-        "rxjs": {
-          "version": "6.5.4",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
-          "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
+        "@babel/core": {
+          "version": "7.10.5",
+          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.5.tgz",
+          "integrity": "sha512-O34LQooYVDXPl7QWCdW9p4NR+QlzOr7xShPPJz8GsuCU3/8ua/wqTr7gmnxXv+WBESiGU/G5s16i6tUvHkNb+w==",
           "dev": true,
           "requires": {
-            "tslib": "^1.9.0"
+            "@babel/code-frame": "^7.10.4",
+            "@babel/generator": "^7.10.5",
+            "@babel/helper-module-transforms": "^7.10.5",
+            "@babel/helpers": "^7.10.4",
+            "@babel/parser": "^7.10.5",
+            "@babel/template": "^7.10.4",
+            "@babel/traverse": "^7.10.5",
+            "@babel/types": "^7.10.5",
+            "convert-source-map": "^1.7.0",
+            "debug": "^4.1.0",
+            "gensync": "^1.0.0-beta.1",
+            "json5": "^2.1.2",
+            "lodash": "4.17.19",
+            "resolve": "^1.3.2",
+            "semver": "^5.4.1",
+            "source-map": "^0.5.0"
+          },
+          "dependencies": {
+            "lodash": {
+              "version": "4.17.19"
+            }
           }
-        }
-      }
-    },
-    "@ngx-translate/i18n-polyfill": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/@ngx-translate/i18n-polyfill/-/i18n-polyfill-1.0.0.tgz",
-      "integrity": "sha512-+UKmSr6cWBJiMDex6w2FwVjEeVnlEsINDGYvTgRaFRI3/IKZrsSVcfISDcBX2wWr6m4jumfOyCcimIl2TxcaoA==",
-      "requires": {
-        "glob": "7.1.2",
-        "tslib": "^1.9.0",
-        "yargs": "10.0.3"
-      },
-      "dependencies": {
-        "ansi-regex": {
-          "version": "2.1.1",
-          "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
-          "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
         },
-        "camelcase": {
+        "ansi-regex": {
           "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
-          "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0="
+          "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+          "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
+          "dev": true
         },
-        "cliui": {
-          "version": "3.2.0",
-          "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
-          "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
+        "ansi-styles": {
+          "version": "4.2.1",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
+          "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
+          "dev": true,
           "requires": {
-            "string-width": "^1.0.1",
-            "strip-ansi": "^3.0.1",
-            "wrap-ansi": "^2.0.0"
-          },
-          "dependencies": {
-            "string-width": {
-              "version": "1.0.2",
-              "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
-              "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
-              "requires": {
-                "code-point-at": "^1.0.0",
-                "is-fullwidth-code-point": "^1.0.0",
-                "strip-ansi": "^3.0.0"
-              }
-            }
+            "@types/color-name": "^1.1.1",
+            "color-convert": "^2.0.1"
           }
         },
-        "find-up": {
-          "version": "2.1.0",
-          "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
-          "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+        "chalk": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
+          "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
+          "dev": true,
           "requires": {
-            "locate-path": "^2.0.0"
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
           }
         },
-        "get-caller-file": {
-          "version": "1.0.3",
-          "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
-          "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
-        },
-        "is-fullwidth-code-point": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
-          "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+        "cliui": {
+          "version": "5.0.0",
+          "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
+          "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
+          "dev": true,
           "requires": {
-            "number-is-nan": "^1.0.0"
+            "string-width": "^3.1.0",
+            "strip-ansi": "^5.2.0",
+            "wrap-ansi": "^5.1.0"
           }
         },
-        "locate-path": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
-          "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
           "requires": {
-            "p-locate": "^2.0.0",
-            "path-exists": "^3.0.0"
+            "color-name": "~1.1.4"
           }
         },
-        "p-limit": {
-          "version": "1.3.0",
-          "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
-          "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true
+        },
+        "emoji-regex": {
+          "version": "7.0.3",
+          "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
+          "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
+          "dev": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true
+        },
+        "is-fullwidth-code-point": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+          "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+          "dev": true
+        },
+        "locate-path": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+          "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+          "dev": true,
           "requires": {
-            "p-try": "^1.0.0"
+            "p-locate": "^3.0.0",
+            "path-exists": "^3.0.0"
           }
         },
         "p-locate": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
-          "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+          "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+          "dev": true,
           "requires": {
-            "p-limit": "^1.1.0"
+            "p-limit": "^2.0.0"
           }
         },
-        "p-try": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
-          "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M="
-        },
         "path-exists": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
-          "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
-        },
-        "require-main-filename": {
-          "version": "1.0.1",
-          "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
-          "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
+          "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+          "dev": true
         },
         "string-width": {
-          "version": "2.1.1",
-          "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
-          "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+          "version": "3.1.0",
+          "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+          "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+          "dev": true,
           "requires": {
+            "emoji-regex": "^7.0.1",
             "is-fullwidth-code-point": "^2.0.0",
-            "strip-ansi": "^4.0.0"
-          },
-          "dependencies": {
-            "ansi-regex": {
-              "version": "3.0.0",
-              "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
-              "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
-            },
-            "is-fullwidth-code-point": {
-              "version": "2.0.0",
-              "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
-              "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
-            },
-            "strip-ansi": {
-              "version": "4.0.0",
-              "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
-              "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
-              "requires": {
-                "ansi-regex": "^3.0.0"
-              }
-            }
+            "strip-ansi": "^5.1.0"
           }
         },
         "strip-ansi": {
-          "version": "3.0.1",
-          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
-          "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+          "version": "5.2.0",
+          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+          "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+          "dev": true,
           "requires": {
-            "ansi-regex": "^2.0.0"
+            "ansi-regex": "^4.1.0"
+          }
+        },
+        "supports-color": {
+          "version": "7.1.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
+          "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
+          "dev": true,
+          "requires": {
+            "has-flag": "^4.0.0"
           }
         },
         "wrap-ansi": {
-          "version": "2.1.0",
-          "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
-          "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
+          "version": "5.1.0",
+          "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
+          "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
+          "dev": true,
           "requires": {
-            "string-width": "^1.0.1",
-            "strip-ansi": "^3.0.1"
+            "ansi-styles": "^3.2.0",
+            "string-width": "^3.0.0",
+            "strip-ansi": "^5.0.0"
           },
           "dependencies": {
-            "string-width": {
-              "version": "1.0.2",
-              "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
-              "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+            "ansi-styles": {
+              "version": "3.2.1",
+              "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+              "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+              "dev": true,
               "requires": {
-                "code-point-at": "^1.0.0",
-                "is-fullwidth-code-point": "^1.0.0",
-                "strip-ansi": "^3.0.0"
+                "color-convert": "^1.9.0"
               }
+            },
+            "color-convert": {
+              "version": "1.9.3",
+              "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+              "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+              "dev": true,
+              "requires": {
+                "color-name": "1.1.3"
+              }
+            },
+            "color-name": {
+              "version": "1.1.3",
+              "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+              "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
+              "dev": true
             }
           }
         },
-        "y18n": {
-          "version": "3.2.1",
-          "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
-          "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
-        },
         "yargs": {
-          "version": "10.0.3",
-          "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.0.3.tgz",
-          "integrity": "sha512-DqBpQ8NAUX4GyPP/ijDGHsJya4tYqLQrjPr95HNsr1YwL3+daCfvBwg7+gIC6IdJhR2kATh3hb61vjzMWEtjdw==",
+          "version": "13.3.2",
+          "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
+          "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==",
+          "dev": true,
           "requires": {
-            "cliui": "^3.2.0",
-            "decamelize": "^1.1.1",
-            "find-up": "^2.1.0",
-            "get-caller-file": "^1.0.1",
-            "os-locale": "^2.0.0",
+            "cliui": "^5.0.0",
+            "find-up": "^3.0.0",
+            "get-caller-file": "^2.0.1",
             "require-directory": "^2.1.1",
-            "require-main-filename": "^1.0.1",
+            "require-main-filename": "^2.0.0",
             "set-blocking": "^2.0.0",
-            "string-width": "^2.0.0",
+            "string-width": "^3.0.0",
             "which-module": "^2.0.0",
-            "y18n": "^3.2.1",
-            "yargs-parser": "^8.0.0"
+            "y18n": "^4.0.0",
+            "yargs-parser": "^13.1.2"
+          },
+          "dependencies": {
+            "find-up": {
+              "version": "3.0.0",
+              "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+              "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+              "dev": true,
+              "requires": {
+                "locate-path": "^3.0.0"
+              }
+            }
           }
         },
         "yargs-parser": {
-          "version": "8.1.0",
-          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz",
-          "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==",
+          "version": "13.1.2",
+          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz",
+          "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
+          "dev": true,
           "requires": {
-            "camelcase": "^4.1.0"
+            "camelcase": "^5.0.0",
+            "decamelize": "^1.2.0"
+          }
+        }
+      }
+    },
+    "@mrmlnc/readdir-enhanced": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
+      "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==",
+      "dev": true,
+      "requires": {
+        "call-me-maybe": "^1.0.1",
+        "glob-to-regexp": "^0.3.0"
+      }
+    },
+    "@ng-bootstrap/ng-bootstrap": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-6.1.0.tgz",
+      "integrity": "sha512-2GzkNJBKdeHkaUqaCAqSILPft0IzzHjMfAlAuGY6/ZLlVQ0glt5MTbIXtIhSbjR+OvlrljoXFLrvzs1LGdmE+A=="
+    },
+    "@ngtools/webpack": {
+      "version": "9.1.7",
+      "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-9.1.7.tgz",
+      "integrity": "sha512-A7VB2I42Kn+7jl0tDKzGNLAoZLWSqkKo9Hg1bmKpvAAIz+DSbq3uV+JWgGgTprM3tn0lfkVgmqk4H17HKwAOcg==",
+      "dev": true,
+      "requires": {
+        "@angular-devkit/core": "9.1.7",
+        "enhanced-resolve": "4.1.1",
+        "rxjs": "6.5.4",
+        "webpack-sources": "1.4.3"
+      },
+      "dependencies": {
+        "rxjs": {
+          "version": "6.5.4",
+          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
+          "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
+          "dev": true,
+          "requires": {
+            "tslib": "^1.9.0"
           }
         }
       }
       },
       "dependencies": {
         "@babel/core": {
-          "version": "7.10.4",
-          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.4.tgz",
-          "integrity": "sha512-3A0tS0HWpy4XujGc7QtOIHTeNwUgWaZc/WuS5YQrfhU67jnVmsD6OGPc1AKHH0LJHQICGncy3+YUjIhVlfDdcA==",
+          "version": "7.10.5",
+          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.5.tgz",
+          "integrity": "sha512-O34LQooYVDXPl7QWCdW9p4NR+QlzOr7xShPPJz8GsuCU3/8ua/wqTr7gmnxXv+WBESiGU/G5s16i6tUvHkNb+w==",
           "dev": true,
           "requires": {
             "@babel/code-frame": "^7.10.4",
-            "@babel/generator": "^7.10.4",
-            "@babel/helper-module-transforms": "^7.10.4",
+            "@babel/generator": "^7.10.5",
+            "@babel/helper-module-transforms": "^7.10.5",
             "@babel/helpers": "^7.10.4",
-            "@babel/parser": "^7.10.4",
+            "@babel/parser": "^7.10.5",
             "@babel/template": "^7.10.4",
-            "@babel/traverse": "^7.10.4",
-            "@babel/types": "^7.10.4",
+            "@babel/traverse": "^7.10.5",
+            "@babel/types": "^7.10.5",
             "convert-source-map": "^1.7.0",
             "debug": "^4.1.0",
             "gensync": "^1.0.0-beta.1",
       }
     },
     "@types/chart.js": {
-      "version": "2.9.22",
-      "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.22.tgz",
-      "integrity": "sha512-CneMxwh2T5fyMpXE5fuprTTmFtlLyZUFq1A3laUrCgOblDzupgiohrFg3jjsTIrqRI5K4qLZdrLN4zT9/MY5Dw==",
+      "version": "2.9.23",
+      "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.23.tgz",
+      "integrity": "sha512-4QQNE/b+digosu3mnj4E7aNQGKnlpzXa9JvQYPtexpO7v9gnDeqwc1DxF8vLJWLDCNoO6hH0EgO8K/7PtJl8wg==",
       "requires": {
         "moment": "^2.10.2"
       }
             "path-is-absolute": "^1.0.0"
           }
         },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
         "mkdirp": {
           "version": "1.0.4",
           "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
           "requires": {
             "glob": "^7.1.3"
           }
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
         }
       }
     },
       }
     },
     "caniuse-lite": {
-      "version": "1.0.30001099",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001099.tgz",
-      "integrity": "sha512-sdS9A+sQTk7wKoeuZBN/YMAHVztUfVnjDi4/UV3sDE8xoh7YR12hKW+pIdB3oqKGwr9XaFL2ovfzt9w8eUI5CA==",
+      "version": "1.0.30001100",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001100.tgz",
+      "integrity": "sha512-0eYdp1+wFCnMlCj2oudciuQn2B9xAFq3WpgpcBIZTxk/1HNA/O2YA7rpeYhnOqsqAJq1AHUgx6i1jtafg7m2zA==",
       "dev": true
     },
     "canonical-path": {
       }
     },
     "chokidar": {
-      "version": "3.4.0",
-      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz",
-      "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==",
+      "version": "3.4.1",
+      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz",
+      "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==",
       "dev": true,
       "requires": {
         "anymatch": "~3.1.1",
     "code-point-at": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
-      "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
+      "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
+      "dev": true
     },
     "codelyzer": {
       "version": "5.2.2",
             "json5": "^1.0.1"
           }
         },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
         "rimraf": {
           "version": "2.7.1",
           "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
           "requires": {
             "figgy-pudding": "^3.5.1"
           }
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
         }
       }
     },
       }
     },
     "cross-spawn": {
-      "version": "5.1.0",
-      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
-      "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
+      "version": "6.0.5",
+      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+      "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+      "dev": true,
       "requires": {
-        "lru-cache": "^4.0.1",
+        "nice-try": "^1.0.4",
+        "path-key": "^2.0.1",
+        "semver": "^5.5.0",
         "shebang-command": "^1.2.0",
         "which": "^1.2.9"
       }
           "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
           "dev": true
         },
-        "cross-spawn": {
-          "version": "6.0.5",
-          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
-          "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
-          "dev": true,
-          "requires": {
-            "nice-try": "^1.0.4",
-            "path-key": "^2.0.1",
-            "semver": "^5.5.0",
-            "shebang-command": "^1.2.0",
-            "which": "^1.2.9"
-          }
-        },
-        "execa": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
-          "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
-          "dev": true,
-          "requires": {
-            "cross-spawn": "^6.0.0",
-            "get-stream": "^4.0.0",
-            "is-stream": "^1.1.0",
-            "npm-run-path": "^2.0.0",
-            "p-finally": "^1.0.0",
-            "signal-exit": "^3.0.0",
-            "strip-eof": "^1.0.0"
-          }
-        },
         "fs-extra": {
           "version": "8.1.0",
           "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
             "universalify": "^0.1.0"
           }
         },
-        "get-stream": {
-          "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
-          "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
-          "dev": true,
-          "requires": {
-            "pump": "^3.0.0"
-          }
-        },
         "glob": {
           "version": "7.1.6",
           "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
     "deep-is": {
       "version": "0.1.3",
       "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
-      "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
-      "dev": true
-    },
-    "deepmerge": {
-      "version": "4.2.2",
-      "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
-      "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
-      "dev": true
-    },
-    "default-gateway": {
-      "version": "4.2.0",
-      "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz",
-      "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==",
-      "dev": true,
-      "requires": {
-        "execa": "^1.0.0",
-        "ip-regex": "^2.1.0"
-      },
-      "dependencies": {
-        "cross-spawn": {
-          "version": "6.0.5",
-          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
-          "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
-          "dev": true,
-          "requires": {
-            "nice-try": "^1.0.4",
-            "path-key": "^2.0.1",
-            "semver": "^5.5.0",
-            "shebang-command": "^1.2.0",
-            "which": "^1.2.9"
-          }
-        },
-        "execa": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
-          "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
-          "dev": true,
-          "requires": {
-            "cross-spawn": "^6.0.0",
-            "get-stream": "^4.0.0",
-            "is-stream": "^1.1.0",
-            "npm-run-path": "^2.0.0",
-            "p-finally": "^1.0.0",
-            "signal-exit": "^3.0.0",
-            "strip-eof": "^1.0.0"
-          }
-        },
-        "get-stream": {
-          "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
-          "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
-          "dev": true,
-          "requires": {
-            "pump": "^3.0.0"
-          }
-        }
+      "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+      "dev": true
+    },
+    "deepmerge": {
+      "version": "4.2.2",
+      "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
+      "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
+      "dev": true
+    },
+    "default-gateway": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz",
+      "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==",
+      "dev": true,
+      "requires": {
+        "execa": "^1.0.0",
+        "ip-regex": "^2.1.0"
       }
     },
     "defaults": {
       "dev": true
     },
     "electron-to-chromium": {
-      "version": "1.3.497",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.497.tgz",
-      "integrity": "sha512-sPdW5bUDZwiFtoonuZCUwRGzsZmKzcLM0bMVhp6SMCfUG+B3faENLx3cE+o+K0Jl+MPuNA9s9cScyFjOlixZpQ==",
+      "version": "1.3.498",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.498.tgz",
+      "integrity": "sha512-W1hGwaQEU8j9su2jeAr3aabkPuuXw+j8t73eajGAkEJWbfWiwbxBwQN/8Qmv2qCy3uCDm2rOAaZneYQM8VGC4w==",
       "dev": true
     },
     "elegant-spinner": {
       }
     },
     "escalade": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.1.tgz",
-      "integrity": "sha512-DR6NO3h9niOT+MZs7bjxlj2a1k+POu5RN8CLTPX2+i78bRi9eLe7+0zXgUHMnGXWybYcL61E9hGhPKqedy8tQA==",
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz",
+      "integrity": "sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==",
       "dev": true
     },
     "escape-html": {
       "dev": true
     },
     "execa": {
-      "version": "0.7.0",
-      "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
-      "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
+      "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
+      "dev": true,
       "requires": {
-        "cross-spawn": "^5.0.1",
-        "get-stream": "^3.0.0",
+        "cross-spawn": "^6.0.0",
+        "get-stream": "^4.0.0",
         "is-stream": "^1.1.0",
         "npm-run-path": "^2.0.0",
         "p-finally": "^1.0.0",
       "dev": true
     },
     "get-stream": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
-      "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+      "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+      "dev": true,
+      "requires": {
+        "pump": "^3.0.0"
+      }
     },
     "get-value": {
       "version": "2.0.6",
           "requires": {
             "yallist": "^4.0.0"
           }
-        },
-        "yallist": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
-          "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
-          "dev": true
         }
       }
     },
             "wrap-ansi": "^2.0.0"
           }
         },
-        "cross-spawn": {
-          "version": "6.0.5",
-          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
-          "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
-          "dev": true,
-          "requires": {
-            "nice-try": "^1.0.4",
-            "path-key": "^2.0.1",
-            "semver": "^5.5.0",
-            "shebang-command": "^1.2.0",
-            "which": "^1.2.9"
-          }
-        },
-        "execa": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
-          "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
-          "dev": true,
-          "requires": {
-            "cross-spawn": "^6.0.0",
-            "get-stream": "^4.0.0",
-            "is-stream": "^1.1.0",
-            "npm-run-path": "^2.0.0",
-            "p-finally": "^1.0.0",
-            "signal-exit": "^3.0.0",
-            "strip-eof": "^1.0.0"
-          }
-        },
         "find-up": {
           "version": "2.1.0",
           "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
           "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
           "dev": true
         },
-        "get-stream": {
-          "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
-          "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
-          "dev": true,
-          "requires": {
-            "pump": "^3.0.0"
-          }
-        },
-        "invert-kv": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
-          "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
-          "dev": true
-        },
         "is-fullwidth-code-point": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
           "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
           "dev": true
         },
-        "lcid": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
-          "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
-          "dev": true,
-          "requires": {
-            "invert-kv": "^2.0.0"
-          }
-        },
         "locate-path": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
             "path-exists": "^3.0.0"
           }
         },
-        "mem": {
-          "dev": true,
-          "requires": {
-            "map-age-cleaner": "^0.1.1",
-            "mimic-fn": "^2.0.0",
-            "p-is-promise": "^2.0.0"
-          },
-          "version": "4.3.0"
-        },
-        "mimic-fn": {
-          "version": "2.1.0",
-          "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
-          "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
-          "dev": true
-        },
-        "os-locale": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
-          "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
-          "dev": true,
-          "requires": {
-            "execa": "^1.0.0",
-            "lcid": "^2.0.0",
-            "mem": "4.3.0"
-          },
-          "dependencies": {
-            "mem": {
-              "version": "4.3.0"
-            }
-          }
-        },
         "p-limit": {
           "version": "1.3.0",
           "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
       }
     },
     "invert-kv": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
-      "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
+      "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
+      "dev": true
     },
     "ip": {
       "version": "1.1.5",
     "is-stream": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
-      "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
+      "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
+      "dev": true
     },
     "is-svg": {
       "version": "3.0.0",
     "isexe": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
-      "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
+      "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+      "dev": true
     },
     "isobject": {
       "version": "3.0.1",
       "dev": true
     },
     "lcid": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
-      "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
+      "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
+      "dev": true,
       "requires": {
-        "invert-kv": "^1.0.0"
+        "invert-kv": "^2.0.0"
       }
     },
     "less": {
             "escape-string-regexp": "^1.0.5"
           }
         },
+        "mimic-fn": {
+          "version": "1.2.0",
+          "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+          "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
+          "dev": true
+        },
         "onetime": {
           "version": "2.0.1",
           "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
           "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
           "dev": true
         },
+        "mimic-fn": {
+          "version": "1.2.0",
+          "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+          "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
+          "dev": true
+        },
         "onetime": {
           "version": "2.0.1",
           "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
       }
     },
     "lru-cache": {
-      "version": "4.1.5",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
-      "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
+      "version": "5.1.1",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+      "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+      "dev": true,
       "requires": {
-        "pseudomap": "^1.0.2",
-        "yallist": "^2.1.2"
+        "yallist": "^3.0.2"
+      },
+      "dependencies": {
+        "yallist": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
+          "dev": true
+        }
       }
     },
     "lunr": {
             "path-is-absolute": "^1.0.0"
           }
         },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
         "rimraf": {
           "version": "2.7.1",
           "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
           "requires": {
             "figgy-pudding": "^3.5.1"
           }
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
         }
       }
     },
       "dev": true
     },
     "mem": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
+      "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
+      "dev": true,
       "requires": {
-        "mimic-fn": "^1.0.0"
-      },
-      "version": "4.3.0"
+        "map-age-cleaner": "^0.1.1",
+        "mimic-fn": "^2.0.0",
+        "p-is-promise": "^2.0.0"
+      }
     },
     "memory-fs": {
       "version": "0.5.0",
       }
     },
     "mimic-fn": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
-      "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+      "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+      "dev": true
     },
     "min-indent": {
       "version": "1.0.1",
       "dev": true,
       "requires": {
         "yallist": "^4.0.0"
-      },
-      "dependencies": {
-        "yallist": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
-          "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
-          "dev": true
-        }
       }
     },
     "minipass-collect": {
       "requires": {
         "minipass": "^3.0.0",
         "yallist": "^4.0.0"
-      },
-      "dependencies": {
-        "yallist": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
-          "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
-          "dev": true
-        }
       }
     },
     "mississippi": {
       }
     },
     "mri": {
-      "version": "1.1.5",
-      "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.5.tgz",
-      "integrity": "sha512-d2RKzMD4JNyHMbnbWnznPaa8vbdlq/4pNZ3IgdaGrVbBhebBsGUUE/6qorTMYNS6TwuH3ilfOlD2bf4Igh8CKg==",
+      "version": "1.1.6",
+      "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz",
+      "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==",
       "dev": true
     },
     "ms": {
           "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
           "dev": true
         },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
         "npm-package-arg": {
           "version": "6.1.1",
           "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz",
           "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
           "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
           "dev": true
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
         }
       }
     },
         "string.prototype.padend": "^3.0.0"
       },
       "dependencies": {
-        "cross-spawn": {
-          "version": "6.0.5",
-          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
-          "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
-          "dev": true,
-          "requires": {
-            "nice-try": "^1.0.4",
-            "path-key": "^2.0.1",
-            "semver": "^5.5.0",
-            "shebang-command": "^1.2.0",
-            "which": "^1.2.9"
-          }
-        },
         "read-pkg": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
       "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
+      "dev": true,
       "requires": {
         "path-key": "^2.0.0"
       }
     "number-is-nan": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
-      "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
+      "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
+      "dev": true
     },
     "nwsapi": {
       "version": "2.2.0",
       "dev": true,
       "requires": {
         "mimic-fn": "^2.1.0"
-      },
-      "dependencies": {
-        "mimic-fn": {
-          "version": "2.1.0",
-          "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
-          "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
-          "dev": true
-        }
       }
     },
     "open": {
       "dev": true
     },
     "os-locale": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz",
-      "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==",
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
+      "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
+      "dev": true,
       "requires": {
-        "execa": "^0.7.0",
-        "lcid": "^1.0.0",
-        "mem": "4.3.0"
-      },
-      "dependencies": {
-        "mem": {
-          "version": "4.3.0"
-        }
+        "execa": "^1.0.0",
+        "lcid": "^2.0.0",
+        "mem": "^4.0.0"
       }
     },
     "os-name": {
     "p-finally": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
-      "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
+      "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
+      "dev": true
     },
     "p-is-promise": {
       "version": "2.1.0",
             "minipass": "^2.6.0"
           }
         },
-        "get-stream": {
-          "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
-          "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
-          "dev": true,
-          "requires": {
-            "pump": "^3.0.0"
-          }
-        },
         "glob": {
           "version": "7.1.6",
           "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
           "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
           "dev": true
         },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
         "minipass": {
           "version": "2.9.0",
           "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
     "path-key": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
-      "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
+      "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
+      "dev": true
     },
     "path-parse": {
       "version": "1.0.6",
         "event-stream": "=3.3.4"
       }
     },
-    "pseudomap": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
-      "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
-    },
     "psl": {
       "version": "1.8.0",
       "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
             "normalize-path": "^2.1.1"
           }
         },
-        "cross-spawn": {
-          "version": "6.0.5",
-          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
-          "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
-          "dev": true,
-          "requires": {
-            "nice-try": "^1.0.4",
-            "path-key": "^2.0.1",
-            "semver": "^5.5.0",
-            "shebang-command": "^1.2.0",
-            "which": "^1.2.9"
-          }
-        },
-        "execa": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
-          "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
-          "dev": true,
-          "requires": {
-            "cross-spawn": "^6.0.0",
-            "get-stream": "^4.0.0",
-            "is-stream": "^1.1.0",
-            "npm-run-path": "^2.0.0",
-            "p-finally": "^1.0.0",
-            "signal-exit": "^3.0.0",
-            "strip-eof": "^1.0.0"
-          }
-        },
-        "get-stream": {
-          "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
-          "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
-          "dev": true,
-          "requires": {
-            "pump": "^3.0.0"
-          }
-        },
         "normalize-path": {
           "version": "2.1.1",
           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
       "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
+      "dev": true,
       "requires": {
         "shebang-regex": "^1.0.0"
       }
     "shebang-regex": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
-      "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
+      "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
+      "dev": true
     },
     "shell-quote": {
       "version": "1.7.2",
     "signal-exit": {
       "version": "3.0.3",
       "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
-      "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
+      "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
+      "dev": true
     },
     "simple-swizzle": {
       "version": "0.2.2",
     "strip-eof": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
-      "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
+      "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
+      "dev": true
     },
     "strip-final-newline": {
       "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
           "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
           "dev": true
-        },
-        "yallist": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
-          "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
-          "dev": true
         }
       }
     },
             "path-is-absolute": "^1.0.0"
           }
         },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
         "rimraf": {
           "version": "2.7.1",
           "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
             "figgy-pudding": "^3.5.1",
             "minipass": "^3.1.1"
           }
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
         }
       }
     },
             "json5": "^1.0.1"
           }
         },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
         "memory-fs": {
           "version": "0.4.1",
           "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz",
             "webpack-sources": "^1.4.0",
             "worker-farm": "^1.7.0"
           }
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
         }
       }
     },
       "version": "1.3.1",
       "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
       "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+      "dev": true,
       "requires": {
         "isexe": "^2.0.0"
       }
       "dev": true,
       "requires": {
         "execa": "^1.0.0"
-      },
-      "dependencies": {
-        "cross-spawn": {
-          "version": "6.0.5",
-          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
-          "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
-          "dev": true,
-          "requires": {
-            "nice-try": "^1.0.4",
-            "path-key": "^2.0.1",
-            "semver": "^5.5.0",
-            "shebang-command": "^1.2.0",
-            "which": "^1.2.9"
-          }
-        },
-        "execa": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
-          "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
-          "dev": true,
-          "requires": {
-            "cross-spawn": "^6.0.0",
-            "get-stream": "^4.0.0",
-            "is-stream": "^1.1.0",
-            "npm-run-path": "^2.0.0",
-            "p-finally": "^1.0.0",
-            "signal-exit": "^3.0.0",
-            "strip-eof": "^1.0.0"
-          }
-        },
-        "get-stream": {
-          "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
-          "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
-          "dev": true,
-          "requires": {
-            "pump": "^3.0.0"
-          }
-        }
       }
     },
     "word-wrap": {
       "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
     },
     "yallist": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
-      "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+      "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+      "dev": true
     },
     "yaml": {
       "version": "1.10.0",
index e99130f2f5ab226d0b2932d654bd9310a03d8141..ddee0a3c23b9b6d63fd9e87cb54e8c0f94b4ccc0 100644 (file)
@@ -13,7 +13,7 @@
     "postbuild:localize": "node cd --res",
     "env_build": "node cd --env",
     "i18n": "npm run i18n:extract && npm run i18n:push && npm run i18n:pull && npm run i18n:merge",
-    "i18n:extract": "ng xi18n --output-path locale --progress=false && ngx-extractor -i 'src/**/*.ts' -f xlf -o src/locale/messages.xlf -l en-US",
+    "i18n:extract": "ng build --localize=false && locl extract -s=dist/*.js -f=xlf -o=src/locale/messages.xlf",
     "i18n:push": "npx i18ntool push -c i18n.config.json",
     "i18n:pull": "npx i18ntool pull -c i18n.config.json",
     "i18n:merge": "npx i18ntool merge -c i18n.config.json",
@@ -78,7 +78,6 @@
     "@angular/router": "9.1.11",
     "@auth0/angular-jwt": "4.2.0",
     "@ng-bootstrap/ng-bootstrap": "6.1.0",
-    "@ngx-translate/i18n-polyfill": "1.0.0",
     "@swimlane/ngx-datatable": "17.0.0",
     "@types/file-saver": "2.0.1",
     "angular-tree-component": "8.5.6",
     "@angular/compiler-cli": "9.1.11",
     "@angular/language-service": "9.1.11",
     "@compodoc/compodoc": "1.1.11",
+    "@locl/cli": "0.0.1-beta.9",
     "@types/jest": "26.0.3",
     "@types/lodash": "4.14.157",
     "@types/node": "12.12.47",
     "typescript": "3.8.3"
   },
   "resolutions": {
-    "mem": "4.3.0",
     "fsevents": "2.1.2",
     "lodash": "4.17.19"
   }
index 5a48d7eefdde7b348796c1dc8da1d0e1e75b1463..a8803d962779df333241383b0bf0127d5af600f1 100644 (file)
@@ -1,20 +1,12 @@
 import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
-import {
-  ErrorHandler,
-  LOCALE_ID,
-  NgModule,
-  TRANSLATIONS,
-  TRANSLATIONS_FORMAT
-} from '@angular/core';
+import { ErrorHandler, NgModule } from '@angular/core';
 import { BrowserModule } from '@angular/platform-browser';
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 
 import { JwtModule } from '@auth0/angular-jwt';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { ToastrModule } from 'ngx-toastr';
 
-import { environment } from '../environments/environment';
 import { AppRoutingModule } from './app-routing.module';
 import { AppComponent } from './app.component';
 import { CephModule } from './ceph/ceph.module';
@@ -59,21 +51,7 @@ export function jwtTokenGetter() {
       provide: HTTP_INTERCEPTORS,
       useClass: ApiInterceptorService,
       multi: true
-    },
-    {
-      provide: TRANSLATIONS,
-      useFactory: (locale: string) => {
-        locale = locale || environment.default_lang;
-        try {
-          return require(`raw-loader!locale/messages.${locale}.xlf`).default;
-        } catch (error) {
-          return [];
-        }
-      },
-      deps: [LOCALE_ID]
-    },
-    { provide: TRANSLATIONS_FORMAT, useValue: 'xlf' },
-    I18n
+    }
   ],
   bootstrap: [AppComponent]
 })
index 4e0514e0c51024a505bd1cb7ca25c82d204d507b..e0cef596b6a320bed29e7a1b986cbba8fd660075 100644 (file)
@@ -4,7 +4,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 import { TreeModel, TreeModule } from 'angular-tree-component';
 import * as _ from 'lodash';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { IscsiTargetDetailsComponent } from './iscsi-target-details.component';
 
@@ -14,8 +14,7 @@ describe('IscsiTargetDetailsComponent', () => {
 
   configureTestBed({
     declarations: [IscsiTargetDetailsComponent],
-    imports: [BrowserAnimationsModule, TreeModule.forRoot(), SharedModule],
-    providers: [i18nProviders]
+    imports: [BrowserAnimationsModule, TreeModule.forRoot(), SharedModule]
   });
 
   beforeEach(() => {
index e7b3b96c9c5d148d9e8176e48e8c8682a6a6a56d..983efd4580c597c3d8658a4204e1065376839fc8 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import {
   ITreeOptions,
   TreeComponent,
@@ -61,7 +60,6 @@ export class IscsiTargetDetailsComponent implements OnChanges, OnInit {
   };
 
   constructor(
-    private i18n: I18n,
     private iscsiBackstorePipe: IscsiBackstorePipe,
     private booleanTextPipe: BooleanTextPipe
   ) {}
@@ -70,19 +68,19 @@ export class IscsiTargetDetailsComponent implements OnChanges, OnInit {
     this.columns = [
       {
         prop: 'displayName',
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         flexGrow: 1,
         cellTemplate: this.highlightTpl
       },
       {
         prop: 'current',
-        name: this.i18n('Current'),
+        name: $localize`Current`,
         flexGrow: 1,
         cellTemplate: this.highlightTpl
       },
       {
         prop: 'default',
-        name: this.i18n('Default'),
+        name: $localize`Default`,
         flexGrow: 1,
         cellTemplate: this.highlightTpl
       }
index ed0a6652187cc4ef842d360418c6a0fcce91c2fb..4f6eec2dd2389671547783d222d2b7ac6efaf999 100644 (file)
@@ -11,12 +11,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import {
-  configureTestBed,
-  FormHelper,
-  i18nProviders,
-  IscsiHelper
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper, IscsiHelper } from '../../../../testing/unit-test-helper';
 import { Permission } from '../../../shared/models/permissions';
 import { SharedModule } from '../../../shared/shared.module';
 import { IscsiTargetDiscoveryModalComponent } from './iscsi-target-discovery-modal.component';
@@ -39,7 +34,7 @@ describe('IscsiTargetDiscoveryModalComponent', () => {
       ToastrModule.forRoot(),
       RouterTestingModule
     ],
-    providers: [i18nProviders, NgbActiveModal]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index 9f150747d756001fe50fea8a4510852eef9bdee8..914d141b01f952e5ec127842cbf000149294ddcb 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 
 import { IscsiService } from '../../../shared/api/iscsi.service';
 import { NotificationType } from '../../../shared/enum/notification-type.enum';
@@ -29,8 +28,7 @@ export class IscsiTargetDiscoveryModalComponent implements OnInit {
     private authStorageService: AuthStorageService,
     public activeModal: NgbActiveModal,
     private iscsiService: IscsiService,
-    private notificationService: NotificationService,
-    private i18n: I18n
+    private notificationService: NotificationService
   ) {
     this.permission = this.authStorageService.getPermissions().iscsi;
   }
@@ -111,7 +109,7 @@ export class IscsiTargetDiscoveryModalComponent implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Updated discovery authentication')
+          $localize`Updated discovery authentication`
         );
         this.activeModal.close();
       },
index 299cefd7f207a7ff330a1697de3e901d5defaeba..fb6eef30e8a4482b60a0c8ecb21163b71726c271 100644 (file)
@@ -7,12 +7,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { ToastrModule } from 'ngx-toastr';
 
 import { ActivatedRouteStub } from '../../../../testing/activated-route-stub';
-import {
-  configureTestBed,
-  FormHelper,
-  i18nProviders,
-  IscsiHelper
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper, IscsiHelper } from '../../../../testing/unit-test-helper';
 import { LoadingPanelComponent } from '../../../shared/components/loading-panel/loading-panel.component';
 import { CdFormGroup } from '../../../shared/forms/cd-form-group';
 import { SharedModule } from '../../../shared/shared.module';
@@ -153,7 +148,6 @@ describe('IscsiTargetFormComponent', () => {
         ToastrModule.forRoot()
       ],
       providers: [
-        i18nProviders,
         {
           provide: ActivatedRoute,
           useValue: new ActivatedRouteStub({ target_iqn: undefined })
index c5bead7dc38869e4b47f2ca624a9c823afdde9d1..41d67ca87b249d652bc564a1798edf689c8ec973 100644 (file)
@@ -3,7 +3,6 @@ import { FormArray, FormControl, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin } from 'rxjs';
 
@@ -57,30 +56,14 @@ export class IscsiTargetFormComponent extends CdForm implements OnInit {
 
   imagesSettings: any = {};
   messages = {
-    portals: new SelectMessages(
-      { noOptions: this.i18n('There are no portals available.') },
-      this.i18n
-    ),
-    images: new SelectMessages(
-      { noOptions: this.i18n('There are no images available.') },
-      this.i18n
-    ),
-    initiatorImage: new SelectMessages(
-      {
-        noOptions: this.i18n(
-          'There are no images available. Please make sure you add an image to the target.'
-        )
-      },
-      this.i18n
-    ),
-    groupInitiator: new SelectMessages(
-      {
-        noOptions: this.i18n(
-          'There are no initiators available. Please make sure you add an initiator to the target.'
-        )
-      },
-      this.i18n
-    )
+    portals: new SelectMessages({ noOptions: $localize`There are no portals available.` }),
+    images: new SelectMessages({ noOptions: $localize`There are no images available.` }),
+    initiatorImage: new SelectMessages({
+      noOptions: $localize`There are no images available. Please make sure you add an image to the target.`
+    }),
+    groupInitiator: new SelectMessages({
+      noOptions: $localize`There are no initiators available. Please make sure you add an initiator to the target.`
+    })
   };
 
   IQN_REGEX = /^iqn\.(19|20)\d\d-(0[1-9]|1[0-2])\.\D{2,3}(\.[A-Za-z0-9-]+)+(:[A-Za-z0-9-\.]+)*$/;
@@ -95,12 +78,11 @@ export class IscsiTargetFormComponent extends CdForm implements OnInit {
     private rbdService: RbdService,
     private router: Router,
     private route: ActivatedRoute,
-    private i18n: I18n,
     private taskWrapper: TaskWrapperService,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
-    this.resource = this.i18n('target');
+    this.resource = $localize`target`;
   }
 
   ngOnInit() {
index 10ac2c762bddb3e3e035dc918f4484c65c95cb7d..60d8513964a15587749aada179a98b4cbbbf6f3a 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { IscsiSettingComponent } from '../iscsi-setting/iscsi-setting.component';
 import { IscsiTargetImageSettingsModalComponent } from './iscsi-target-image-settings-modal.component';
@@ -17,7 +17,7 @@ describe('IscsiTargetImageSettingsModalComponent', () => {
   configureTestBed({
     declarations: [IscsiTargetImageSettingsModalComponent, IscsiSettingComponent],
     imports: [SharedModule, ReactiveFormsModule, HttpClientTestingModule, RouterTestingModule],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index ac6d883499eff41fdc0f00745c9bf047f79d6f64..8e55b78cb4f47daf305a0d6f9791d6a2be2727f3 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { IscsiSettingComponent } from '../iscsi-setting/iscsi-setting.component';
 import { IscsiTargetIqnSettingsModalComponent } from './iscsi-target-iqn-settings-modal.component';
@@ -17,7 +17,7 @@ describe('IscsiTargetIqnSettingsModalComponent', () => {
   configureTestBed({
     declarations: [IscsiTargetIqnSettingsModalComponent, IscsiSettingComponent],
     imports: [SharedModule, ReactiveFormsModule, HttpClientTestingModule, RouterTestingModule],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index 997983872f6d3e9372ca72c362bd47fd3daf756e..2c8657f3577eac459a99c3958eb99b9ea00fb95f 100644 (file)
@@ -11,7 +11,6 @@ import { BehaviorSubject, of } from 'rxjs';
 import {
   configureTestBed,
   expectItemTasks,
-  i18nProviders,
   PermissionHelper
 } from '../../../../testing/unit-test-helper';
 import { IscsiService } from '../../../shared/api/iscsi.service';
@@ -46,7 +45,7 @@ describe('IscsiTargetListComponent', () => {
       NgbNavModule
     ],
     declarations: [IscsiTargetListComponent, IscsiTabsComponent, IscsiTargetDetailsComponent],
-    providers: [TaskListService, i18nProviders]
+    providers: [TaskListService]
   });
 
   beforeEach(() => {
index 236e1dc10bd9d035e91bfa9d0011c1e332fc9598..dd96295ca0e00023e9048ec10bdf1787daa539cf 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { Subscription } from 'rxjs';
 
@@ -61,7 +60,6 @@ export class IscsiTargetListComponent extends ListWithDetails implements OnInit,
 
   constructor(
     private authStorageService: AuthStorageService,
-    private i18n: I18n,
     private iscsiService: IscsiService,
     private taskListService: TaskListService,
     private cephReleaseNamePipe: CephReleaseNamePipe,
@@ -103,23 +101,23 @@ export class IscsiTargetListComponent extends ListWithDetails implements OnInit,
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Target'),
+        name: $localize`Target`,
         prop: 'target_iqn',
         flexGrow: 2,
         cellTransformation: CellTemplate.executing
       },
       {
-        name: this.i18n('Portals'),
+        name: $localize`Portals`,
         prop: 'cdPortals',
         flexGrow: 2
       },
       {
-        name: this.i18n('Images'),
+        name: $localize`Images`,
         prop: 'cdImages',
         flexGrow: 2
       },
       {
-        name: this.i18n('# Sessions'),
+        name: $localize`# Sessions`,
         prop: 'info.num_sessions',
         pipe: this.notAvailablePipe,
         flexGrow: 1
@@ -168,7 +166,7 @@ export class IscsiTargetListComponent extends ListWithDetails implements OnInit,
       return first.cdExecuting;
     }
     if (first && _.isUndefined(first['info'])) {
-      return this.i18n('Unavailable gateway(s)');
+      return $localize`Unavailable gateway(s)`;
     }
 
     return undefined;
@@ -180,10 +178,10 @@ export class IscsiTargetListComponent extends ListWithDetails implements OnInit,
       return first.cdExecuting;
     }
     if (first && _.isUndefined(first['info'])) {
-      return this.i18n('Unavailable gateway(s)');
+      return $localize`Unavailable gateway(s)`;
     }
     if (first && first['info'] && first['info']['num_sessions']) {
-      return this.i18n('Target has active sessions');
+      return $localize`Target has active sessions`;
     }
 
     return undefined;
@@ -222,7 +220,7 @@ export class IscsiTargetListComponent extends ListWithDetails implements OnInit,
     const target_iqn = this.selection.first().target_iqn;
 
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
-      itemDescription: this.i18n('iSCSI target'),
+      itemDescription: $localize`iSCSI target`,
       itemNames: [target_iqn],
       submitActionObservable: () =>
         this.taskWrapper.wrapTaskAroundCall({
index 7b091c0179218bad7d0571f4f1645e8c85c0785e..4ac569c77a7baa394c632728128dd6a60b81d8fa 100644 (file)
@@ -4,7 +4,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { IscsiService } from '../../../shared/api/iscsi.service';
 import { CephShortVersionPipe } from '../../../shared/pipes/ceph-short-version.pipe';
 import { DimlessPipe } from '../../../shared/pipes/dimless.pipe';
@@ -38,8 +38,7 @@ describe('IscsiComponent', () => {
       FormatterService,
       RelativeDatePipe,
       IscsiBackstorePipe,
-      { provide: IscsiService, useValue: fakeService },
-      i18nProviders
+      { provide: IscsiService, useValue: fakeService }
     ]
   });
 
index a8dc711a832f5851a7c8ef60e5e0d0579f3d392a..b3a6d0c692652bb432e8eeb99eb8750d362fa429 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { IscsiService } from '../../../shared/api/iscsi.service';
 import { CellTemplate } from '../../../shared/enum/cell-template.enum';
 import { DimlessPipe } from '../../../shared/pipes/dimless.pipe';
@@ -28,18 +26,17 @@ export class IscsiComponent implements OnInit {
   constructor(
     private iscsiService: IscsiService,
     private dimlessPipe: DimlessPipe,
-    private iscsiBackstorePipe: IscsiBackstorePipe,
-    private i18n: I18n
+    private iscsiBackstorePipe: IscsiBackstorePipe
   ) {}
 
   ngOnInit() {
     this.gatewaysColumns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'name'
       },
       {
-        name: this.i18n('State'),
+        name: $localize`State`,
         prop: 'state',
         flexGrow: 1,
         cellTransformation: CellTemplate.badge,
@@ -51,52 +48,52 @@ export class IscsiComponent implements OnInit {
         }
       },
       {
-        name: this.i18n('# Targets'),
+        name: $localize`# Targets`,
         prop: 'num_targets'
       },
       {
-        name: this.i18n('# Sessions'),
+        name: $localize`# Sessions`,
         prop: 'num_sessions'
       }
     ];
     this.imagesColumns = [
       {
-        name: this.i18n('Pool'),
+        name: $localize`Pool`,
         prop: 'pool'
       },
       {
-        name: this.i18n('Image'),
+        name: $localize`Image`,
         prop: 'image'
       },
       {
-        name: this.i18n('Backstore'),
+        name: $localize`Backstore`,
         prop: 'backstore',
         pipe: this.iscsiBackstorePipe
       },
       {
-        name: this.i18n('Read Bytes'),
+        name: $localize`Read Bytes`,
         prop: 'stats_history.rd_bytes',
         cellTemplate: this.iscsiSparklineTpl
       },
       {
-        name: this.i18n('Write Bytes'),
+        name: $localize`Write Bytes`,
         prop: 'stats_history.wr_bytes',
         cellTemplate: this.iscsiSparklineTpl
       },
       {
-        name: this.i18n('Read Ops'),
+        name: $localize`Read Ops`,
         prop: 'stats.rd',
         pipe: this.dimlessPipe,
         cellTemplate: this.iscsiPerSecondTpl
       },
       {
-        name: this.i18n('Write Ops'),
+        name: $localize`Write Ops`,
         prop: 'stats.wr',
         pipe: this.dimlessPipe,
         cellTemplate: this.iscsiPerSecondTpl
       },
       {
-        name: this.i18n('A/O Since'),
+        name: $localize`A/O Since`,
         prop: 'optimized_since',
         cellTemplate: this.iscsiRelativeDateTpl
       }
index 0200547c407a3bb3fac705070f2921e3b227745e..a03c6aae5e008d58e2acbc4843dd48efa259b0f1 100644 (file)
@@ -7,11 +7,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  FormHelper,
-  i18nProviders
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../../testing/unit-test-helper';
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
 import { NotificationService } from '../../../../shared/services/notification.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -33,7 +29,7 @@ describe('BootstrapCreateModalComponent', () => {
       SharedModule,
       ToastrModule.forRoot()
     ],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index 9acfabb0875185de7bffa9c90263265989fd8332..e0b829d60720859a7619c783193575fc8039c2ca 100644 (file)
@@ -7,11 +7,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  FormHelper,
-  i18nProviders
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../../testing/unit-test-helper';
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
 import { NotificationService } from '../../../../shared/services/notification.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -33,7 +29,7 @@ describe('BootstrapImportModalComponent', () => {
       SharedModule,
       ToastrModule.forRoot()
     ],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index b2a511bf2897f943292969ffd17979c34ba502cd..5dc7855e52a999dc439be5f512d151cc8f574496 100644 (file)
@@ -2,7 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
 import { MirrorHealthColorPipe } from '../mirror-health-color.pipe';
 import { DaemonListComponent } from './daemon-list.component';
@@ -13,8 +13,7 @@ describe('DaemonListComponent', () => {
 
   configureTestBed({
     declarations: [DaemonListComponent, MirrorHealthColorPipe],
-    imports: [BrowserAnimationsModule, SharedModule, HttpClientTestingModule],
-    providers: i18nProviders
+    imports: [BrowserAnimationsModule, SharedModule, HttpClientTestingModule]
   });
 
   beforeEach(() => {
index 7eaae7aa0243717f619289c9a745d77eb4b50f19..399e88750d2c294f50b05a36551972837d79153d 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Subscription } from 'rxjs';
 
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
@@ -22,24 +21,23 @@ export class DaemonListComponent implements OnInit, OnDestroy {
 
   constructor(
     private rbdMirroringService: RbdMirroringService,
-    private cephShortVersionPipe: CephShortVersionPipe,
-    private i18n: I18n
+    private cephShortVersionPipe: CephShortVersionPipe
   ) {}
 
   ngOnInit() {
     this.columns = [
-      { prop: 'instance_id', name: this.i18n('Instance'), flexGrow: 2 },
-      { prop: 'id', name: this.i18n('ID'), flexGrow: 2 },
-      { prop: 'server_hostname', name: this.i18n('Hostname'), flexGrow: 2 },
+      { prop: 'instance_id', name: $localize`Instance`, flexGrow: 2 },
+      { prop: 'id', name: $localize`ID`, flexGrow: 2 },
+      { prop: 'server_hostname', name: $localize`Hostname`, flexGrow: 2 },
       {
         prop: 'version',
-        name: this.i18n('Version'),
+        name: $localize`Version`,
         pipe: this.cephShortVersionPipe,
         flexGrow: 2
       },
       {
         prop: 'health',
-        name: this.i18n('Health'),
+        name: $localize`Health`,
         cellTemplate: this.healthTmpl,
         flexGrow: 1
       }
index fc66c8689512103a5c68ef4a97cb29dae99ed03b..4ac1bc3886cab3daa7d7d439e81ca46b05ac125f 100644 (file)
@@ -7,7 +7,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
 import { NotificationService } from '../../../../shared/services/notification.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -28,7 +28,7 @@ describe('EditSiteNameModalComponent', () => {
       SharedModule,
       ToastrModule.forRoot()
     ],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index 48483693be068e65fe5c432ff9af4b23897b28eb..75a6c0c14255be4dfa9ca7e65705129420da47bf 100644 (file)
@@ -4,7 +4,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 
 import { NgbNavModule, NgbProgressbarModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
 import { MirrorHealthColorPipe } from '../mirror-health-color.pipe';
 import { ImageListComponent } from './image-list.component';
@@ -21,8 +21,7 @@ describe('ImageListComponent', () => {
       NgbNavModule,
       NgbProgressbarModule,
       HttpClientTestingModule
-    ],
-    providers: i18nProviders
+    ]
   });
 
   beforeEach(() => {
index 3867da7db92a5deafaa055729a1002c5cfa58628..6b1db0c066132686225e01cb54a7a3325c1e0749 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Subscription } from 'rxjs';
 
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
@@ -33,45 +32,45 @@ export class ImageListComponent implements OnInit, OnDestroy {
     columns: {}
   };
 
-  constructor(private rbdMirroringService: RbdMirroringService, private i18n: I18n) {}
+  constructor(private rbdMirroringService: RbdMirroringService) {}
 
   ngOnInit() {
     this.image_error.columns = [
-      { prop: 'pool_name', name: this.i18n('Pool'), flexGrow: 2 },
-      { prop: 'name', name: this.i18n('Image'), flexGrow: 2 },
-      { prop: 'description', name: this.i18n('Issue'), flexGrow: 4 },
+      { prop: 'pool_name', name: $localize`Pool`, flexGrow: 2 },
+      { prop: 'name', name: $localize`Image`, flexGrow: 2 },
+      { prop: 'description', name: $localize`Issue`, flexGrow: 4 },
       {
         prop: 'state',
-        name: this.i18n('State'),
+        name: $localize`State`,
         cellTemplate: this.stateTmpl,
         flexGrow: 1
       }
     ];
 
     this.image_syncing.columns = [
-      { prop: 'pool_name', name: this.i18n('Pool'), flexGrow: 2 },
-      { prop: 'name', name: this.i18n('Image'), flexGrow: 2 },
+      { prop: 'pool_name', name: $localize`Pool`, flexGrow: 2 },
+      { prop: 'name', name: $localize`Image`, flexGrow: 2 },
       {
         prop: 'progress',
-        name: this.i18n('Progress'),
+        name: $localize`Progress`,
         cellTemplate: this.progressTmpl,
         flexGrow: 2
       },
       {
         prop: 'state',
-        name: this.i18n('State'),
+        name: $localize`State`,
         cellTemplate: this.syncTmpl,
         flexGrow: 1
       }
     ];
 
     this.image_ready.columns = [
-      { prop: 'pool_name', name: this.i18n('Pool'), flexGrow: 2 },
-      { prop: 'name', name: this.i18n('Image'), flexGrow: 2 },
-      { prop: 'description', name: this.i18n('Description'), flexGrow: 4 },
+      { prop: 'pool_name', name: $localize`Pool`, flexGrow: 2 },
+      { prop: 'name', name: $localize`Image`, flexGrow: 2 },
+      { prop: 'description', name: $localize`Description`, flexGrow: 4 },
       {
         prop: 'state',
-        name: this.i18n('State'),
+        name: $localize`State`,
         cellTemplate: this.stateTmpl,
         flexGrow: 1
       }
index 0ef017448cd485a5e0519400b0882f7bc127a773..486f3a89c78443476a9e5725a35e9b824d07c71b 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbNavModule, NgbProgressbarModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
 import { DaemonListComponent } from '../daemon-list/daemon-list.component';
 import { ImageListComponent } from '../image-list/image-list.component';
@@ -34,8 +34,7 @@ describe('OverviewComponent', () => {
       HttpClientTestingModule,
       RouterTestingModule,
       ToastrModule.forRoot()
-    ],
-    providers: i18nProviders
+    ]
   });
 
   beforeEach(() => {
index 5220912c14759cc2864f2ea6d021fa04984748d9..02f7fee878e540eb3c8214702a5f679e7cada894 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnDestroy, OnInit } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Subscription } from 'rxjs';
 
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
@@ -35,8 +34,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
   constructor(
     private authStorageService: AuthStorageService,
     private rbdMirroringService: RbdMirroringService,
-    private modalService: ModalService,
-    private i18n: I18n
+    private modalService: ModalService
   ) {
     this.permission = this.authStorageService.getPermissions().rbdMirroring;
 
@@ -44,7 +42,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
       permission: 'update',
       icon: Icons.edit,
       click: () => this.editSiteNameModal(),
-      name: this.i18n('Edit Site Name'),
+      name: $localize`Edit Site Name`,
       canBePrimary: () => true,
       disable: () => false
     };
@@ -52,14 +50,14 @@ export class OverviewComponent implements OnInit, OnDestroy {
       permission: 'update',
       icon: Icons.upload,
       click: () => this.createBootstrapModal(),
-      name: this.i18n('Create Bootstrap Token'),
+      name: $localize`Create Bootstrap Token`,
       disable: () => false
     };
     const importBootstrapAction: CdTableAction = {
       permission: 'update',
       icon: Icons.download,
       click: () => this.importBootstrapModal(),
-      name: this.i18n('Import Bootstrap Token'),
+      name: $localize`Import Bootstrap Token`,
       disable: () => this.peersExist
     };
     this.tableActions = [editSiteNameAction, createBootstrapAction, importBootstrapAction];
index acafbca8473d400269f548f392bd3c75afb6ecb3..b5c37ea5f7bf537ea3171c8c2f2d990645fe6773 100644 (file)
@@ -7,11 +7,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  FormHelper,
-  i18nProviders
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../../testing/unit-test-helper';
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
 import { NotificationService } from '../../../../shared/services/notification.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -33,7 +29,7 @@ describe('PoolEditModeModalComponent', () => {
       SharedModule,
       ToastrModule.forRoot()
     ],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index e706af9a7f5c57e7c9497203487300673163a404..696d12d72b448644f90bad85cadc240320f7f6e6 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
 import { AbstractControl, FormControl, Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Subscription } from 'rxjs';
 
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
@@ -31,14 +30,13 @@ export class PoolEditModeModalComponent implements OnInit, OnDestroy {
   peerExists = false;
 
   mirrorModes: Array<{ id: string; name: string }> = [
-    { id: 'disabled', name: this.i18n('Disabled') },
-    { id: 'pool', name: this.i18n('Pool') },
-    { id: 'image', name: this.i18n('Image') }
+    { id: 'disabled', name: $localize`Disabled` },
+    { id: 'pool', name: $localize`Pool` },
+    { id: 'image', name: $localize`Image` }
   ];
 
   constructor(
     public activeModal: NgbActiveModal,
-    private i18n: I18n,
     private rbdMirroringService: RbdMirroringService,
     private taskWrapper: TaskWrapperService
   ) {
index 578e07e481c2e35f6c5f0491e08d5d0964b7fcd7..6a4db9aa6a7e72c497e72be4283027ecca9e73f9 100644 (file)
@@ -7,11 +7,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  FormHelper,
-  i18nProviders
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../../testing/unit-test-helper';
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
 import { NotificationService } from '../../../../shared/services/notification.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -34,7 +30,7 @@ describe('PoolEditPeerModalComponent', () => {
       SharedModule,
       ToastrModule.forRoot()
     ],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index e40e1acd81c3099a3501b48cc80558c81f064da8..26a8f333e14adb50223ba80b9863b35eda0973a3 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
 import { MirrorHealthColorPipe } from '../mirror-health-color.pipe';
 import { PoolListComponent } from './pool-list.component';
@@ -22,8 +22,7 @@ describe('PoolListComponent', () => {
       HttpClientTestingModule,
       RouterTestingModule,
       ToastrModule.forRoot()
-    ],
-    providers: i18nProviders
+    ]
   });
 
   beforeEach(() => {
index 10136692c51d9c1a8fd74ad699f9197a2beef3f3..6c18acc08ce1082c6fdc0a86f531f898eb14f0ff 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Observable, Subscriber, Subscription } from 'rxjs';
 
 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
@@ -41,8 +40,7 @@ export class PoolListComponent implements OnInit, OnDestroy {
     private authStorageService: AuthStorageService,
     private rbdMirroringService: RbdMirroringService,
     private modalService: ModalService,
-    private taskWrapper: TaskWrapperService,
-    private i18n: I18n
+    private taskWrapper: TaskWrapperService
   ) {
     this.data = [];
     this.permission = this.authStorageService.getPermissions().rbdMirroring;
@@ -51,13 +49,13 @@ export class PoolListComponent implements OnInit, OnDestroy {
       permission: 'update',
       icon: Icons.edit,
       click: () => this.editModeModal(),
-      name: this.i18n('Edit Mode'),
+      name: $localize`Edit Mode`,
       canBePrimary: () => true
     };
     const addPeerAction: CdTableAction = {
       permission: 'create',
       icon: Icons.add,
-      name: this.i18n('Add Peer'),
+      name: $localize`Add Peer`,
       click: () => this.editPeersModal('add'),
       disable: () => !this.selection.first() || this.selection.first().mirror_mode === 'disabled',
       visible: () => !this.getPeerUUID(),
@@ -66,14 +64,14 @@ export class PoolListComponent implements OnInit, OnDestroy {
     const editPeerAction: CdTableAction = {
       permission: 'update',
       icon: Icons.exchange,
-      name: this.i18n('Edit Peer'),
+      name: $localize`Edit Peer`,
       click: () => this.editPeersModal('edit'),
       visible: () => !!this.getPeerUUID()
     };
     const deletePeerAction: CdTableAction = {
       permission: 'delete',
       icon: Icons.destroy,
-      name: this.i18n('Delete Peer'),
+      name: $localize`Delete Peer`,
       click: () => this.deletePeersModal(),
       visible: () => !!this.getPeerUUID()
     };
@@ -82,14 +80,14 @@ export class PoolListComponent implements OnInit, OnDestroy {
 
   ngOnInit() {
     this.columns = [
-      { prop: 'name', name: this.i18n('Name'), flexGrow: 2 },
-      { prop: 'mirror_mode', name: this.i18n('Mode'), flexGrow: 2 },
-      { prop: 'leader_id', name: this.i18n('Leader'), flexGrow: 2 },
-      { prop: 'image_local_count', name: this.i18n('# Local'), flexGrow: 2 },
-      { prop: 'image_remote_count', name: this.i18n('# Remote'), flexGrow: 2 },
+      { prop: 'name', name: $localize`Name`, flexGrow: 2 },
+      { prop: 'mirror_mode', name: $localize`Mode`, flexGrow: 2 },
+      { prop: 'leader_id', name: $localize`Leader`, flexGrow: 2 },
+      { prop: 'image_local_count', name: $localize`# Local`, flexGrow: 2 },
+      { prop: 'image_remote_count', name: $localize`# Remote`, flexGrow: 2 },
       {
         prop: 'health',
-        name: this.i18n('Health'),
+        name: $localize`Health`,
         cellTemplate: this.healthTmpl,
         flexGrow: 1
       }
@@ -131,7 +129,7 @@ export class PoolListComponent implements OnInit, OnDestroy {
     const peerUUID = this.getPeerUUID();
 
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
-      itemDescription: this.i18n('mirror peer'),
+      itemDescription: $localize`mirror peer`,
       itemNames: [`${poolName} (${peerUUID})`],
       submitActionObservable: () =>
         new Observable((observer: Subscriber<any>) => {
index 8288e9403a9aae54bb7dada52dab4b0405a89f45..0f0daa6b9df70801b6715ca2f0b2eee43db3a3dc 100644 (file)
@@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { ReactiveFormsModule } from '@angular/forms';
 import { By } from '@angular/platform-browser';
 
-import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../testing/unit-test-helper';
 import { DirectivesModule } from '../../../shared/directives/directives.module';
 import { CdFormGroup } from '../../../shared/forms/cd-form-group';
 import { RbdConfigurationSourceField } from '../../../shared/models/configuration';
@@ -22,12 +22,7 @@ describe('RbdConfigurationFormComponent', () => {
   configureTestBed({
     imports: [ReactiveFormsModule, DirectivesModule, SharedModule],
     declarations: [RbdConfigurationFormComponent],
-    providers: [
-      RbdConfigurationService,
-      FormatterService,
-      DimlessBinaryPerSecondPipe,
-      i18nProviders
-    ]
+    providers: [RbdConfigurationService, FormatterService, DimlessBinaryPerSecondPipe]
   });
 
   beforeEach(() => {
index 7bb8f2e7420285a903fc495208580319e0109992..4150269993f82c3733191cb4f1b4b749a4eb7ae0 100644 (file)
@@ -7,7 +7,7 @@ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
 import { NgxDatatableModule } from '@swimlane/ngx-datatable';
 import { ChartsModule } from 'ng2-charts';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { ComponentsModule } from '../../../shared/components/components.module';
 import { TableComponent } from '../../../shared/datatable/table/table.component';
 import { RbdConfigurationEntry } from '../../../shared/models/configuration';
@@ -32,7 +32,7 @@ describe('RbdConfigurationListComponent', () => {
       PipesModule
     ],
     declarations: [RbdConfigurationListComponent, TableComponent],
-    providers: [FormatterService, RbdConfigurationService, i18nProviders]
+    providers: [FormatterService, RbdConfigurationService]
   });
 
   beforeEach(() => {
index c63a76dccff0339a18f2e639bcece30fec63ca5e..1e21a193dc2f913740391656efa48fba16b53e3c 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { TableComponent } from '../../../shared/datatable/table/table.component';
 import { CdTableColumn } from '../../../shared/models/cd-table-column';
 import {
@@ -34,22 +32,21 @@ export class RbdConfigurationListComponent implements OnInit, OnChanges {
 
   constructor(
     public formatterService: FormatterService,
-    private rbdConfigurationService: RbdConfigurationService,
-    private i18n: I18n
+    private rbdConfigurationService: RbdConfigurationService
   ) {}
 
   ngOnInit() {
     this.poolConfigurationColumns = [
-      { prop: 'displayName', name: this.i18n('Name') },
-      { prop: 'description', name: this.i18n('Description') },
-      { prop: 'name', name: this.i18n('Key') },
+      { prop: 'displayName', name: $localize`Name` },
+      { prop: 'description', name: $localize`Description` },
+      { prop: 'name', name: $localize`Key` },
       {
         prop: 'source',
-        name: this.i18n('Source'),
+        name: $localize`Source`,
         cellTemplate: this.configurationSourceTpl,
         pipe: new RbdConfigurationSourcePipe()
       },
-      { prop: 'value', name: this.i18n('Value'), cellTemplate: this.configurationValueTpl }
+      { prop: 'value', name: $localize`Value`, cellTemplate: this.configurationValueTpl }
     ];
   }
 
index ce34f019a67e52729bbd491a07616fb64598c59e..8f86c19a5e0f7de02dc16a251a74dcd5f10e8574 100644 (file)
@@ -10,7 +10,7 @@ import { NEVER, of } from 'rxjs';
 import { delay } from 'rxjs/operators';
 
 import { ActivatedRouteStub } from '../../../../testing/activated-route-stub';
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { RbdService } from '../../../shared/api/rbd.service';
 import { ImageSpec } from '../../../shared/models/image-spec';
 import { SharedModule } from '../../../shared/shared.module';
@@ -41,7 +41,6 @@ describe('RbdFormComponent', () => {
         provide: ActivatedRoute,
         useValue: new ActivatedRouteStub({ pool: 'foo', name: 'bar', snap: undefined })
       },
-      i18nProviders,
       RbdService
     ]
   });
index 09ac2d9e937f8bfa057bfc4e99946a715b3942bc..f1ae327307198b480257430db220d31fa40ba1b8 100644 (file)
@@ -2,7 +2,6 @@ import { Component, EventEmitter, OnInit } from '@angular/core';
 import { FormControl, ValidatorFn, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin, Observable, ReplaySubject } from 'rxjs';
 import { first, switchMap } from 'rxjs/operators';
@@ -102,48 +101,47 @@ export class RbdFormComponent extends CdForm implements OnInit {
     private formatter: FormatterService,
     private taskWrapper: TaskWrapperService,
     private dimlessBinaryPipe: DimlessBinaryPipe,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n,
     public router: Router
   ) {
     super();
     this.poolPermission = this.authStorageService.getPermissions().pool;
-    this.resource = this.i18n('RBD');
+    this.resource = $localize`RBD`;
     this.features = {
       'deep-flatten': {
-        desc: this.i18n('Deep flatten'),
+        desc: $localize`Deep flatten`,
         requires: null,
         allowEnable: false,
         allowDisable: true
       },
       layering: {
-        desc: this.i18n('Layering'),
+        desc: $localize`Layering`,
         requires: null,
         allowEnable: false,
         allowDisable: false
       },
       'exclusive-lock': {
-        desc: this.i18n('Exclusive lock'),
+        desc: $localize`Exclusive lock`,
         requires: null,
         allowEnable: true,
         allowDisable: true
       },
       'object-map': {
-        desc: this.i18n('Object map (requires exclusive-lock)'),
+        desc: $localize`Object map (requires exclusive-lock)`,
         requires: 'exclusive-lock',
         allowEnable: true,
         allowDisable: true,
         initDisabled: true
       },
       journaling: {
-        desc: this.i18n('Journaling (requires exclusive-lock)'),
+        desc: $localize`Journaling (requires exclusive-lock)`,
         requires: 'exclusive-lock',
         allowEnable: true,
         allowDisable: true,
         initDisabled: true
       },
       'fast-diff': {
-        desc: this.i18n('Fast diff (interlocked with object-map)'),
+        desc: $localize`Fast diff (interlocked with object-map)`,
         requires: 'object-map',
         allowEnable: true,
         allowDisable: true,
index 7533bd7fa0fe079c127188b559c41b6b2ed56609..193a338feb773c2e76f4f8b040123c2ccf0cc5a0 100644 (file)
@@ -10,7 +10,6 @@ import { BehaviorSubject, of } from 'rxjs';
 import {
   configureTestBed,
   expectItemTasks,
-  i18nProviders,
   PermissionHelper
 } from '../../../../testing/unit-test-helper';
 import { RbdService } from '../../../shared/api/rbd.service';
@@ -54,7 +53,7 @@ describe('RbdListComponent', () => {
       RbdConfigurationListComponent,
       RbdTabsComponent
     ],
-    providers: [TaskListService, i18nProviders]
+    providers: [TaskListService]
   });
 
   beforeEach(() => {
index b1a72abbbee96b7b3988b45e1be3370d61cc4e68..18ac272143e6264031828e610232b69e2f3bb6c0 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { RbdService } from '../../../shared/api/rbd.service';
@@ -108,7 +107,6 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
     private modalService: ModalService,
     private taskWrapper: TaskWrapperService,
     private taskListService: TaskListService,
-    private i18n: I18n,
     private urlBuilder: URLBuilderService,
     public actionLabels: ActionLabelsI18n
   ) {
@@ -185,58 +183,58 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'name',
         flexGrow: 2,
         cellTransformation: CellTemplate.executing
       },
       {
-        name: this.i18n('Pool'),
+        name: $localize`Pool`,
         prop: 'pool_name',
         flexGrow: 2
       },
       {
-        name: this.i18n('Namespace'),
+        name: $localize`Namespace`,
         prop: 'namespace',
         flexGrow: 2
       },
       {
-        name: this.i18n('Size'),
+        name: $localize`Size`,
         prop: 'size',
         flexGrow: 1,
         cellClass: 'text-right',
         pipe: this.dimlessBinaryPipe
       },
       {
-        name: this.i18n('Objects'),
+        name: $localize`Objects`,
         prop: 'num_objs',
         flexGrow: 1,
         cellClass: 'text-right',
         pipe: this.dimlessPipe
       },
       {
-        name: this.i18n('Object size'),
+        name: $localize`Object size`,
         prop: 'obj_size',
         flexGrow: 1,
         cellClass: 'text-right',
         pipe: this.dimlessBinaryPipe
       },
       {
-        name: this.i18n('Provisioned'),
+        name: $localize`Provisioned`,
         prop: 'disk_usage',
         cellClass: 'text-center',
         flexGrow: 1,
         pipe: this.dimlessBinaryPipe
       },
       {
-        name: this.i18n('Total provisioned'),
+        name: $localize`Total provisioned`,
         prop: 'total_disk_usage',
         cellClass: 'text-center',
         flexGrow: 1,
         pipe: this.dimlessBinaryPipe
       },
       {
-        name: this.i18n('Parent'),
+        name: $localize`Parent`,
         prop: 'parent',
         flexGrow: 2,
         cellTemplate: this.parentTpl
@@ -434,9 +432,7 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
   getDeleteDisableDesc(): string {
     const first = this.selection.first();
     if (first && this.hasClonedSnapshots(first)) {
-      return this.i18n(
-        'This RBD has cloned snapshots. Please delete related RBDs before deleting this RBD.'
-      );
+      return $localize`This RBD has cloned snapshots. Please delete related RBDs before deleting this RBD.`;
     }
 
     return '';
index 33f486981f759d5ca970556d7994adbcb216c594..6ef29adc4b2b74326530cefc6f8bb032da71f28e 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { ComponentsModule } from '../../../shared/components/components.module';
 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
 import { RbdNamespaceFormModalComponent } from './rbd-namespace-form-modal.component';
@@ -24,7 +24,7 @@ describe('RbdNamespaceFormModalComponent', () => {
       RouterTestingModule
     ],
     declarations: [RbdNamespaceFormModalComponent],
-    providers: [NgbActiveModal, AuthStorageService, i18nProviders]
+    providers: [NgbActiveModal, AuthStorageService]
   });
 
   beforeEach(() => {
index 1183c541d7986ee1ff51ddce7199b062e6a8d4bc..99c73300b6a5d11bb76054ed41163e251fdc5737 100644 (file)
@@ -8,7 +8,6 @@ import {
 } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Subject } from 'rxjs';
 
 import { PoolService } from '../../../shared/api/pool.service';
@@ -43,8 +42,7 @@ export class RbdNamespaceFormModalComponent implements OnInit {
     private authStorageService: AuthStorageService,
     private notificationService: NotificationService,
     private poolService: PoolService,
-    private rbdService: RbdService,
-    private i18n: I18n
+    private rbdService: RbdService
   ) {
     this.poolPermission = this.authStorageService.getPermissions().pool;
     this.createForm();
@@ -132,10 +130,7 @@ export class RbdNamespaceFormModalComponent implements OnInit {
       .then(() => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Created namespace '{{pool}}/{{namespace}}'`, {
-            pool: pool,
-            namespace: namespace
-          })
+          $localize`Created namespace '${pool}/${namespace}'`
         );
         this.activeModal.close();
         this.onSubmit.next();
index 294a598e251f236973e6042a90918ff6f3b6d9c9..eed9c6c532a8c50a43a2aeb21fad42a6b56d425e 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { TaskListService } from '../../../shared/services/task-list.service';
 import { SharedModule } from '../../../shared/shared.module';
 import { RbdTabsComponent } from '../rbd-tabs/rbd-tabs.component';
@@ -26,7 +26,7 @@ describe('RbdNamespaceListComponent', () => {
       ToastrModule.forRoot(),
       NgbNavModule
     ],
-    providers: [TaskListService, i18nProviders]
+    providers: [TaskListService]
   });
 
   beforeEach(() => {
index 7857c09f17ec5416b1c07592df3ffc8196498486..8d449f3ce79fd299fcd89ef25e43e168f0755593 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnInit } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin, Observable } from 'rxjs';
 
@@ -41,7 +40,6 @@ export class RbdNamespaceListComponent implements OnInit {
     private poolService: PoolService,
     private modalService: ModalService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     this.permission = this.authStorageService.getPermissions().rbdImage;
@@ -65,17 +63,17 @@ export class RbdNamespaceListComponent implements OnInit {
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Namespace'),
+        name: $localize`Namespace`,
         prop: 'namespace',
         flexGrow: 1
       },
       {
-        name: this.i18n('Pool'),
+        name: $localize`Pool`,
         prop: 'pool',
         flexGrow: 1
       },
       {
-        name: this.i18n('Total images'),
+        name: $localize`Total images`,
         prop: 'num_images',
         flexGrow: 1
       }
@@ -137,10 +135,7 @@ export class RbdNamespaceListComponent implements OnInit {
           () => {
             this.notificationService.show(
               NotificationType.success,
-              this.i18n(`Deleted namespace '{{pool}}/{{namespace}}'`, {
-                pool: pool,
-                namespace: namespace
-              })
+              $localize`Deleted namespace '${pool}/${namespace}'`
             );
             this.modalRef.close();
             this.refresh();
@@ -156,7 +151,7 @@ export class RbdNamespaceListComponent implements OnInit {
     const first = this.selection.first();
     if (first) {
       if (first.num_images > 0) {
-        return this.i18n('Namespace contains images');
+        return $localize`Namespace contains images`;
       }
     }
 
index bec05b924ef5c862dfb2c5e0adb0145096e4f8c5..9db62c9bada72f74ca0474112d751f9959e4dbfd 100644 (file)
@@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { RbdTabsComponent } from '../rbd-tabs/rbd-tabs.component';
 import { RbdPerformanceComponent } from './rbd-performance.component';
@@ -15,8 +15,7 @@ describe('RbdPerformanceComponent', () => {
 
   configureTestBed({
     imports: [HttpClientTestingModule, RouterTestingModule, SharedModule, NgbNavModule],
-    declarations: [RbdPerformanceComponent, RbdTabsComponent],
-    providers: i18nProviders
+    declarations: [RbdPerformanceComponent, RbdTabsComponent]
   });
 
   beforeEach(() => {
index 3e60a3ba787bca4fc489b604fe721d431ec0e4c4..15ca77f21c2a7cdb9b4b6f5ccbdc24a69cd3bdb6 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { ComponentsModule } from '../../../shared/components/components.module';
 import { PipesModule } from '../../../shared/pipes/pipes.module';
 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
@@ -26,7 +26,7 @@ describe('RbdSnapshotFormModalComponent', () => {
       RouterTestingModule
     ],
     declarations: [RbdSnapshotFormModalComponent],
-    providers: [NgbActiveModal, AuthStorageService, i18nProviders]
+    providers: [NgbActiveModal, AuthStorageService]
   });
 
   beforeEach(() => {
index f49b72dde5d4ccc39de53eae7b454b6feecfc044..b908a7ca35fab135da3e689094fb252439256992 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Subject } from 'rxjs';
 
 import { RbdService } from '../../../shared/api/rbd.service';
@@ -37,11 +36,10 @@ export class RbdSnapshotFormModalComponent implements OnInit {
     private rbdService: RbdService,
     private taskManagerService: TaskManagerService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     private actionLabels: ActionLabelsI18n
   ) {
     this.action = this.actionLabels.CREATE;
-    this.resource = this.i18n('RBD Snapshot');
+    this.resource = $localize`RBD Snapshot`;
     this.createForm();
   }
 
index 871939ec050f10b6505cf9864ef96eca1f8a1be7..040f5824de34e34bd803cb6c382f0cbc481684b2 100644 (file)
@@ -1,4 +1,3 @@
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
@@ -7,8 +6,6 @@ import { CdTableAction } from '../../../shared/models/cd-table-action';
 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
 
 export class RbdSnapshotActionsModel {
-  i18n: I18n;
-
   create: CdTableAction;
   rename: CdTableAction;
   protect: CdTableAction;
@@ -19,9 +16,7 @@ export class RbdSnapshotActionsModel {
   deleteSnap: CdTableAction;
   ordering: CdTableAction[];
 
-  constructor(i18n: I18n, actionLabels: ActionLabelsI18n, featuresName: string[]) {
-    this.i18n = i18n;
-
+  constructor(actionLabels: ActionLabelsI18n, featuresName: string[]) {
     this.create = {
       permission: 'create',
       icon: Icons.add,
@@ -94,7 +89,7 @@ export class RbdSnapshotActionsModel {
 
   getCloneDisableDesc(featuresName: string[]): string | undefined {
     if (!featuresName?.includes('layering')) {
-      return this.i18n('Parent image must support Layering');
+      return $localize`Parent image must support Layering`;
     }
 
     return undefined;
index fc08cba070439f1e447f3fbf0e65c776dbe78ff1..1ea292e0b4ffadcd4409c2aa6cefeced2f85e0d4 100644 (file)
@@ -4,7 +4,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbModalModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { MockComponent } from 'ng-mocks';
 import { ToastrModule } from 'ngx-toastr';
@@ -13,7 +12,6 @@ import { Subject, throwError as observableThrowError } from 'rxjs';
 import {
   configureTestBed,
   expectItemTasks,
-  i18nProviders,
   PermissionHelper
 } from '../../../../testing/unit-test-helper';
 import { RbdService } from '../../../shared/api/rbd.service';
@@ -71,8 +69,7 @@ describe('RbdSnapshotListComponent', () => {
       ],
       providers: [
         { provide: AuthStorageService, useValue: fakeAuthStorageService },
-        TaskListService,
-        i18nProviders
+        TaskListService
       ]
     },
     [CriticalConfirmationModalComponent]
@@ -98,7 +95,6 @@ describe('RbdSnapshotListComponent', () => {
 
     beforeEach(() => {
       fixture.detectChanges();
-      const i18n = TestBed.inject(I18n);
       const modalService = TestBed.inject(ModalService);
       const actionLabelsI18n = TestBed.inject(ActionLabelsI18n);
       called = false;
@@ -116,7 +112,6 @@ describe('RbdSnapshotListComponent', () => {
         notificationService,
         null,
         null,
-        i18n,
         actionLabelsI18n
       );
       spyOn(rbdService, 'deleteSnapshot').and.returnValue(observableThrowError({ status: 500 }));
@@ -210,7 +205,6 @@ describe('RbdSnapshotListComponent', () => {
           null,
           null,
           null,
-          TestBed.inject(I18n),
           TestBed.inject(ActionLabelsI18n)
         );
         ref.componentInstance.onSubmit = new Subject();
index 8c3a1fc433721bd37cbc591ec74edb6a4437a5c1..1559a9854f9e1f2f8724b27100b6f2febefca972 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as moment from 'moment';
 import { of } from 'rxjs';
 
@@ -80,7 +79,6 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
     private notificationService: NotificationService,
     private summaryService: SummaryService,
     private taskListService: TaskListService,
-    private i18n: I18n,
     private actionLabels: ActionLabelsI18n
   ) {
     this.permission = this.authStorageService.getPermissions().rbdImage;
@@ -89,39 +87,39 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'name',
         cellTransformation: CellTemplate.executing,
         flexGrow: 2
       },
       {
-        name: this.i18n('Size'),
+        name: $localize`Size`,
         prop: 'size',
         flexGrow: 1,
         cellClass: 'text-right',
         pipe: this.dimlessBinaryPipe
       },
       {
-        name: this.i18n('Provisioned'),
+        name: $localize`Provisioned`,
         prop: 'disk_usage',
         flexGrow: 1,
         cellClass: 'text-right',
         pipe: this.dimlessBinaryPipe
       },
       {
-        name: this.i18n('State'),
+        name: $localize`State`,
         prop: 'is_protected',
         flexGrow: 1,
         cellTransformation: CellTemplate.badge,
         customTemplateConfig: {
           map: {
-            true: { value: this.i18n('PROTECTED'), class: 'badge-success' },
-            false: { value: this.i18n('UNPROTECTED'), class: 'badge-info' }
+            true: { value: $localize`PROTECTED`, class: 'badge-success' },
+            false: { value: $localize`UNPROTECTED`, class: 'badge-info' }
           }
         }
       },
       {
-        name: this.i18n('Created'),
+        name: $localize`Created`,
         prop: 'timestamp',
         flexGrow: 1,
         pipe: this.cdDatePipe
@@ -132,7 +130,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
   ngOnChanges() {
     const imageSpec = new ImageSpec(this.poolName, this.namespace, this.rbdName);
 
-    const actions = new RbdSnapshotActionsModel(this.i18n, this.actionLabels, this.featuresName);
+    const actions = new RbdSnapshotActionsModel(this.actionLabels, this.featuresName);
     actions.create.click = () => this.openCreateSnapshotModal();
     actions.rename.click = () => this.openEditSnapshotModal();
     actions.protect.click = () => this.toggleProtection();
@@ -266,8 +264,8 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
     const snapshotName = this.selection.selected[0].name;
     const imageSpec = new ImageSpec(this.poolName, this.namespace, this.rbdName).toString();
     const initialState = {
-      titleText: this.i18n('RBD snapshot rollback'),
-      buttonText: this.i18n('Rollback'),
+      titleText: $localize`RBD snapshot rollback`,
+      buttonText: $localize`Rollback`,
       bodyTpl: this.rollbackTpl,
       bodyData: {
         snapName: `${imageSpec}@${snapshotName}`
@@ -283,7 +281,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
   deleteSnapshotModal() {
     const snapshotName = this.selection.selected[0].name;
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
-      itemDescription: this.i18n('RBD snapshot'),
+      itemDescription: $localize`RBD snapshot`,
       itemNames: [snapshotName],
       submitAction: () => this._asyncTask('deleteSnapshot', 'rbd/snap/delete', snapshotName)
     });
index a448a9cd6e8452c3a31a6f27fee859fe44906f10..d975a1c4128940d6a264ffd2a9430e111f2b957f 100644 (file)
@@ -9,11 +9,7 @@ import * as moment from 'moment';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  expectItemTasks,
-  i18nProviders
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, expectItemTasks } from '../../../../testing/unit-test-helper';
 import { RbdService } from '../../../shared/api/rbd.service';
 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
 import { ExecutingTask } from '../../../shared/models/executing-task';
@@ -40,7 +36,7 @@ describe('RbdTrashListComponent', () => {
       NgbNavModule,
       ToastrModule.forRoot()
     ],
-    providers: [TaskListService, i18nProviders]
+    providers: [TaskListService]
   });
 
   beforeEach(() => {
index 9b6b3b44b89ce723d16731d2587abce0d9513e5b..63b4d085bb384ac61b59f311ad610b09b0979a5c 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import * as moment from 'moment';
 
@@ -62,7 +61,6 @@ export class RbdTrashListComponent implements OnInit {
     private cdDatePipe: CdDatePipe,
     private taskListService: TaskListService,
     private taskWrapper: TaskWrapperService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     this.permission = this.authStorageService.getPermissions().rbdImage;
@@ -84,34 +82,34 @@ export class RbdTrashListComponent implements OnInit {
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('ID'),
+        name: $localize`ID`,
         prop: 'id',
         flexGrow: 1,
         cellTransformation: CellTemplate.executing
       },
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'name',
         flexGrow: 1
       },
       {
-        name: this.i18n('Pool'),
+        name: $localize`Pool`,
         prop: 'pool_name',
         flexGrow: 1
       },
       {
-        name: this.i18n('Namespace'),
+        name: $localize`Namespace`,
         prop: 'namespace',
         flexGrow: 1
       },
       {
-        name: this.i18n('Status'),
+        name: $localize`Status`,
         prop: 'deferment_end_time',
         flexGrow: 1,
         cellTemplate: this.expiresTpl
       },
       {
-        name: this.i18n('Deleted At'),
+        name: $localize`Deleted At`,
         prop: 'deletion_time',
         flexGrow: 1,
         pipe: this.cdDatePipe
index cb0dd58c40a9eaa090a510b24d5742a11a3290f9..22fc800585ceee53bbf7c0c57c86a13c02f69eb9 100644 (file)
@@ -7,7 +7,7 @@ import { NgbActiveModal, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
 import * as moment from 'moment';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { NotificationService } from '../../../shared/services/notification.service';
 import { SharedModule } from '../../../shared/shared.module';
 import { RbdTrashMoveModalComponent } from './rbd-trash-move-modal.component';
@@ -27,7 +27,7 @@ describe('RbdTrashMoveModalComponent', () => {
       NgbPopoverModule
     ],
     declarations: [RbdTrashMoveModalComponent],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index fbecde705cc4392836a485f1c7153c8e435bcd8c..852c785edae0a98052dd42c85a221621ffa993de 100644 (file)
@@ -10,7 +10,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { Permission } from '../../../shared/models/permissions';
 import { NotificationService } from '../../../shared/services/notification.service';
 import { SharedModule } from '../../../shared/shared.module';
@@ -30,7 +30,7 @@ describe('RbdTrashPurgeModalComponent', () => {
       RouterTestingModule
     ],
     declarations: [RbdTrashPurgeModalComponent],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index 7878e7e8139b5d186b1b807af694e28e1292708d..1577afbb996b71b9dee676ee31edd2bde2f3d75a 100644 (file)
@@ -10,7 +10,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { NotificationService } from '../../../shared/services/notification.service';
 import { SharedModule } from '../../../shared/shared.module';
 import { RbdTrashRestoreModalComponent } from './rbd-trash-restore-modal.component';
@@ -28,7 +28,7 @@ describe('RbdTrashRestoreModalComponent', () => {
       SharedModule,
       RouterTestingModule
     ],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index bdc0dcf250d8baab0aa59942de5a282a96eac3ea..ea6ca381e9d464eb3bcdeb0b06ddac6deddde6ea 100644 (file)
@@ -4,11 +4,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../testing/unit-test-helper';
 import { TableActionsComponent } from '../../../shared/datatable/table-actions/table-actions.component';
 import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum';
 import { SharedModule } from '../../../shared/shared.module';
@@ -25,8 +21,7 @@ describe('CephfsClientsComponent', () => {
       SharedModule,
       HttpClientTestingModule
     ],
-    declarations: [CephfsClientsComponent],
-    providers: i18nProviders
+    declarations: [CephfsClientsComponent]
   });
 
   beforeEach(() => {
index 305dcbca4e94a0f6fb1cc9d6c73665966bb15a87..5d128fb7dd0103b9a158edc8c72aa358027b2c38 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 
 import { CephfsService } from '../../../shared/api/cephfs.service';
 import { CriticalConfirmationModalComponent } from '../../../shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
@@ -48,7 +47,6 @@ export class CephfsClientsComponent implements OnInit {
     private modalService: ModalService,
     private notificationService: NotificationService,
     private authStorageService: AuthStorageService,
-    private i18n: I18n,
     private actionLabels: ActionLabelsI18n
   ) {
     this.permission = this.authStorageService.getPermissions().cephfs;
@@ -63,12 +61,12 @@ export class CephfsClientsComponent implements OnInit {
 
   ngOnInit() {
     this.columns = [
-      { prop: 'id', name: this.i18n('id') },
-      { prop: 'type', name: this.i18n('type') },
-      { prop: 'state', name: this.i18n('state') },
-      { prop: 'version', name: this.i18n('version') },
-      { prop: 'hostname', name: this.i18n('Host') },
-      { prop: 'root', name: this.i18n('root') }
+      { prop: 'id', name: $localize`id` },
+      { prop: 'type', name: $localize`type` },
+      { prop: 'state', name: $localize`state` },
+      { prop: 'version', name: $localize`version` },
+      { prop: 'hostname', name: $localize`Host` },
+      { prop: 'root', name: $localize`root` }
     ];
   }
 
@@ -83,7 +81,7 @@ export class CephfsClientsComponent implements OnInit {
         this.modalRef.close();
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Evicted client '{{clientId}}'`, { clientId: clientId })
+          $localize`Evicted client '${clientId}'`
         );
       },
       () => {
index 1d80097c92bbffa39bf46c4220625caf11499497..130439e52a2e8919407afc5b8db8e7a35bd8f815 100644 (file)
@@ -1,7 +1,7 @@
 import { Component, Input } from '@angular/core';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { CephfsDetailComponent } from './cephfs-detail.component';
 
@@ -34,8 +34,7 @@ describe('CephfsDetailComponent', () => {
 
   configureTestBed({
     imports: [SharedModule],
-    declarations: [CephfsDetailComponent, CephfsChartStubComponent],
-    providers: i18nProviders
+    declarations: [CephfsDetailComponent, CephfsChartStubComponent]
   });
 
   beforeEach(() => {
index d45fb70bf9c0fa966749bfaa4e911288741d64aa..655aefa18b1fcf451f0d0714cfafb018d2853a2c 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { CdTableColumn } from '../../../shared/models/cd-table-column';
@@ -35,11 +34,7 @@ export class CephfsDetailComponent implements OnChanges, OnInit {
 
   objectValues = Object.values;
 
-  constructor(
-    private dimlessBinary: DimlessBinaryPipe,
-    private dimless: DimlessPipe,
-    private i18n: I18n
-  ) {}
+  constructor(private dimlessBinary: DimlessBinaryPipe, private dimless: DimlessPipe) {}
 
   ngOnChanges() {
     this.setStandbys();
@@ -48,7 +43,7 @@ export class CephfsDetailComponent implements OnChanges, OnInit {
   private setStandbys() {
     this.standbys = [
       {
-        key: this.i18n('Standby daemons'),
+        key: $localize`Standby daemons`,
         value: this.data.standbys
       }
     ];
@@ -57,19 +52,19 @@ export class CephfsDetailComponent implements OnChanges, OnInit {
   ngOnInit() {
     this.columns = {
       ranks: [
-        { prop: 'rank', name: this.i18n('Rank') },
-        { prop: 'state', name: this.i18n('State') },
-        { prop: 'mds', name: this.i18n('Daemon') },
-        { prop: 'activity', name: this.i18n('Activity'), cellTemplate: this.activityTmpl },
-        { prop: 'dns', name: this.i18n('Dentries'), pipe: this.dimless },
-        { prop: 'inos', name: this.i18n('Inodes'), pipe: this.dimless }
+        { prop: 'rank', name: $localize`Rank` },
+        { prop: 'state', name: $localize`State` },
+        { prop: 'mds', name: $localize`Daemon` },
+        { prop: 'activity', name: $localize`Activity`, cellTemplate: this.activityTmpl },
+        { prop: 'dns', name: $localize`Dentries`, pipe: this.dimless },
+        { prop: 'inos', name: $localize`Inodes`, pipe: this.dimless }
       ],
       pools: [
-        { prop: 'pool', name: this.i18n('Pool') },
-        { prop: 'type', name: this.i18n('Type') },
-        { prop: 'size', name: this.i18n('Size'), pipe: this.dimlessBinary },
+        { prop: 'pool', name: $localize`Pool` },
+        { prop: 'type', name: $localize`Type` },
+        { prop: 'size', name: $localize`Size`, pipe: this.dimlessBinary },
         {
-          name: this.i18n('Usage'),
+          name: $localize`Usage`,
           cellTemplate: this.poolUsageTpl,
           comparator: (_valueA: any, _valueB: any, rowA: any, rowB: any) => {
             const valA = rowA.used / rowA.avail;
index 4382f630ad77a6a10675ad891f35bed03079659f..124fad18c2bb41e4d3007d2f509c8b99179b65ac 100644 (file)
@@ -12,7 +12,6 @@ import { Observable, of } from 'rxjs';
 
 import {
   configureTestBed,
-  i18nProviders,
   modalServiceShow,
   PermissionHelper
 } from '../../../../testing/unit-test-helper';
@@ -375,7 +374,7 @@ describe('CephfsDirectoriesComponent', () => {
         NgbModalModule
       ],
       declarations: [CephfsDirectoriesComponent],
-      providers: [i18nProviders, NgbActiveModal]
+      providers: [NgbActiveModal]
     },
     [CriticalConfirmationModalComponent, FormModalComponent, ConfirmationModalComponent]
   );
index df6ae3a250f6bbea0047cb20d18e58f75e1c02a3..13c9c87e164f44388e665798e5632a527b1008e1 100644 (file)
@@ -2,7 +2,6 @@ import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@an
 import { Validators } from '@angular/forms';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import {
   ITreeOptions,
   TreeComponent,
@@ -110,7 +109,6 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
     private modalService: ModalService,
     private cephfsService: CephfsService,
     private cdDatePipe: CdDatePipe,
-    private i18n: I18n,
     private actionLabels: ActionLabelsI18n,
     private notificationService: NotificationService,
     private dimlessBinaryPipe: DimlessBinaryPipe
@@ -141,18 +139,18 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
       columns: [
         {
           prop: 'row.name',
-          name: this.i18n('Name'),
+          name: $localize`Name`,
           flexGrow: 1
         },
         {
           prop: 'row.value',
-          name: this.i18n('Value'),
+          name: $localize`Value`,
           sortable: false,
           flexGrow: 1
         },
         {
           prop: 'row.originPath',
-          name: this.i18n('Origin'),
+          name: $localize`Origin`,
           sortable: false,
           cellTemplate: this.originTmpl,
           flexGrow: 1
@@ -195,18 +193,18 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
       columns: [
         {
           prop: 'name',
-          name: this.i18n('Name'),
+          name: $localize`Name`,
           flexGrow: 1
         },
         {
           prop: 'path',
-          name: this.i18n('Path'),
+          name: $localize`Path`,
           isHidden: true,
           flexGrow: 2
         },
         {
           prop: 'created',
-          name: this.i18n('Created'),
+          name: $localize`Created`,
           flexGrow: 1,
           pipe: this.cdDatePipe
         }
@@ -352,7 +350,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
     }
     return {
       row: {
-        name: quotaKey === 'max_bytes' ? this.i18n('Max size') : this.i18n('Max files'),
+        name: quotaKey === 'max_bytes' ? $localize`Max size` : $localize`Max files`,
         value: valueConvertFn(value),
         originPath: value ? dir.path : ''
       },
@@ -422,26 +420,23 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
         path
       ),
       message: nextMax.value
-        ? this.i18n('The inherited {{quotaValue}} is the maximum value to be used.', {
-            quotaValue: this.getQuotaValueFromPathMsg(nextMax.value, nextMax.path)
-          })
+        ? $localize`The inherited ${this.getQuotaValueFromPathMsg(
+            nextMax.value,
+            nextMax.path
+          )} is the maximum value to be used.`
         : undefined,
       fields: [this.getQuotaFormField(selection.row.name, key, value, nextMax.value)],
-      submitButtonText: this.i18n('Save'),
+      submitButtonText: $localize`Save`,
       onSubmit: (values: CephfsQuotas) => this.updateQuota(values)
     });
   }
 
   private getModalQuotaTitle(action: string, path: string): string {
-    return this.i18n(`{{action}} CephFS {{quotaName}} quota for '{{path}}'`, {
-      action,
-      quotaName: this.getQuotaName(),
-      path
-    });
+    return $localize`${action} CephFS ${this.getQuotaName()} quota for '${path}'`;
   }
 
   private getQuotaName(): string {
-    return this.isBytesQuotaSelected() ? this.i18n('size') : this.i18n('files');
+    return this.isBytesQuotaSelected() ? $localize`size` : $localize`files`;
   }
 
   private isBytesQuotaSelected(): boolean {
@@ -449,11 +444,9 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
   }
 
   private getQuotaValueFromPathMsg(value: number, path: string): string {
-    return this.i18n(`{{quotaName}} quota {{value}} from '{{path}}'`, {
-      value: this.isBytesQuotaSelected() ? this.dimlessBinaryPipe.transform(value) : value,
-      quotaName: this.getQuotaName(),
-      path
-    });
+    value = this.isBytesQuotaSelected() ? this.dimlessBinaryPipe.transform(value) : value;
+
+    return $localize`${this.getQuotaName()} quota ${value} from '${path}'`;
   }
 
   private getQuotaFormField(
@@ -477,8 +470,8 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
     };
     if (!isBinary) {
       field.errors = {
-        min: this.i18n(`Value has to be at least {{value}} or more`, { value: 0 }),
-        max: this.i18n(`Value has to be at most {{value}} or less`, { value: maxValue })
+        min: $localize`Value has to be at least 0 or more`,
+        max: $localize`Value has to be at most ${maxValue} or less`
       };
     }
     return field;
@@ -492,7 +485,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
         ? this.actionLabels.SET
         : values[key] === 0
         ? this.actionLabels.UNSET
-        : this.i18n('Updated');
+        : $localize`Updated`;
     this.cephfsService.updateQuota(this.id, path, values).subscribe(() => {
       if (onSuccess) {
         onSuccess();
@@ -512,23 +505,21 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
     const nextMax = selection.nextTreeMaximum;
     const dirValue = selection.dirValue;
 
+    const quotaValue = this.getQuotaValueFromPathMsg(nextMax.value, nextMax.path);
+    const conclusion =
+      nextMax.value > 0
+        ? nextMax.value > dirValue
+          ? $localize`in order to inherit ${quotaValue}`
+          : $localize`which isn't used because of the inheritance of ${quotaValue}`
+        : $localize`in order to have no quota on the directory`;
+
     this.modalRef = this.modalService.show(ConfirmationModalComponent, {
       titleText: this.getModalQuotaTitle(this.actionLabels.UNSET, path),
       buttonText: this.actionLabels.UNSET,
-      description: this.i18n(`{{action}} {{quotaValue}} {{conclusion}}.`, {
-        action: this.actionLabels.UNSET,
-        quotaValue: this.getQuotaValueFromPathMsg(dirValue, path),
-        conclusion:
-          nextMax.value > 0
-            ? nextMax.value > dirValue
-              ? this.i18n('in order to inherit {{quotaValue}}', {
-                  quotaValue: this.getQuotaValueFromPathMsg(nextMax.value, nextMax.path)
-                })
-              : this.i18n(`which isn't used because of the inheritance of {{quotaValue}}`, {
-                  quotaValue: this.getQuotaValueFromPathMsg(nextMax.value, nextMax.path)
-                })
-            : this.i18n('in order to have no quota on the directory')
-      }),
+      description: $localize`${this.actionLabels.UNSET} ${this.getQuotaValueFromPathMsg(
+        dirValue,
+        path
+      )} ${conclusion}.`,
       onSubmit: () => this.updateQuota({ [key]: 0 }, () => this.modalRef.close())
     });
   }
@@ -537,8 +528,8 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
     // Create a snapshot. Auto-generate a snapshot name by default.
     const path = this.selectedDir.path;
     this.modalService.show(FormModalComponent, {
-      titleText: this.i18n('Create Snapshot'),
-      message: this.i18n('Please enter the name of the snapshot.'),
+      titleText: $localize`Create Snapshot`,
+      message: $localize`Please enter the name of the snapshot.`,
       fields: [
         {
           type: 'text',
@@ -547,15 +538,12 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
           required: true
         }
       ],
-      submitButtonText: this.i18n('Create Snapshot'),
+      submitButtonText: $localize`Create Snapshot`,
       onSubmit: (values: CephfsSnapshot) => {
         this.cephfsService.mkSnapshot(this.id, path, values.name).subscribe((name) => {
           this.notificationService.show(
             NotificationType.success,
-            this.i18n(`Created snapshot '{{name}}' for '{{path}}'`, {
-              name: name,
-              path: path
-            })
+            $localize`Created snapshot '${name}' for '${path}'`
           );
           this.forceDirRefresh();
         });
@@ -668,7 +656,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
 
   deleteSnapshotModal() {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
-      itemDescription: this.i18n('CephFs Snapshot'),
+      itemDescription: $localize`CephFs Snapshot`,
       itemNames: this.snapshot.selection.selected.map((snapshot: CephfsSnapshot) => snapshot.name),
       submitAction: () => this.deleteSnapshot()
     });
@@ -681,10 +669,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
       this.cephfsService.rmSnapshot(this.id, path, name).subscribe(() => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Deleted snapshot '{{name}}' for '{{path}}'`, {
-            name: name,
-            path: path
-          })
+          $localize`Deleted snapshot '${name}' for '${path}'`
         );
       });
     });
index f0d0803295d57aa964b08a3499e1cc15adaae169..a8f87b6ba2922bbe317388a17611d90b64f5ec52 100644 (file)
@@ -3,7 +3,7 @@ import { Component, Input } from '@angular/core';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
 import { SharedModule } from '../../../shared/shared.module';
 import { CephfsListComponent } from './cephfs-list.component';
@@ -20,8 +20,7 @@ describe('CephfsListComponent', () => {
 
   configureTestBed({
     imports: [BrowserAnimationsModule, SharedModule, HttpClientTestingModule],
-    declarations: [CephfsListComponent, CephfsTabsStubComponent],
-    providers: i18nProviders
+    declarations: [CephfsListComponent, CephfsTabsStubComponent]
   });
 
   beforeEach(() => {
index 9b4ece957fda175f2ac424813df6d6ee4862ff56..4b19803d8703b8d02ff04994fdc3ae7a06ac2624 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, OnInit } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { CephfsService } from '../../../shared/api/cephfs.service';
 import { ListWithDetails } from '../../../shared/classes/list-with-details.class';
 import { CellTemplate } from '../../../shared/enum/cell-template.enum';
@@ -20,29 +18,25 @@ export class CephfsListComponent extends ListWithDetails implements OnInit {
   filesystems: any = [];
   selection = new CdTableSelection();
 
-  constructor(
-    private cephfsService: CephfsService,
-    private cdDatePipe: CdDatePipe,
-    private i18n: I18n
-  ) {
+  constructor(private cephfsService: CephfsService, private cdDatePipe: CdDatePipe) {
     super();
   }
 
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'mdsmap.fs_name',
         flexGrow: 2
       },
       {
-        name: this.i18n('Created'),
+        name: $localize`Created`,
         prop: 'mdsmap.created',
         flexGrow: 2,
         pipe: this.cdDatePipe
       },
       {
-        name: this.i18n('Enabled'),
+        name: $localize`Enabled`,
         prop: 'mdsmap.enabled',
         flexGrow: 1,
         cellTransformation: CellTemplate.checkIcon
index d165e589261e99e381bb002594d76b5d7cc9aa0c..714f4e467bfe5e0ec33e4b68cc80e5fbd807409d 100644 (file)
@@ -8,7 +8,7 @@ import * as _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { CephfsService } from '../../../shared/api/cephfs.service';
 import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum';
 import { SharedModule } from '../../../shared/shared.module';
@@ -91,8 +91,7 @@ describe('CephfsTabsComponent', () => {
       CephfsDetailComponent,
       CephfsDirectoriesComponent,
       CephfsClientsComponent
-    ],
-    providers: [i18nProviders]
+    ]
   });
 
   beforeEach(() => {
index 40b05d829a4e2ae632c3015c6404a833e24f2b67..5e079e81440cc551c58dfb0c7a059f651ddcb42e 100755 (executable)
@@ -1,6 +1,6 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { DataTableModule } from '../../../../shared/datatable/datatable.module';
 import { SharedModule } from '../../../../shared/shared.module';
 import { ConfigurationDetailsComponent } from './configuration-details.component';
@@ -11,8 +11,7 @@ describe('ConfigurationDetailsComponent', () => {
 
   configureTestBed({
     declarations: [ConfigurationDetailsComponent],
-    imports: [DataTableModule, SharedModule],
-    providers: [i18nProviders]
+    imports: [DataTableModule, SharedModule]
   });
 
   beforeEach(() => {
index d80544bd02c7faf90308b3be04dd086830e3e157..df0e6d162610241d7b1be559bf701c531ce77525 100755 (executable)
@@ -1,6 +1,5 @@
 import { Component, Input, OnChanges } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 @Component({
@@ -12,18 +11,16 @@ export class ConfigurationDetailsComponent implements OnChanges {
   @Input()
   selection: any;
   flags = {
-    runtime: this.i18n('The value can be updated at runtime.'),
-    no_mon_update: this.i18n(`Daemons/clients do not pull this value from the
+    runtime: $localize`The value can be updated at runtime.`,
+    no_mon_update: $localize`Daemons/clients do not pull this value from the
       monitor config database. We disallow setting this option via 'ceph config
       set ...'. This option should be configured via ceph.conf or via the
-      command line.`),
-    startup: this.i18n('Option takes effect only during daemon startup.'),
-    cluster_create: this.i18n('Option only affects cluster creation.'),
-    create: this.i18n('Option only affects daemon creation.')
+      command line.`,
+    startup: $localize`Option takes effect only during daemon startup.`,
+    cluster_create: $localize`Option only affects cluster creation.`,
+    create: $localize`Option only affects daemon creation.`
   };
 
-  constructor(private i18n: I18n) {}
-
   ngOnChanges() {
     if (this.selection) {
       this.selection.services = _.split(this.selection.services, ',');
index 070455fbb45bcd613abd04cd964212228efa3a06..d6fd507f8390a4350f5178278eee348a893f68f7 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { ConfigFormModel } from '../../../../shared/components/config-option/config-option.model';
 import { SharedModule } from '../../../../shared/shared.module';
 import { ConfigurationFormComponent } from './configuration-form.component';
@@ -27,8 +27,7 @@ describe('ConfigurationFormComponent', () => {
     providers: [
       {
         provide: ActivatedRoute
-      },
-      i18nProviders
+      }
     ]
   });
 
index 771180f1394a7d031611659d2d08a2f5bdba2f92..aa9ab7b839cac45e0f6a924ccce5f1628773cd45 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { FormControl, FormGroup, ValidatorFn } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { ConfigurationService } from '../../../../shared/api/configuration.service';
@@ -34,8 +33,7 @@ export class ConfigurationFormComponent extends CdForm implements OnInit {
     private route: ActivatedRoute,
     private router: Router,
     private configService: ConfigurationService,
-    private notificationService: NotificationService,
-    private i18n: I18n
+    private notificationService: NotificationService
   ) {
     super();
     this.createForm();
@@ -157,7 +155,7 @@ export class ConfigurationFormComponent extends CdForm implements OnInit {
         () => {
           this.notificationService.show(
             NotificationType.success,
-            this.i18n('Updated config option {{name}}', { name: request.name })
+            $localize`Updated config option ${request.name}`
           );
           this.router.navigate(['/configuration']);
         },
index 32cee6c2a3f6a0a5f859cc3cd3c77abb201601c4..0aa03948562c415b5a4cf39a426510ef90e640e6 100644 (file)
@@ -7,7 +7,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { ConfigurationDetailsComponent } from './configuration-details/configuration-details.component';
 import { ConfigurationComponent } from './configuration.component';
@@ -25,8 +25,7 @@ describe('ConfigurationComponent', () => {
       NgbNavModule,
       HttpClientTestingModule,
       RouterTestingModule
-    ],
-    providers: i18nProviders
+    ]
   });
 
   beforeEach(() => {
index 74971b32c6fa339b3d04c69df6a18495c96e9315..f32c1b0e966100a8508b13797b113106e4549c4b 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { ConfigurationService } from '../../../shared/api/configuration.service';
 import { ListWithDetails } from '../../../shared/classes/list-with-details.class';
 import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
@@ -28,7 +26,7 @@ export class ConfigurationComponent extends ListWithDetails implements OnInit {
   selection = new CdTableSelection();
   filters: CdTableColumn[] = [
     {
-      name: this.i18n('Level'),
+      name: $localize`Level`,
       prop: 'level',
       filterOptions: ['basic', 'advanced', 'dev'],
       filterInitValue: 'basic',
@@ -45,7 +43,7 @@ export class ConfigurationComponent extends ListWithDetails implements OnInit {
       }
     },
     {
-      name: this.i18n('Service'),
+      name: $localize`Service`,
       prop: 'services',
       filterOptions: ['mon', 'mgr', 'osd', 'mds', 'common', 'mds_client', 'rgw'],
       filterPredicate: (row, value) => {
@@ -53,7 +51,7 @@ export class ConfigurationComponent extends ListWithDetails implements OnInit {
       }
     },
     {
-      name: this.i18n('Source'),
+      name: $localize`Source`,
       prop: 'source',
       filterOptions: ['mon'],
       filterPredicate: (row, value) => {
@@ -64,7 +62,7 @@ export class ConfigurationComponent extends ListWithDetails implements OnInit {
       }
     },
     {
-      name: this.i18n('Modified'),
+      name: $localize`Modified`,
       prop: 'modified',
       filterOptions: ['yes', 'no'],
       filterPredicate: (row, value) => {
@@ -89,7 +87,6 @@ export class ConfigurationComponent extends ListWithDetails implements OnInit {
   constructor(
     private authStorageService: AuthStorageService,
     private configurationService: ConfigurationService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
@@ -108,18 +105,18 @@ export class ConfigurationComponent extends ListWithDetails implements OnInit {
 
   ngOnInit() {
     this.columns = [
-      { canAutoResize: true, prop: 'name', name: this.i18n('Name') },
-      { prop: 'desc', name: this.i18n('Description'), cellClass: 'wrap' },
+      { canAutoResize: true, prop: 'name', name: $localize`Name` },
+      { prop: 'desc', name: $localize`Description`, cellClass: 'wrap' },
       {
         prop: 'value',
-        name: this.i18n('Current value'),
+        name: $localize`Current value`,
         cellClass: 'wrap',
         cellTemplate: this.confValTpl
       },
-      { prop: 'default', name: this.i18n('Default'), cellClass: 'wrap' },
+      { prop: 'default', name: $localize`Default`, cellClass: 'wrap' },
       {
         prop: 'can_update_at_runtime',
-        name: this.i18n('Editable'),
+        name: $localize`Editable`,
         cellTransformation: CellTemplate.checkIcon,
         flexGrow: 0.4,
         cellClass: 'text-center'
index a70ccd0b802149cee74a0352fa8ccd80b64a23ec..df2a06ba4270f55131ab13ae51091c4522aa4385 100644 (file)
@@ -6,11 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { ToastrModule } from 'ngx-toastr';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  TabHelper
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, TabHelper } from '../../../../../testing/unit-test-helper';
 import { CoreModule } from '../../../../core/core.module';
 import { Permissions } from '../../../../shared/models/permissions';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -33,9 +29,7 @@ describe('HostDetailsComponent', () => {
       CephSharedModule,
       SharedModule,
       ToastrModule.forRoot()
-    ],
-    declarations: [],
-    providers: [i18nProviders]
+    ]
   });
 
   beforeEach(() => {
index 7015108ad2a53c7600cb1964bf700fdbd2c2abc3..9586beadde0518b4741bd22ad361b6379a0dadf8 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { LoadingPanelComponent } from '../../../../shared/components/loading-panel/loading-panel.component';
 import { SharedModule } from '../../../../shared/shared.module';
 import { HostFormComponent } from './host-form.component';
@@ -23,7 +23,6 @@ describe('HostFormComponent', () => {
         ReactiveFormsModule,
         ToastrModule.forRoot()
       ],
-      providers: [i18nProviders],
       declarations: [HostFormComponent]
     },
     [LoadingPanelComponent]
index 5bb66497d3aebf1c407021088ae877d2b5e3d140..d0118fe114ccb85ef868ee9708aff7929719f23f 100644 (file)
@@ -2,8 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { HostService } from '../../../../shared/api/host.service';
 import { ActionLabelsI18n, URLVerbs } from '../../../../shared/constants/app.constants';
 import { CdForm } from '../../../../shared/forms/cd-form';
@@ -25,13 +23,12 @@ export class HostFormComponent extends CdForm implements OnInit {
 
   constructor(
     private router: Router,
-    private i18n: I18n,
     private actionLabels: ActionLabelsI18n,
     private hostService: HostService,
     private taskWrapper: TaskWrapperService
   ) {
     super();
-    this.resource = this.i18n('host');
+    this.resource = $localize`host`;
     this.action = this.actionLabels.CREATE;
     this.createForm();
   }
index 18e9fd5f1ef58162e588da92605ae34a737bf9f3..bd6444d726edd040ceced5d32d06f633d514ba86 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { CoreModule } from '../../../core/core.module';
 import { HostService } from '../../../shared/api/host.service';
 import { Permissions } from '../../../shared/models/permissions';
@@ -38,8 +38,7 @@ describe('HostsComponent', () => {
       CephModule,
       CoreModule
     ],
-    providers: [{ provide: AuthStorageService, useValue: fakeAuthStorageService }, i18nProviders],
-    declarations: []
+    providers: [{ provide: AuthStorageService, useValue: fakeAuthStorageService }]
   });
 
   beforeEach(() => {
index 089024fbbd77ee7936a29c6ffc6f431d87d39997..d1bea0bdd52543746570e2d504d06eec105dda8c 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
 import { Router } from '@angular/router';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 
 import { HostService } from '../../../shared/api/host.service';
 import { ListWithDetails } from '../../../shared/classes/list-with-details.class';
@@ -56,7 +55,6 @@ export class HostsComponent extends ListWithDetails implements OnInit {
     private hostService: HostService,
     private cephShortVersionPipe: CephShortVersionPipe,
     private joinPipe: JoinPipe,
-    private i18n: I18n,
     private urlBuilder: URLBuilderService,
     private actionLabels: ActionLabelsI18n,
     private modalService: ModalService,
@@ -75,7 +73,7 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         click: () => {
           this.depCheckerService.checkOrchestratorOrModal(
             this.actionLabels.CREATE,
-            this.i18n('Host'),
+            $localize`Host`,
             () => {
               this.router.navigate([this.urlBuilder.getCreate()]);
             }
@@ -89,7 +87,7 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         click: () => {
           this.depCheckerService.checkOrchestratorOrModal(
             this.actionLabels.EDIT,
-            this.i18n('Host'),
+            $localize`Host`,
             () => this.editAction()
           );
         },
@@ -104,7 +102,7 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         click: () => {
           this.depCheckerService.checkOrchestratorOrModal(
             this.actionLabels.DELETE,
-            this.i18n('Host'),
+            $localize`Host`,
             () => this.deleteAction()
           );
         },
@@ -119,24 +117,24 @@ export class HostsComponent extends ListWithDetails implements OnInit {
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Hostname'),
+        name: $localize`Hostname`,
         prop: 'hostname',
         flexGrow: 1
       },
       {
-        name: this.i18n('Services'),
+        name: $localize`Services`,
         prop: 'services',
         flexGrow: 3,
         cellTemplate: this.servicesTpl
       },
       {
-        name: this.i18n('Labels'),
+        name: $localize`Labels`,
         prop: 'labels',
         flexGrow: 1,
         pipe: this.joinPipe
       },
       {
-        name: this.i18n('Version'),
+        name: $localize`Version`,
         prop: 'ceph_version',
         flexGrow: 1,
         pipe: this.cephShortVersionPipe
@@ -155,33 +153,30 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         return { enabled: true, name: label };
       });
       this.modalService.show(FormModalComponent, {
-        titleText: this.i18n('Edit Host: {{hostname}}', host),
+        titleText: $localize`Edit Host: ${host.hostname}`,
         fields: [
           {
             type: 'select-badges',
             name: 'labels',
             value: host['labels'],
-            label: this.i18n('Labels'),
+            label: $localize`Labels`,
             typeConfig: {
               customBadges: true,
               options: allLabels,
-              messages: new SelectMessages(
-                {
-                  empty: this.i18n('There are no labels.'),
-                  filter: this.i18n('Filter or add labels'),
-                  add: this.i18n('Add label')
-                },
-                this.i18n
-              )
+              messages: new SelectMessages({
+                empty: $localize`There are no labels.`,
+                filter: $localize`Filter or add labels`,
+                add: $localize`Add label`
+              })
             }
           }
         ],
-        submitButtonText: this.i18n('Edit Host'),
+        submitButtonText: $localize`Edit Host`,
         onSubmit: (values: any) => {
           this.hostService.update(host['hostname'], values.labels).subscribe(() => {
             this.notificationService.show(
               NotificationType.success,
-              this.i18n('Updated Host "{{hostname}}"', host)
+              $localize`Updated Host "${host.hostname}"`
             );
             // Reload the data table content.
             this.table.refreshBtn();
@@ -193,9 +188,7 @@ export class HostsComponent extends ListWithDetails implements OnInit {
 
   getEditDisableDesc(selection: CdTableSelection): string | undefined {
     if (selection && selection.hasSingleSelection && !selection.first().sources.orchestrator) {
-      return this.i18n(
-        'Host editing is disabled because the selected host is not managed by Orchestrator.'
-      );
+      return $localize`Host editing is disabled because the selected host is not managed by Orchestrator.`;
     }
     return undefined;
   }
@@ -220,9 +213,7 @@ export class HostsComponent extends ListWithDetails implements OnInit {
       selection.hasSelection &&
       !selection.selected.every((selected) => selected.sources.orchestrator)
     ) {
-      return this.i18n(
-        'Host deletion is disabled because a selected host is not managed by Orchestrator.'
-      );
+      return $localize`Host deletion is disabled because a selected host is not managed by Orchestrator.`;
     }
     return undefined;
   }
index 695b3377a15dd461383e95810657f5ff8d311f13..1ce48f6fd00fa01349ebc33e02d950c3cb9a2066 100644 (file)
@@ -6,7 +6,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 import * as _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
 import { InventoryDevicesComponent } from './inventory-devices.component';
 
@@ -22,7 +22,6 @@ describe('InventoryDevicesComponent', () => {
       SharedModule,
       ToastrModule.forRoot()
     ],
-    providers: [i18nProviders],
     declarations: [InventoryDevicesComponent]
   });
 
index 3cc281f7e1ab94400d3377e9768d5424359b7b8a..4b99c747396b3227dc798e7e76cb8d84d49b037e 100644 (file)
@@ -8,7 +8,6 @@ import {
   ViewChild
 } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { Subscription } from 'rxjs';
 
@@ -71,7 +70,6 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
   constructor(
     private authStorageService: AuthStorageService,
     private dimlessBinary: DimlessBinaryPipe,
-    private i18n: I18n,
     private modalService: ModalService,
     private notificationService: NotificationService,
     private orchService: OrchestratorService
@@ -84,7 +82,7 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
         permission: 'update',
         icon: Icons.show,
         click: () => this.identifyDevice(),
-        name: this.i18n('Identify'),
+        name: $localize`Identify`,
         disable: () => !this.selection.hasSingleSelection,
         canBePrimary: (selection: CdTableSelection) => !selection.hasSingleSelection,
         visible: () => _.isString(this.selectionType)
@@ -92,17 +90,17 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
     ];
     const columns = [
       {
-        name: this.i18n('Hostname'),
+        name: $localize`Hostname`,
         prop: 'hostname',
         flexGrow: 1
       },
       {
-        name: this.i18n('Device path'),
+        name: $localize`Device path`,
         prop: 'path',
         flexGrow: 1
       },
       {
-        name: this.i18n('Type'),
+        name: $localize`Type`,
         prop: 'human_readable_type',
         flexGrow: 1,
         cellTransformation: CellTemplate.badge,
@@ -114,30 +112,30 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
         }
       },
       {
-        name: this.i18n('Available'),
+        name: $localize`Available`,
         prop: 'available',
         flexGrow: 1,
         cellClass: 'text-center',
         cellTransformation: CellTemplate.checkIcon
       },
       {
-        name: this.i18n('Vendor'),
+        name: $localize`Vendor`,
         prop: 'sys_api.vendor',
         flexGrow: 1
       },
       {
-        name: this.i18n('Model'),
+        name: $localize`Model`,
         prop: 'sys_api.model',
         flexGrow: 1
       },
       {
-        name: this.i18n('Size'),
+        name: $localize`Size`,
         prop: 'sys_api.size',
         flexGrow: 1,
         pipe: this.dimlessBinary
       },
       {
-        name: this.i18n('OSDs'),
+        name: $localize`OSDs`,
         prop: 'osd_ids',
         flexGrow: 1,
         cellTransformation: CellTemplate.badge,
@@ -186,8 +184,8 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
     const hostname = selected.hostname;
     const device = selected.path || selected.device_id;
     this.modalService.show(FormModalComponent, {
-      titleText: this.i18n(`Identify device {{device}}`, { device }),
-      message: this.i18n('Please enter the duration how long to blink the LED.'),
+      titleText: $localize`Identify device ${device}`,
+      message: $localize`Please enter the duration how long to blink the LED.`,
       fields: [
         {
           type: 'select',
@@ -196,24 +194,21 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
           required: true,
           typeConfig: {
             options: [
-              { text: this.i18n('1 minute'), value: 60 },
-              { text: this.i18n('2 minutes'), value: 120 },
-              { text: this.i18n('5 minutes'), value: 300 },
-              { text: this.i18n('10 minutes'), value: 600 },
-              { text: this.i18n('15 minutes'), value: 900 }
+              { text: $localize`1 minute`, value: 60 },
+              { text: $localize`2 minutes`, value: 120 },
+              { text: $localize`5 minutes`, value: 300 },
+              { text: $localize`10 minutes`, value: 600 },
+              { text: $localize`15 minutes`, value: 900 }
             ]
           }
         }
       ],
-      submitButtonText: this.i18n('Execute'),
+      submitButtonText: $localize`Execute`,
       onSubmit: (values: any) => {
         this.orchService.identifyDevice(hostname, device, values.duration).subscribe(() => {
           this.notificationService.show(
             NotificationType.success,
-            this.i18n(`Identifying '{{device}}' started on host '{{hostname}}'`, {
-              hostname,
-              device
-            })
+            $localize`Identifying '${device}' started on host '${hostname}'`
           );
         });
       }
index 51de5164befe621977272cdace1d18de8e494ad3..3c97845e8ef08e55b68b1f86574bd1660c792c00 100644 (file)
@@ -7,7 +7,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { OrchestratorService } from '../../../shared/api/orchestrator.service';
 import { SharedModule } from '../../../shared/shared.module';
 import { InventoryDevicesComponent } from './inventory-devices/inventory-devices.component';
@@ -27,7 +27,6 @@ describe('InventoryComponent', () => {
       RouterTestingModule,
       ToastrModule.forRoot()
     ],
-    providers: [i18nProviders],
     declarations: [InventoryComponent, InventoryDevicesComponent]
   });
 
index f33e17cd11d43370bce36273d0e203de95b0544d..ff6473ed1334b84908acfae0b134b40877f6164d 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
 import { MgrModuleDetailsComponent } from './mgr-module-details.component';
 
@@ -11,8 +11,7 @@ describe('MgrModuleDetailsComponent', () => {
 
   configureTestBed({
     declarations: [MgrModuleDetailsComponent],
-    imports: [HttpClientTestingModule, SharedModule],
-    providers: [i18nProviders]
+    imports: [HttpClientTestingModule, SharedModule]
   });
 
   beforeEach(() => {
index 18cbb7609bd6b61c2d0f9b72c4d0b5ecb1d7985f..18168a686e6936948e46083322a603e59e4d5a44 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { LoadingPanelComponent } from '../../../../shared/components/loading-panel/loading-panel.component';
 import { SharedModule } from '../../../../shared/shared.module';
 import { MgrModuleFormComponent } from './mgr-module-form.component';
@@ -23,8 +23,7 @@ describe('MgrModuleFormComponent', () => {
         RouterTestingModule,
         SharedModule,
         ToastrModule.forRoot()
-      ],
-      providers: i18nProviders
+      ]
     },
     [LoadingPanelComponent]
   );
index ea92c9fc550c9af4d380dda682d0c94ae59faa2a..715ee5035c81dc6fd18fa496544b05b96c01e27f 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { ValidatorFn, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin as observableForkJoin } from 'rxjs';
 
@@ -29,8 +28,7 @@ export class MgrModuleFormComponent extends CdForm implements OnInit {
     private router: Router,
     private formBuilder: CdFormBuilder,
     private mgrModuleService: MgrModuleService,
-    private notificationService: NotificationService,
-    private i18n: I18n
+    private notificationService: NotificationService
   ) {
     super();
   }
@@ -129,7 +127,7 @@ export class MgrModuleFormComponent extends CdForm implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Updated options for module '{{name}}'.`, { name: this.moduleName })
+          $localize`Updated options for module '${this.moduleName}'.`
         );
         this.goToListView();
       },
index dbeca1db81246056c67ae72c457e05e24bbb841a..f340bd83264c6147cb859c892a563ebe14b8d3e3 100644 (file)
@@ -7,11 +7,7 @@ import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of as observableOf, throwError as observableThrowError } from 'rxjs';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../../testing/unit-test-helper';
 import { MgrModuleService } from '../../../../shared/api/mgr-module.service';
 import { TableActionsComponent } from '../../../../shared/datatable/table-actions/table-actions.component';
 import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
@@ -36,7 +32,7 @@ describe('MgrModuleListComponent', () => {
       NgbNavModule,
       ToastrModule.forRoot()
     ],
-    providers: [MgrModuleService, NotificationService, i18nProviders]
+    providers: [MgrModuleService, NotificationService]
   });
 
   beforeEach(() => {
index 4db0f6fd1d832833ca728976d9bcd4dffe4c3de8..8e1da89d0f56fe65e001928bfa30572b88366c0f 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { BlockUI, NgBlockUI } from 'ng-block-ui';
 import { timer as observableTimer } from 'rxjs';
 
@@ -37,26 +36,25 @@ export class MgrModuleListComponent extends ListWithDetails {
   constructor(
     private authStorageService: AuthStorageService,
     private mgrModuleService: MgrModuleService,
-    private notificationService: NotificationService,
-    private i18n: I18n
+    private notificationService: NotificationService
   ) {
     super();
     this.permission = this.authStorageService.getPermissions().configOpt;
     this.columns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'name',
         flexGrow: 1
       },
       {
-        name: this.i18n('Enabled'),
+        name: $localize`Enabled`,
         prop: 'enabled',
         flexGrow: 1,
         cellClass: 'text-center',
         cellTransformation: CellTemplate.checkIcon
       },
       {
-        name: this.i18n('Always-On'),
+        name: $localize`Always-On`,
         prop: 'always_on',
         isHidden: true,
         flexGrow: 1,
@@ -68,7 +66,7 @@ export class MgrModuleListComponent extends ListWithDetails {
       this.selection.first() && encodeURIComponent(this.selection.first().name);
     this.tableActions = [
       {
-        name: this.i18n('Edit'),
+        name: $localize`Edit`,
         permission: 'update',
         disable: () => {
           if (!this.selection.hasSelection) {
@@ -81,14 +79,14 @@ export class MgrModuleListComponent extends ListWithDetails {
         icon: Icons.edit
       },
       {
-        name: this.i18n('Enable'),
+        name: $localize`Enable`,
         permission: 'update',
         click: () => this.updateModuleState(),
         disable: () => this.isTableActionDisabled('enabled'),
         icon: Icons.start
       },
       {
-        name: this.i18n('Disable'),
+        name: $localize`Disable`,
         permission: 'update',
         click: () => this.updateModuleState(),
         disable: () => this.isTableActionDisabled('disabled'),
@@ -146,7 +144,7 @@ export class MgrModuleListComponent extends ListWithDetails {
     if (this.selection.hasSelection) {
       const selected = this.selection.first();
       if (selected.always_on) {
-        return this.i18n('This Manager module is always on.');
+        return $localize`This Manager module is always on.`;
       }
     }
 
@@ -197,7 +195,7 @@ export class MgrModuleListComponent extends ListWithDetails {
         this.notificationService.suspendToasties(true);
         // Block the whole UI to prevent user interactions until
         // the connection to the backend is reestablished
-        this.blockUI.start(this.i18n('Reconnecting, please wait ...'));
+        this.blockUI.start($localize`Reconnecting, please wait ...`);
         fnWaitUntilReconnected();
       }
     );
index d15be4a3598953b345039654e5a3c6f205fc916e..1df4af8810f988c4eaa282ace0eef1f165a8c097 100644 (file)
@@ -4,7 +4,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { MonitorService } from '../../../shared/api/monitor.service';
 import { MonitorComponent } from './monitor.component';
 
@@ -17,7 +17,7 @@ describe('MonitorComponent', () => {
     imports: [HttpClientTestingModule],
     declarations: [MonitorComponent],
     schemas: [NO_ERRORS_SCHEMA],
-    providers: [MonitorService, i18nProviders]
+    providers: [MonitorService]
   });
 
   beforeEach(() => {
index 441351b729a4d9b243f2e1f39f78e799bfaa0b18..82d765dac5b9101f48f8607145346d2511a81434 100644 (file)
@@ -1,6 +1,5 @@
 import { Component } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { MonitorService } from '../../../shared/api/monitor.service';
@@ -18,15 +17,15 @@ export class MonitorComponent {
 
   interval: any;
 
-  constructor(private monitorService: MonitorService, private i18n: I18n) {
+  constructor(private monitorService: MonitorService) {
     this.inQuorum = {
       columns: [
-        { prop: 'name', name: this.i18n('Name'), cellTransformation: CellTemplate.routerLink },
-        { prop: 'rank', name: this.i18n('Rank') },
-        { prop: 'public_addr', name: this.i18n('Public Address') },
+        { prop: 'name', name: $localize`Name`, cellTransformation: CellTemplate.routerLink },
+        { prop: 'rank', name: $localize`Rank` },
+        { prop: 'public_addr', name: $localize`Public Address` },
         {
           prop: 'cdOpenSessions',
-          name: this.i18n('Open Sessions'),
+          name: $localize`Open Sessions`,
           cellTransformation: CellTemplate.sparkline,
           comparator: (dataA: any, dataB: any) => {
             // We get the last value of time series to compare:
@@ -45,9 +44,9 @@ export class MonitorComponent {
 
     this.notInQuorum = {
       columns: [
-        { prop: 'name', name: this.i18n('Name'), cellTransformation: CellTemplate.routerLink },
-        { prop: 'rank', name: this.i18n('Rank') },
-        { prop: 'public_addr', name: this.i18n('Public Address') }
+        { prop: 'name', name: $localize`Name`, cellTransformation: CellTemplate.routerLink },
+        { prop: 'rank', name: $localize`Rank` },
+        { prop: 'public_addr', name: $localize`Public Address` }
       ]
     };
   }
index 6922d99dbbdadaa58777b23fb1fd8cdf346557d9..1f6ecd143d4c98fcfdfc058fff0c24672cd23b88 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
 import { OsdCreationPreviewModalComponent } from './osd-creation-preview-modal.component';
 
@@ -22,7 +22,7 @@ describe('OsdCreationPreviewModalComponent', () => {
       RouterTestingModule,
       ToastrModule.forRoot()
     ],
-    providers: [NgbActiveModal, i18nProviders],
+    providers: [NgbActiveModal],
     declarations: [OsdCreationPreviewModalComponent]
   });
 
index 0ed14a1aea95076d2ef548e3f3874e6002b20603..0d55de450ed59ed2654151db3832339a7b7a6017 100644 (file)
@@ -5,7 +5,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { OsdService } from '../../../../shared/api/osd.service';
 import { SharedModule } from '../../../../shared/shared.module';
 import { TablePerformanceCounterComponent } from '../../../performance-counter/table-performance-counter/table-performance-counter.component';
@@ -29,8 +29,7 @@ describe('OsdDetailsComponent', () => {
       SmartListComponent,
       TablePerformanceCounterComponent,
       OsdPerformanceHistogramComponent
-    ],
-    providers: i18nProviders
+    ]
   });
 
   beforeEach(() => {
index 893f981498782edac4c9ff6b095ead4ec7fbc3fd..7aac4146f42876607f83bf2031f530c2b7304d6d 100644 (file)
@@ -5,12 +5,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import {
-  configureTestBed,
-  FixtureHelper,
-  i18nProviders,
-  Mocks
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, FixtureHelper, Mocks } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
 import { InventoryDevice } from '../../inventory/inventory-devices/inventory-device.model';
 import { InventoryDevicesComponent } from '../../inventory/inventory-devices/inventory-devices.component';
@@ -41,7 +36,6 @@ describe('OsdDevicesSelectionGroupsComponent', () => {
       SharedModule,
       ToastrModule.forRoot()
     ],
-    providers: [i18nProviders],
     declarations: [OsdDevicesSelectionGroupsComponent, InventoryDevicesComponent]
   });
 
index 8c41b75482a091de2df746eb3940b30bd2906129..3693bc558cca794be18db0915e5b74e75568cfb5 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { Icons } from '../../../../shared/enum/icons.enum';
@@ -42,12 +41,12 @@ export class OsdDevicesSelectionGroupsComponent implements OnInit, OnChanges {
 
   addButtonTooltip: String;
   tooltips = {
-    noAvailDevices: this.i18n('No available devices'),
-    addPrimaryFirst: this.i18n('Please add primary devices first'),
-    addByFilters: this.i18n('Add devices by using filters')
+    noAvailDevices: $localize`No available devices`,
+    addPrimaryFirst: $localize`Please add primary devices first`,
+    addByFilters: $localize`Add devices by using filters`
   };
 
-  constructor(private modalService: ModalService, private i18n: I18n) {}
+  constructor(private modalService: ModalService) {}
 
   ngOnInit() {
     this.updateAddButtonTooltip();
index 6847104c67d72ad859abee402d8c5fad1b8d51f1..baa9e230e83d03ae8c0531a993f9a209749a0bd5 100644 (file)
@@ -7,7 +7,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders, Mocks } from '../../../../../testing/unit-test-helper';
+import { configureTestBed, Mocks } from '../../../../../testing/unit-test-helper';
 import { CdTableColumnFiltersChange } from '../../../../shared/models/cd-table-column-filters-change';
 import { SharedModule } from '../../../../shared/shared.module';
 import { InventoryDevice } from '../../inventory/inventory-devices/inventory-device.model';
@@ -37,7 +37,7 @@ describe('OsdDevicesSelectionModalComponent', () => {
       RouterTestingModule,
       ToastrModule.forRoot()
     ],
-    providers: [NgbActiveModal, i18nProviders],
+    providers: [NgbActiveModal],
     declarations: [OsdDevicesSelectionModalComponent, InventoryDevicesComponent]
   });
 
index b73a495af8e19e6a7e17adb6b807297b8cdeb913..78d472da16a36e253bf2b4f7b5fcc30ac1fe3f07 100644 (file)
@@ -7,7 +7,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import * as _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { NotificationType } from '../../../../shared/enum/notification-type.enum';
 import { NotificationService } from '../../../../shared/services/notification.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -34,7 +34,7 @@ describe('OsdFlagsModalComponent', () => {
       ToastrModule.forRoot()
     ],
     declarations: [OsdFlagsModalComponent],
-    providers: [i18nProviders, NgbActiveModal]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index e2cc01a764d0354eb512f658870f414e96db3c08..78ca001ce7a89a5f21e57fbfecd011910866bfcc 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { FormGroup } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { OsdService } from '../../../../shared/api/osd.service';
@@ -24,96 +23,90 @@ export class OsdFlagsModalComponent implements OnInit {
   allFlags = {
     noin: {
       code: 'noin',
-      name: this.i18n('No In'),
+      name: $localize`No In`,
       value: false,
-      description: this.i18n(
-        'OSDs that were previously marked out will not be marked back in when they start'
-      )
+      description: $localize`OSDs that were previously marked out will not be marked back in when they start`
     },
     noout: {
       code: 'noout',
-      name: this.i18n('No Out'),
+      name: $localize`No Out`,
       value: false,
-      description: this.i18n(
-        'OSDs will not automatically be marked out after the configured interval'
-      )
+      description: $localize`OSDs will not automatically be marked out after the configured interval`
     },
     noup: {
       code: 'noup',
-      name: this.i18n('No Up'),
+      name: $localize`No Up`,
       value: false,
-      description: this.i18n('OSDs are not allowed to start')
+      description: $localize`OSDs are not allowed to start`
     },
     nodown: {
       code: 'nodown',
-      name: this.i18n('No Down'),
+      name: $localize`No Down`,
       value: false,
-      description: this.i18n(
-        'OSD failure reports are being ignored, such that the monitors will not mark OSDs down'
-      )
+      description: $localize`OSD failure reports are being ignored, such that the monitors will not mark OSDs down`
     },
     pause: {
       code: 'pause',
-      name: this.i18n('Pause'),
+      name: $localize`Pause`,
       value: false,
-      description: this.i18n('Pauses reads and writes')
+      description: $localize`Pauses reads and writes`
     },
     noscrub: {
       code: 'noscrub',
-      name: this.i18n('No Scrub'),
+      name: $localize`No Scrub`,
       value: false,
-      description: this.i18n('Scrubbing is disabled')
+      description: $localize`Scrubbing is disabled`
     },
     'nodeep-scrub': {
       code: 'nodeep-scrub',
-      name: this.i18n('No Deep Scrub'),
+      name: $localize`No Deep Scrub`,
       value: false,
-      description: this.i18n('Deep Scrubbing is disabled')
+      description: $localize`Deep Scrubbing is disabled`
     },
     nobackfill: {
       code: 'nobackfill',
-      name: this.i18n('No Backfill'),
+      name: $localize`No Backfill`,
       value: false,
-      description: this.i18n('Backfilling of PGs is suspended')
+      description: $localize`Backfilling of PGs is suspended`
     },
     norebalance: {
       code: 'norebalance',
-      name: this.i18n('No Rebalance'),
+      name: $localize`No Rebalance`,
       value: false,
-      description: this.i18n('OSD will choose not to backfill unless PG is also degraded')
+      description: $localize`OSD will choose not to backfill unless PG is also degraded`
     },
     norecover: {
       code: 'norecover',
-      name: this.i18n('No Recover'),
+      name: $localize`No Recover`,
       value: false,
-      description: this.i18n('Recovery of PGs is suspended')
+      description: $localize`Recovery of PGs is suspended`
     },
     sortbitwise: {
       code: 'sortbitwise',
-      name: this.i18n('Bitwise Sort'),
+      name: $localize`Bitwise Sort`,
       value: false,
-      description: this.i18n('Use bitwise sort'),
+      description: $localize`Use bitwise sort`,
       disabled: true
     },
     purged_snapdirs: {
       code: 'purged_snapdirs',
-      name: this.i18n('Purged Snapdirs'),
+      name: $localize`Purged Snapdirs`,
       value: false,
-      description: this.i18n('OSDs have converted snapsets'),
+      description: $localize`OSDs have converted snapsets`,
       disabled: true
     },
     recovery_deletes: {
       code: 'recovery_deletes',
-      name: this.i18n('Recovery Deletes'),
+      name: $localize`Recovery Deletes`,
       value: false,
-      description: this.i18n('Deletes performed during recovery instead of peering'),
+      description: $localize`Deletes performed during recovery instead of peering`,
       disabled: true
     },
     pglog_hardlimit: {
       code: 'pglog_hardlimit',
-      name: this.i18n('PG Log Hard Limit'),
+      name: $localize`PG Log Hard Limit`,
       value: false,
-      description: this.i18n('Puts a hard limit on pg log length'),
+      description: $localize`Puts a hard limit on pg log length`,
       disabled: true
     }
   };
@@ -124,8 +117,7 @@ export class OsdFlagsModalComponent implements OnInit {
     public activeModal: NgbActiveModal,
     private authStorageService: AuthStorageService,
     private osdService: OsdService,
-    private notificationService: NotificationService,
-    private i18n: I18n
+    private notificationService: NotificationService
   ) {
     this.permissions = this.authStorageService.getPermissions();
   }
@@ -151,7 +143,7 @@ export class OsdFlagsModalComponent implements OnInit {
 
     this.osdService.updateFlags(newFlags).subscribe(
       () => {
-        this.notificationService.show(NotificationType.success, this.i18n('Updated OSD Flags'));
+        this.notificationService.show(NotificationType.success, $localize`Updated OSD Flags`);
         this.activeModal.close();
       },
       () => {
index 0acf0f3a1c70790b73417364f793165bda82da6b..4ca688acc0d3fa16b38ad344b4eac972b62bcd50 100644 (file)
@@ -10,8 +10,7 @@ import { BehaviorSubject, of } from 'rxjs';
 import {
   configureTestBed,
   FixtureHelper,
-  FormHelper,
-  i18nProviders
+  FormHelper
 } from '../../../../../testing/unit-test-helper';
 import { OrchestratorService } from '../../../../shared/api/orchestrator.service';
 import { CdFormGroup } from '../../../../shared/forms/cd-form-group';
@@ -104,7 +103,6 @@ describe('OsdFormComponent', () => {
       ReactiveFormsModule,
       ToastrModule.forRoot()
     ],
-    providers: [i18nProviders],
     declarations: [OsdFormComponent, OsdDevicesSelectionGroupsComponent, InventoryDevicesComponent]
   });
 
index 291a87c75c60ec3eaeb08dc3d90a5f4b0ca256df..7a3538e6e2038bb444c0b3341a140cf2f5582f16 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit, ViewChild } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { OrchestratorService } from '../../../../shared/api/orchestrator.service';
@@ -66,18 +65,17 @@ export class OsdFormComponent extends CdForm implements OnInit {
   constructor(
     public actionLabels: ActionLabelsI18n,
     private authStorageService: AuthStorageService,
-    private i18n: I18n,
     private orchService: OrchestratorService,
     private router: Router,
     private modalService: ModalService
   ) {
     super();
-    this.resource = this.i18n('OSDs');
+    this.resource = $localize`OSDs`;
     this.action = this.actionLabels.CREATE;
     this.features = {
       encrypted: {
         key: 'encrypted',
-        desc: this.i18n('Encryption')
+        desc: $localize`Encryption`
       }
     };
     this.featureList = _.map(this.features, (o, key) => Object.assign(o, { key: key }));
index 44792948d6957ad775fc12edc737210ee0512cf1..f928e4de4b06070c6546bdbfd2a2d34f82de2cc6 100644 (file)
@@ -10,11 +10,7 @@ import * as _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 import { EMPTY, of } from 'rxjs';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../../testing/unit-test-helper';
 import { CoreModule } from '../../../../core/core.module';
 import { OrchestratorService } from '../../../../shared/api/orchestrator.service';
 import { OsdService } from '../../../../shared/api/osd.service';
@@ -103,12 +99,10 @@ describe('OsdListComponent', () => {
       CoreModule,
       RouterTestingModule
     ],
-    declarations: [],
     providers: [
       { provide: AuthStorageService, useValue: fakeAuthStorageService },
       TableActionsComponent,
-      ModalService,
-      i18nProviders
+      ModalService
     ]
   });
 
index 67224ce68718bf46d643e882c7e04845eed24391..af298a9e5b16827ef97d20c69045ae6e1fa8e3e2 100644 (file)
@@ -3,7 +3,6 @@ import { FormControl } from '@angular/forms';
 import { Router } from '@angular/router';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin as observableForkJoin, Observable } from 'rxjs';
 
@@ -87,7 +86,6 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
     private osdService: OsdService,
     private dimlessBinaryPipe: DimlessBinaryPipe,
     private modalService: ModalService,
-    private i18n: I18n,
     private urlBuilder: URLBuilderService,
     private router: Router,
     private depCheckerService: DepCheckerService,
@@ -105,7 +103,7 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
         click: () => {
           this.depCheckerService.checkOrchestratorOrModal(
             this.actionLabels.CREATE,
-            this.i18n('OSD'),
+            $localize`OSD`,
             () => {
               this.router.navigate([this.urlBuilder.getCreate()]);
             }
@@ -144,21 +142,21 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
       {
         name: this.actionLabels.MARK_OUT,
         permission: 'update',
-        click: () => this.showConfirmationModal(this.i18n('out'), this.osdService.markOut),
+        click: () => this.showConfirmationModal($localize`out`, this.osdService.markOut),
         disable: () => this.isNotSelectedOrInState('out'),
         icon: Icons.left
       },
       {
         name: this.actionLabels.MARK_IN,
         permission: 'update',
-        click: () => this.showConfirmationModal(this.i18n('in'), this.osdService.markIn),
+        click: () => this.showConfirmationModal($localize`in`, this.osdService.markIn),
         disable: () => this.isNotSelectedOrInState('in'),
         icon: Icons.right
       },
       {
         name: this.actionLabels.MARK_DOWN,
         permission: 'update',
-        click: () => this.showConfirmationModal(this.i18n('down'), this.osdService.markDown),
+        click: () => this.showConfirmationModal($localize`down`, this.osdService.markDown),
         disable: () => this.isNotSelectedOrInState('down'),
         icon: Icons.down
       },
@@ -167,9 +165,9 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
         permission: 'delete',
         click: () =>
           this.showCriticalConfirmationModal(
-            this.i18n('Mark'),
-            this.i18n('OSD lost'),
-            this.i18n('marked lost'),
+            $localize`Mark`,
+            $localize`OSD lost`,
+            $localize`marked lost`,
             (ids: number[]) => {
               return this.osdService.safeToDestroy(JSON.stringify(ids));
             },
@@ -184,9 +182,9 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
         permission: 'delete',
         click: () =>
           this.showCriticalConfirmationModal(
-            this.i18n('Purge'),
-            this.i18n('OSD'),
-            this.i18n('purged'),
+            $localize`Purge`,
+            $localize`OSD`,
+            $localize`purged`,
             (ids: number[]) => {
               return this.osdService.safeToDestroy(JSON.stringify(ids));
             },
@@ -204,9 +202,9 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
         permission: 'delete',
         click: () =>
           this.showCriticalConfirmationModal(
-            this.i18n('destroy'),
-            this.i18n('OSD'),
-            this.i18n('destroyed'),
+            $localize`destroy`,
+            $localize`OSD`,
+            $localize`destroyed`,
             (ids: number[]) => {
               return this.osdService.safeToDestroy(JSON.stringify(ids));
             },
@@ -232,21 +230,21 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
   ngOnInit() {
     this.clusterWideActions = [
       {
-        name: this.i18n('Flags'),
+        name: $localize`Flags`,
         icon: Icons.flag,
         click: () => this.configureFlagsAction(),
         permission: 'read',
         visible: () => this.permissions.osd.read
       },
       {
-        name: this.i18n('Recovery Priority'),
+        name: $localize`Recovery Priority`,
         icon: Icons.deepCheck,
         click: () => this.configureQosParamsAction(),
         permission: 'read',
         visible: () => this.permissions.configOpt.read
       },
       {
-        name: this.i18n('PG scrub'),
+        name: $localize`PG scrub`,
         icon: Icons.analyse,
         click: () => this.configurePgScrubAction(),
         permission: 'read',
@@ -254,11 +252,11 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
       }
     ];
     this.columns = [
-      { prop: 'host.name', name: this.i18n('Host') },
-      { prop: 'id', name: this.i18n('ID'), flexGrow: 1, cellTransformation: CellTemplate.bold },
+      { prop: 'host.name', name: $localize`Host` },
+      { prop: 'id', name: $localize`ID`, flexGrow: 1, cellTransformation: CellTemplate.bold },
       {
         prop: 'collectedStates',
-        name: this.i18n('Status'),
+        name: $localize`Status`,
         flexGrow: 1,
         cellTransformation: CellTemplate.badge,
         customTemplateConfig: {
@@ -273,7 +271,7 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
       },
       {
         prop: 'tree.device_class',
-        name: this.i18n('Device class'),
+        name: $localize`Device class`,
         flexGrow: 1.2,
         cellTransformation: CellTemplate.badge,
         customTemplateConfig: {
@@ -285,34 +283,34 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
       },
       {
         prop: 'stats.numpg',
-        name: this.i18n('PGs'),
+        name: $localize`PGs`,
         flexGrow: 1
       },
       {
         prop: 'stats.stat_bytes',
-        name: this.i18n('Size'),
+        name: $localize`Size`,
         flexGrow: 1,
         pipe: this.dimlessBinaryPipe
       },
-      { prop: 'stats.usage', name: this.i18n('Usage'), cellTemplate: this.osdUsageTpl },
+      { prop: 'stats.usage', name: $localize`Usage`, cellTemplate: this.osdUsageTpl },
       {
         prop: 'stats_history.out_bytes',
-        name: this.i18n('Read bytes'),
+        name: $localize`Read bytes`,
         cellTransformation: CellTemplate.sparkline
       },
       {
         prop: 'stats_history.in_bytes',
-        name: this.i18n('Write bytes'),
+        name: $localize`Write bytes`,
         cellTransformation: CellTemplate.sparkline
       },
       {
         prop: 'stats.op_r',
-        name: this.i18n('Read ops'),
+        name: $localize`Read ops`,
         cellTransformation: CellTemplate.perSecond
       },
       {
         prop: 'stats.op_w',
-        name: this.i18n('Write ops'),
+        name: $localize`Write ops`,
         cellTransformation: CellTemplate.perSecond
       }
     ];
@@ -379,26 +377,22 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
     const selectedOsd = _.filter(this.osds, ['id', this.selection.first().id]).pop();
 
     this.modalService.show(FormModalComponent, {
-      titleText: this.i18n('Edit OSD: {{id}}', {
-        id: selectedOsd.id
-      }),
+      titleText: $localize`Edit OSD: ${selectedOsd.id}`,
       fields: [
         {
           type: 'text',
           name: 'deviceClass',
           value: selectedOsd.tree.device_class,
-          label: this.i18n('Device class'),
+          label: $localize`Device class`,
           required: true
         }
       ],
-      submitButtonText: this.i18n('Edit OSD'),
+      submitButtonText: $localize`Edit OSD`,
       onSubmit: (values: any) => {
         this.osdService.update(selectedOsd.id, values.deviceClass).subscribe(() => {
           this.notificationService.show(
             NotificationType.success,
-            this.i18n(`Updated OSD '{{id}}'`, {
-              id: selectedOsd.id
-            })
+            $localize`Updated OSD '${selectedOsd.id}'`
           );
           this.getOsdList();
         });
@@ -425,8 +419,8 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
 
   showConfirmationModal(markAction: string, onSubmit: (id: number) => Observable<any>) {
     this.bsModalRef = this.modalService.show(ConfirmationModalComponent, {
-      titleText: this.i18n('Mark OSD {{markAction}}', { markAction: markAction }),
-      buttonText: this.i18n('Mark {{markAction}}', { markAction: markAction }),
+      titleText: $localize`Mark OSD ${markAction}`,
+      buttonText: $localize`Mark ${markAction}`,
       bodyTpl: this.markOsdConfirmationTpl,
       bodyContext: {
         markActionDescription: markAction
@@ -454,12 +448,12 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
 
     this.depCheckerService.checkOrchestratorOrModal(
       this.actionLabels.DELETE,
-      this.i18n('OSD'),
+      $localize`OSD`,
       () => {
         this.showCriticalConfirmationModal(
-          this.i18n('delete'),
-          this.i18n('OSD'),
-          this.i18n('deleted'),
+          $localize`delete`,
+          $localize`OSD`,
+          $localize`deleted`,
           (ids: number[]) => {
             return this.osdService.safeToDelete(JSON.stringify(ids));
           },
index 083398d1ce06f0c59726fe355b772bab81454f9b..8b9d39268e26aa3efb2a2c99243c01fdfe7e8485 100644 (file)
@@ -8,7 +8,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of as observableOf } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { ConfigurationService } from '../../../../shared/api/configuration.service';
 import { NotificationType } from '../../../../shared/enum/notification-type.enum';
 import { NotificationService } from '../../../../shared/services/notification.service';
@@ -29,7 +29,7 @@ describe('OsdPgScrubModalComponent', () => {
       ToastrModule.forRoot()
     ],
     declarations: [OsdPgScrubModalComponent],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index e2b4c1d4450078e93726c5fbe5f4eca8dc18e0f7..8c21b6d417711b1fbab6fbfcbf2a7e68a4628650 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, ViewChild } from '@angular/core';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { forkJoin as observableForkJoin } from 'rxjs';
 
 import { ConfigOptionComponent } from '../../../../shared/components/config-option/config-option.component';
@@ -38,11 +37,10 @@ export class OsdPgScrubModalComponent {
     public activeModal: NgbActiveModal,
     private authStorageService: AuthStorageService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     this.osdPgScrubForm = new CdFormGroup({});
-    this.resource = this.i18n('PG scrub options');
+    this.resource = $localize`PG scrub options`;
     this.action = this.actionLabels.EDIT;
     this.permissions = this.authStorageService.getPermissions();
   }
@@ -58,7 +56,7 @@ export class OsdPgScrubModalComponent {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Updated PG scrub options')
+          $localize`Updated PG scrub options`
         );
         this.activeModal.close();
       },
index 5c08024a86b695cd8549106c3421d0a6b07a3402..c6351ea8a723875d72c56381f0c70007177f571b 100755 (executable)
@@ -8,7 +8,7 @@ import * as _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 import { of as observableOf } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { ConfigurationService } from '../../../../shared/api/configuration.service';
 import { SharedModule } from '../../../../shared/shared.module';
 import { OsdRecvSpeedModalComponent } from './osd-recv-speed-modal.component';
@@ -27,7 +27,7 @@ describe('OsdRecvSpeedModalComponent', () => {
       ToastrModule.forRoot()
     ],
     declarations: [OsdRecvSpeedModalComponent],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   let configOptions: any[] = [];
index 4eaffd27fbcdf59d42d1deb777f245d22f899738..f4b165b2eea8880976ec0f906ed18edb29a59b1a 100755 (executable)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { ConfigurationService } from '../../../../shared/api/configuration.service';
@@ -31,7 +30,6 @@ export class OsdRecvSpeedModalComponent implements OnInit {
     private authStorageService: AuthStorageService,
     private configService: ConfigurationService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     private osdService: OsdService
   ) {
     this.permissions = this.authStorageService.getPermissions();
@@ -42,28 +40,28 @@ export class OsdRecvSpeedModalComponent implements OnInit {
     });
     this.priorityAttrs = {
       osd_max_backfills: {
-        text: this.i18n('Max Backfills'),
+        text: $localize`Max Backfills`,
         desc: '',
         patternHelpText: '',
         maxValue: undefined,
         minValue: undefined
       },
       osd_recovery_max_active: {
-        text: this.i18n('Recovery Max Active'),
+        text: $localize`Recovery Max Active`,
         desc: '',
         patternHelpText: '',
         maxValue: undefined,
         minValue: undefined
       },
       osd_recovery_max_single_start: {
-        text: this.i18n('Recovery Max Single Start'),
+        text: $localize`Recovery Max Single Start`,
         desc: '',
         patternHelpText: '',
         maxValue: undefined,
         minValue: undefined
       },
       osd_recovery_sleep: {
-        text: this.i18n('Recovery Sleep'),
+        text: $localize`Recovery Sleep`,
         desc: '',
         patternHelpText: '',
         maxValue: undefined,
@@ -104,7 +102,7 @@ export class OsdRecvSpeedModalComponent implements OnInit {
     if (Object.entries(configOptionValues).length === 4) {
       this.osdRecvSpeedForm.controls.customizePriority.setValue(true);
       return callbackFn(
-        Object({ name: 'custom', text: this.i18n('Custom'), values: configOptionValues })
+        Object({ name: 'custom', text: $localize`Custom`, values: configOptionValues })
       );
     }
 
@@ -189,7 +187,7 @@ export class OsdRecvSpeedModalComponent implements OnInit {
     if (this.osdRecvSpeedForm.getValue('customizePriority')) {
       const customPriority = {
         name: 'custom',
-        text: this.i18n('Custom'),
+        text: $localize`Custom`,
         values: values
       };
       this.setPriority(customPriority);
@@ -224,9 +222,9 @@ export class OsdRecvSpeedModalComponent implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Updated OSD recovery speed priority '{{value}}'`, {
-            value: this.osdRecvSpeedForm.getValue('priority')
-          })
+          $localize`Updated OSD recovery speed priority '${this.osdRecvSpeedForm.getValue(
+            'priority'
+          )}'`
         );
         this.activeModal.close();
       },
index 7b98b6d0340dfbe5ea0bd570a597ab461b129294..abd92bbe01274221f11f4c04f7cd0e39cd9a4b48 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { OsdService } from '../../../../shared/api/osd.service';
 import { BackButtonComponent } from '../../../../shared/components/back-button/back-button.component';
 import { ModalComponent } from '../../../../shared/components/modal/modal.component';
@@ -26,7 +26,7 @@ describe('OsdReweightModalComponent', () => {
       SubmitButtonComponent,
       BackButtonComponent
     ],
-    providers: [OsdService, NgbActiveModal, CdFormBuilder, i18nProviders]
+    providers: [OsdService, NgbActiveModal, CdFormBuilder]
   });
 
   beforeEach(() => {
index a20df3bb3a24420f387c5172be6825abb3e0bc04..a2c2b1c879404b1b6e2dc81b79efb3bd63bb4fa6 100644 (file)
@@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { OsdService } from '../../../../shared/api/osd.service';
 import { JoinPipe } from '../../../../shared/pipes/join.pipe';
 import { NotificationService } from '../../../../shared/services/notification.service';
@@ -34,8 +34,7 @@ describe('OsdScrubModalComponent', () => {
       NgbActiveModal,
       JoinPipe,
       { provide: OsdService, useValue: fakeService },
-      { provide: NotificationService, useValue: fakeService },
-      i18nProviders
+      { provide: NotificationService, useValue: fakeService }
     ]
   });
 
index c23fb500537462630e744c7d7389347fc6b82360..e7306bfa66a6e56e74cb616aee055f9a6f7df662 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { FormGroup } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { forkJoin } from 'rxjs';
 
 import { OsdService } from '../../../../shared/api/osd.service';
@@ -24,7 +23,6 @@ export class OsdScrubModalComponent implements OnInit {
     public activeModal: NgbActiveModal,
     private osdService: OsdService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     private joinPipe: JoinPipe
   ) {}
 
@@ -39,10 +37,9 @@ export class OsdScrubModalComponent implements OnInit {
 
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('{{operation}} was initialized in the following OSD(s): {{id}}', {
-            operation: operation,
-            id: this.joinPipe.transform(this.selected)
-          })
+          $localize`${operation} was initialized in the following OSD(s): ${this.joinPipe.transform(
+            this.selected
+          )}`
         );
 
         this.activeModal.close();
index c551d599bb20d25721633820d4678cdbd799a614..558473d2204fc7df67dd3ff5bb330429a5c472cd 100644 (file)
@@ -6,11 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../../testing/unit-test-helper';
 import { CoreModule } from '../../../../core/core.module';
 import { TableActionsComponent } from '../../../../shared/datatable/table-actions/table-actions.component';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -35,9 +31,7 @@ describe('ActiveAlertListComponent', () => {
       DashboardModule,
       CephModule,
       CoreModule
-    ],
-    declarations: [],
-    providers: [i18nProviders]
+    ]
   });
 
   beforeEach(() => {
index bcd1f006aa0b61358c7a0914ce07e79cafe0241d..7c0e437d7a2eba0ffc91b855aa562c9c301ecb75 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, Inject, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { PrometheusService } from '../../../../shared/api/prometheus.service';
 import { CellTemplate } from '../../../../shared/enum/cell-template.enum';
 import { Icons } from '../../../../shared/enum/icons.enum';
@@ -44,7 +42,6 @@ export class ActiveAlertListComponent extends PrometheusListHelper implements On
     private authStorageService: AuthStorageService,
     public prometheusAlertService: PrometheusAlertService,
     private urlBuilder: URLBuilderService,
-    private i18n: I18n,
     private cdDatePipe: CdDatePipe,
     @Inject(PrometheusService) prometheusService: PrometheusService,
     @Inject(SummaryService) summaryService: SummaryService,
@@ -61,7 +58,7 @@ export class ActiveAlertListComponent extends PrometheusListHelper implements On
         icon: Icons.add,
         routerLink: () =>
           '/monitoring' + this.urlBuilder.getCreateFrom(this.selection.first().fingerprint),
-        name: this.i18n('Create Silence')
+        name: $localize`Create Silence`
       }
     ];
   }
@@ -70,31 +67,31 @@ export class ActiveAlertListComponent extends PrometheusListHelper implements On
     super.ngOnInit();
     this.columns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'labels.alertname',
         flexGrow: 2
       },
       {
-        name: this.i18n('Job'),
+        name: $localize`Job`,
         prop: 'labels.job',
         flexGrow: 2
       },
       {
-        name: this.i18n('Severity'),
+        name: $localize`Severity`,
         prop: 'labels.severity'
       },
       {
-        name: this.i18n('State'),
+        name: $localize`State`,
         prop: 'status.state',
         cellTransformation: CellTemplate.classAdding
       },
       {
-        name: this.i18n('Started'),
+        name: $localize`Started`,
         prop: 'startsAt',
         pipe: this.cdDatePipe
       },
       {
-        name: this.i18n('URL'),
+        name: $localize`URL`,
         prop: 'generatorURL',
         sortable: false,
         cellTemplate: this.externalLinkTpl
index 1c1c53486aab163018922e1abaede18c3dd7924b..5f1b294f2dd6b1ee2b573c7cbfbf6bf5a80c827f 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { PrometheusService } from '../../../../shared/api/prometheus.service';
 import { SettingsService } from '../../../../shared/api/settings.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -25,7 +25,7 @@ describe('RulesListComponent', () => {
       RouterTestingModule,
       ToastrModule.forRoot()
     ],
-    providers: [PrometheusService, SettingsService, i18nProviders]
+    providers: [PrometheusService, SettingsService]
   });
 
   beforeEach(() => {
index 809d7703df8e8e4aa4c38e6c391dace26dbf0080..e98aaabe74c0adcf1f0bf8fbd2ca2d9bf794723d 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, Inject, OnInit } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { PrometheusService } from '../../../../shared/api/prometheus.service';
 import { CdTableColumn } from '../../../../shared/models/cd-table-column';
 import { PrometheusRule } from '../../../../shared/models/prometheus-alerts';
@@ -28,7 +26,6 @@ export class RulesListComponent extends PrometheusListHelper implements OnInit {
   hideKeys = ['alerts', 'type'];
 
   constructor(
-    private i18n: I18n,
     public prometheusAlertService: PrometheusAlertService,
     @Inject(PrometheusService) prometheusService: PrometheusService,
     @Inject(SummaryService) summaryService: SummaryService,
@@ -40,12 +37,12 @@ export class RulesListComponent extends PrometheusListHelper implements OnInit {
   ngOnInit() {
     super.ngOnInit();
     this.columns = [
-      { prop: 'name', name: this.i18n('Name') },
-      { prop: 'labels.severity', name: this.i18n('Severity') },
-      { prop: 'group', name: this.i18n('Group') },
-      { prop: 'duration', name: this.i18n('Duration'), pipe: new DurationPipe() },
-      { prop: 'query', name: this.i18n('Query'), isHidden: true },
-      { prop: 'annotations.description', name: this.i18n('Description') }
+      { prop: 'name', name: $localize`Name` },
+      { prop: 'labels.severity', name: $localize`Severity` },
+      { prop: 'group', name: $localize`Group` },
+      { prop: 'duration', name: $localize`Duration`, pipe: new DurationPipe() },
+      { prop: 'query', name: $localize`Query`, isHidden: true },
+      { prop: 'annotations.description', name: $localize`Description` }
     ];
   }
 }
index 365fcf1f74a4a8fb5d35231997964c4172ebfb58..ee3d5e956e36410d82cbc6c2e0d2d5e3ad0f2cc1 100644 (file)
@@ -14,7 +14,6 @@ import {
   configureTestBed,
   FixtureHelper,
   FormHelper,
-  i18nProviders,
   PrometheusHelper
 } from '../../../../../testing/unit-test-helper';
 import { NotFoundComponent } from '../../../../core/not-found/not-found.component';
@@ -64,7 +63,6 @@ describe('SilenceFormComponent', () => {
       ReactiveFormsModule
     ],
     providers: [
-      i18nProviders,
       {
         provide: ActivatedRoute,
         useValue: { params: { subscribe: (fn: Function) => fn(params) } }
index aa241505c85ccdb1c74ab0fc4a8647b4d6d0a5cf..0212ac0ebf299d9dab46928a41ce28fda80593f4 100644 (file)
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
 import { Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import * as moment from 'moment';
 
@@ -46,23 +45,23 @@ export class SilenceFormComponent {
   id: string;
 
   action: string;
-  resource = this.i18n('silence');
+  resource = $localize`silence`;
 
   matchers: AlertmanagerSilenceMatcher[] = [];
   matcherMatch: AlertmanagerSilenceMatcherMatch = undefined;
   matcherConfig = [
     {
-      tooltip: this.i18n('Attribute name'),
+      tooltip: $localize`Attribute name`,
       icon: this.icons.paragraph,
       attribute: 'name'
     },
     {
-      tooltip: this.i18n('Value'),
+      tooltip: $localize`Value`,
       icon: this.icons.terminal,
       attribute: 'value'
     },
     {
-      tooltip: this.i18n('Regular expression'),
+      tooltip: $localize`Regular expression`,
       icon: this.icons.magic,
       attribute: 'isRegex'
     }
@@ -71,7 +70,6 @@ export class SilenceFormComponent {
   datetimeFormat = 'YYYY-MM-DD HH:mm';
 
   constructor(
-    private i18n: I18n,
     private router: Router,
     private authStorageService: AuthStorageService,
     private formBuilder: CdFormBuilder,
@@ -206,9 +204,7 @@ export class SilenceFormComponent {
         this.rules = [];
         this.notificationService.show(
           NotificationType.info,
-          this.i18n(
-            'Please add your Prometheus host to the dashboard configuration and refresh the page'
-          ),
+          $localize`Please add your Prometheus host to the dashboard configuration and refresh the page`,
           undefined,
           undefined,
           'Prometheus'
index c428f7ca4b4701a3906fac158b248b34cd318102..a5e1a250bc6e5c2b8e7231c809be79a8ba847243 100644 (file)
@@ -7,11 +7,7 @@ import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../../testing/unit-test-helper';
 import { PrometheusService } from '../../../../shared/api/prometheus.service';
 import { CriticalConfirmationModalComponent } from '../../../../shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
 import { TableActionsComponent } from '../../../../shared/datatable/table-actions/table-actions.component';
@@ -36,8 +32,7 @@ describe('SilenceListComponent', () => {
       HttpClientTestingModule,
       NgbNavModule
     ],
-    declarations: [SilenceListComponent, PrometheusTabsComponent],
-    providers: [i18nProviders]
+    declarations: [SilenceListComponent, PrometheusTabsComponent]
   });
 
   beforeEach(() => {
index daba3e2a8d61c30109807201835f951e8a03281c..af48f5fdba69f3f5d32d279689be5df5752ce902 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, Inject } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { SortDirection, SortPropDir } from '@swimlane/ngx-datatable';
 import { Observable, Subscriber } from 'rxjs';
 
@@ -52,7 +51,6 @@ export class SilenceListComponent extends PrometheusListHelper {
 
   constructor(
     private authStorageService: AuthStorageService,
-    private i18n: I18n,
     private cdDatePipe: CdDatePipe,
     private modalService: ModalService,
     private notificationService: NotificationService,
@@ -116,32 +114,32 @@ export class SilenceListComponent extends PrometheusListHelper {
     ];
     this.columns = [
       {
-        name: this.i18n('ID'),
+        name: $localize`ID`,
         prop: 'id',
         flexGrow: 3
       },
       {
-        name: this.i18n('Created by'),
+        name: $localize`Created by`,
         prop: 'createdBy',
         flexGrow: 2
       },
       {
-        name: this.i18n('Started'),
+        name: $localize`Started`,
         prop: 'startsAt',
         pipe: this.cdDatePipe
       },
       {
-        name: this.i18n('Updated'),
+        name: $localize`Updated`,
         prop: 'updatedAt',
         pipe: this.cdDatePipe
       },
       {
-        name: this.i18n('Ends'),
+        name: $localize`Ends`,
         prop: 'endsAt',
         pipe: this.cdDatePipe
       },
       {
-        name: this.i18n('Status'),
+        name: $localize`Status`,
         prop: 'status.state',
         cellTransformation: CellTemplate.classAdding
       }
@@ -167,7 +165,7 @@ export class SilenceListComponent extends PrometheusListHelper {
 
   expireSilence() {
     const id = this.selection.first().id;
-    const i18nSilence = this.i18n('Silence');
+    const i18nSilence = $localize`Silence`;
     const applicationName = 'Prometheus';
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       itemDescription: i18nSilence,
index 08d408fbac1f7b37c14c5ec2a55b6bd8ae0c1e98..c888fb5bb60a1b223625bd0bc0e15ba9704ebe96 100644 (file)
@@ -11,7 +11,6 @@ import {
   configureTestBed,
   FixtureHelper,
   FormHelper,
-  i18nProviders,
   PrometheusHelper
 } from '../../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -34,7 +33,7 @@ describe('SilenceMatcherModalComponent', () => {
       RouterTestingModule,
       ReactiveFormsModule
     ],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index 20683f0d2849a924eb4e268acd2c6d2fd5170daa..23fe095088956cbfd4b7ce24df8adcb0dd4a87b1 100644 (file)
@@ -4,7 +4,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import * as _ from 'lodash';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { CoreModule } from '../../../../core/core.module';
 import { CephServiceService } from '../../../../shared/api/ceph-service.service';
 import { HostService } from '../../../../shared/api/host.service';
@@ -77,9 +77,7 @@ describe('ServiceDaemonListComponent', () => {
   };
 
   configureTestBed({
-    imports: [HttpClientTestingModule, CephModule, CoreModule, SharedModule],
-    declarations: [],
-    providers: [i18nProviders]
+    imports: [HttpClientTestingModule, CephModule, CoreModule, SharedModule]
   });
 
   beforeEach(() => {
index e27580132972f0feea3598d1e230d440de1dbafb..16c23f3b5790f4467f473d1ce1f21b04303f01db 100644 (file)
@@ -11,7 +11,6 @@ import {
   ViewChildren
 } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { Observable, Subscription } from 'rxjs';
 
@@ -51,7 +50,6 @@ export class ServiceDaemonListComponent implements OnInit, OnChanges, AfterViewI
   private daemonsTableTplsSub: Subscription;
 
   constructor(
-    private i18n: I18n,
     private hostService: HostService,
     private cephServiceService: CephServiceService,
     private orchService: OrchestratorService
@@ -60,25 +58,25 @@ export class ServiceDaemonListComponent implements OnInit, OnChanges, AfterViewI
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Hostname'),
+        name: $localize`Hostname`,
         prop: 'hostname',
         flexGrow: 1,
         filterable: true
       },
       {
-        name: this.i18n('Daemon type'),
+        name: $localize`Daemon type`,
         prop: 'daemon_type',
         flexGrow: 1,
         filterable: true
       },
       {
-        name: this.i18n('Daemon ID'),
+        name: $localize`Daemon ID`,
         prop: 'daemon_id',
         flexGrow: 1,
         filterable: true
       },
       {
-        name: this.i18n('Container ID'),
+        name: $localize`Container ID`,
         prop: 'container_id',
         flexGrow: 3,
         filterable: true,
@@ -88,13 +86,13 @@ export class ServiceDaemonListComponent implements OnInit, OnChanges, AfterViewI
         }
       },
       {
-        name: this.i18n('Container Image name'),
+        name: $localize`Container Image name`,
         prop: 'container_image_name',
         flexGrow: 3,
         filterable: true
       },
       {
-        name: this.i18n('Container Image ID'),
+        name: $localize`Container Image ID`,
         prop: 'container_image_id',
         flexGrow: 3,
         filterable: true,
@@ -104,20 +102,20 @@ export class ServiceDaemonListComponent implements OnInit, OnChanges, AfterViewI
         }
       },
       {
-        name: this.i18n('Version'),
+        name: $localize`Version`,
         prop: 'version',
         flexGrow: 1,
         filterable: true
       },
       {
-        name: this.i18n('Status'),
+        name: $localize`Status`,
         prop: 'status_desc',
         flexGrow: 1,
         filterable: true,
         cellTemplate: this.statusTpl
       },
       {
-        name: this.i18n('Last Refreshed'),
+        name: $localize`Last Refreshed`,
         prop: 'last_refresh',
         flexGrow: 2
       }
index 1faa2bed8451e04bf699218e6d243944e332ef5a..ea65965a85c18c18683a163a6f0f5f30e0b24c19 100644 (file)
@@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
 import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
 import { SummaryService } from '../../../../shared/services/summary.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -18,15 +18,7 @@ describe('ServiceDetailsComponent', () => {
   configureTestBed({
     imports: [HttpClientTestingModule, RouterTestingModule, SharedModule, NgbNavModule],
     declarations: [ServiceDetailsComponent, ServiceDaemonListComponent],
-    providers: [
-      i18nProviders,
-      {
-        provide: SummaryService,
-        useValue: {
-          subscribeOnce: jest.fn()
-        }
-      }
-    ]
+    providers: [{ provide: SummaryService, useValue: { subscribeOnce: jest.fn() } }]
   });
 
   beforeEach(() => {
index 6a2f4d34377de99c35934ffdb130d92eadbf6fa7..b007f1ee097bc3a9261f128e9f0aa87d0dbe397a 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { CoreModule } from '../../../core/core.module';
 import { CephServiceService } from '../../../shared/api/ceph-service.service';
 import { OrchestratorService } from '../../../shared/api/orchestrator.service';
@@ -60,8 +60,7 @@ describe('ServicesComponent', () => {
       HttpClientTestingModule,
       RouterTestingModule
     ],
-    providers: [{ provide: AuthStorageService, useValue: fakeAuthStorageService }, i18nProviders],
-    declarations: []
+    providers: [{ provide: AuthStorageService, useValue: fakeAuthStorageService }]
   });
 
   beforeEach(() => {
index 4f23794f24467544d315a95c52cbe02424b8ff6b..4f83b0c944ca2a63e276efd5cfe3b94b5e36b6ee 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { CephServiceService } from '../../../shared/api/ceph-service.service';
 import { OrchestratorService } from '../../../shared/api/orchestrator.service';
 import { ListWithDetails } from '../../../shared/classes/list-with-details.class';
@@ -41,7 +39,6 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
 
   constructor(
     private authStorageService: AuthStorageService,
-    private i18n: I18n,
     private orchService: OrchestratorService,
     private cephServiceService: CephServiceService
   ) {
@@ -52,17 +49,17 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
   ngOnInit() {
     const columns = [
       {
-        name: this.i18n('Service'),
+        name: $localize`Service`,
         prop: 'service_name',
         flexGrow: 1
       },
       {
-        name: this.i18n('Container image name'),
+        name: $localize`Container image name`,
         prop: 'status.container_image_name',
         flexGrow: 3
       },
       {
-        name: this.i18n('Container image ID'),
+        name: $localize`Container image ID`,
         prop: 'status.container_image_id',
         flexGrow: 3,
         cellTransformation: CellTemplate.truncate,
@@ -71,19 +68,19 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
         }
       },
       {
-        name: this.i18n('Running'),
+        name: $localize`Running`,
         prop: 'status.running',
         flexGrow: 1,
         cellClass: 'text-center',
         cellTransformation: CellTemplate.checkIcon
       },
       {
-        name: this.i18n('Size'),
+        name: $localize`Size`,
         prop: 'status.size',
         flexGrow: 1
       },
       {
-        name: this.i18n('Last Refreshed'),
+        name: $localize`Last Refreshed`,
         prop: 'status.last_refresh',
         flexGrow: 1
       }
index 0f0133512b07706eb461cc3297391e78e1ad6645..5ffb046cf16aaea210d35f30e75ecfa7d54be3c7 100644 (file)
@@ -8,7 +8,7 @@ import * as _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 import { of as observableOf } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { MgrModuleService } from '../../../shared/api/mgr-module.service';
 import { TelemetryService } from '../../../shared/api/telemetry.service';
 import { LoadingPanelComponent } from '../../../shared/components/loading-panel/loading-panel.component';
@@ -56,8 +56,7 @@ describe('TelemetryComponent', () => {
         RouterTestingModule,
         SharedModule,
         ToastrModule.forRoot()
-      ],
-      providers: i18nProviders
+      ]
     },
     [LoadingPanelComponent]
   );
index 40c00795e3696b60254d2b0aa062b35f4cc52bce..2abbade4847ebf89a57a83eed1252fd2348e7994 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { ValidatorFn, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin as observableForkJoin } from 'rxjs';
 
@@ -50,7 +49,6 @@ export class TelemetryComponent extends CdForm implements OnInit {
     private notificationService: NotificationService,
     private router: Router,
     private telemetryService: TelemetryService,
-    private i18n: I18n,
     private textToDownloadService: TextToDownloadService,
     private telemetryNotificationService: TelemetryNotificationService
   ) {
@@ -151,11 +149,9 @@ export class TelemetryComponent extends CdForm implements OnInit {
     this.mgrModuleService.updateConfig('telemetry', config).subscribe(
       () => {
         this.disableModule(
-          this.i18n(
-            `Your settings have been applied successfully. \
-Due to privacy/legal reasons the Telemetry module is now disabled until you \
-complete the next step and accept the license.`
-          ),
+          $localize`Your settings have been applied successfully. \
+ Due to privacy/legal reasons the Telemetry module is now disabled until you \
+ complete the next step and accept the license.`,
           () => {
             this.getReport();
           }
@@ -203,7 +199,7 @@ complete the next step and accept the license.`
       this.telemetryNotificationService.setVisibility(false);
       this.notificationService.show(
         NotificationType.success,
-        this.i18n('The Telemetry module has been configured and activated successfully.')
+        $localize`The Telemetry module has been configured and activated successfully.`
       );
       this.router.navigate(['']);
     });
index 6728b41d3a184d26271baf8f76689616f0c28467..24fa1b5b33804faa85879fafcb9b54735079506c 100644 (file)
@@ -6,7 +6,7 @@ import { By } from '@angular/platform-browser';
 import * as _ from 'lodash';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { HealthService } from '../../../shared/api/health.service';
 import { Permissions } from '../../../shared/models/permissions';
 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
@@ -59,7 +59,6 @@ describe('HealthComponent', () => {
     ],
     schemas: [NO_ERRORS_SCHEMA],
     providers: [
-      i18nProviders,
       { provide: AuthStorageService, useValue: fakeAuthStorageService },
       PgCategoryService,
       RefreshIntervalService
index 6089f4faef30ed2f1220abfc3d8fa0a3ebd88036..8268d1320fe0c1109dd2d9656833f7373f2985d1 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, OnDestroy, OnInit } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { Subscription } from 'rxjs';
 
@@ -65,7 +64,6 @@ export class HealthComponent implements OnInit, OnDestroy {
 
   constructor(
     private healthService: HealthService,
-    private i18n: I18n,
     private authStorageService: AuthStorageService,
     private pgCategoryService: PgCategoryService,
     private featureToggles: FeatureTogglesService,
@@ -101,14 +99,14 @@ export class HealthComponent implements OnInit, OnDestroy {
       this.healthData.client_perf.write_op_per_sec + this.healthData.client_perf.read_op_per_sec;
 
     ratioLabels.push(
-      `${this.i18n('Writes')} (${this.calcPercentage(
+      `${$localize`Writes`} (${this.calcPercentage(
         this.healthData.client_perf.write_op_per_sec,
         total
       )}%)`
     );
     ratioData.push(this.healthData.client_perf.write_op_per_sec);
     ratioLabels.push(
-      `${this.i18n('Reads')} (${this.calcPercentage(
+      `${$localize`Reads`} (${this.calcPercentage(
         this.healthData.client_perf.read_op_per_sec,
         total
       )}%)`
@@ -132,17 +130,17 @@ export class HealthComponent implements OnInit, OnDestroy {
     chart.dataset[0].data = [data.df.stats.total_used_raw_bytes, data.df.stats.total_avail_bytes];
 
     chart.labels = [
-      `${this.dimlessBinary.transform(data.df.stats.total_used_raw_bytes)} ${this.i18n(
-        'Used'
-      )} (${percentUsed}%)`,
-      `${this.dimlessBinary.transform(
+      $localize`${this.dimlessBinary.transform(
+        data.df.stats.total_used_raw_bytes
+      )} Used (${percentUsed}%)`,
+      $localize`${this.dimlessBinary.transform(
         data.df.stats.total_bytes - data.df.stats.total_used_raw_bytes
-      )} ${this.i18n('Avail.')} (${percentAvailable}%)`
+      )} Avail. (${percentAvailable}%)`
     ];
 
     chart.options.title.text = `${this.dimlessBinary.transform(
       data.df.stats.total_bytes
-    )} ${this.i18n('total')}`;
+    )} ${$localize`total`}`;
   }
 
   preparePgStatus(chart: Record<string, any>, data: Record<string, any>) {
@@ -164,10 +162,10 @@ export class HealthComponent implements OnInit, OnDestroy {
       .map((categoryType) => categoryPgAmount[categoryType]);
 
     chart.labels = [
-      `${this.i18n('Clean')} (${this.calcPercentage(categoryPgAmount['clean'], totalPgs)}%)`,
-      `${this.i18n('Working')} (${this.calcPercentage(categoryPgAmount['working'], totalPgs)}%)`,
-      `${this.i18n('Warning')} (${this.calcPercentage(categoryPgAmount['warning'], totalPgs)}%)`,
-      `${this.i18n('Unknown')} (${this.calcPercentage(categoryPgAmount['unknown'], totalPgs)}%)`
+      `${$localize`Clean`} (${this.calcPercentage(categoryPgAmount['clean'], totalPgs)}%)`,
+      `${$localize`Working`} (${this.calcPercentage(categoryPgAmount['working'], totalPgs)}%)`,
+      `${$localize`Warning`} (${this.calcPercentage(categoryPgAmount['warning'], totalPgs)}%)`,
+      `${$localize`Unknown`} (${this.calcPercentage(categoryPgAmount['unknown'], totalPgs)}%)`
     ];
   }
 
@@ -180,16 +178,16 @@ export class HealthComponent implements OnInit, OnDestroy {
       data.pg_info.object_stats.num_objects_unfound;
 
     chart.labels = [
-      `${this.i18n('Healthy')} (${this.calcPercentage(healthy, totalReplicas)}%)`,
-      `${this.i18n('Misplaced')} (${this.calcPercentage(
+      `${$localize`Healthy`} (${this.calcPercentage(healthy, totalReplicas)}%)`,
+      `${$localize`Misplaced`} (${this.calcPercentage(
         data.pg_info.object_stats.num_objects_misplaced,
         totalReplicas
       )}%)`,
-      `${this.i18n('Degraded')} (${this.calcPercentage(
+      `${$localize`Degraded`} (${this.calcPercentage(
         data.pg_info.object_stats.num_objects_degraded,
         totalReplicas
       )}%)`,
-      `${this.i18n('Unfound')} (${this.calcPercentage(
+      `${$localize`Unfound`} (${this.calcPercentage(
         data.pg_info.object_stats.num_objects_unfound,
         totalReplicas
       )}%)`
@@ -204,7 +202,7 @@ export class HealthComponent implements OnInit, OnDestroy {
 
     chart.options.title.text = `${this.dimless.transform(
       data.pg_info.object_stats.num_objects
-    )} ${this.i18n('total')} (${this.dimless.transform(totalReplicas)} ${this.i18n('replicas')})`;
+    )} ${$localize`total`} (${this.dimless.transform(totalReplicas)} ${$localize`replicas`})`;
 
     chart.options.maintainAspectRatio = window.innerWidth >= 375;
   }
index 32e05b04114468f9f9611da29f79ab38b3d6772e..68d951bd01c2769d2b1ba1569966a8e05c8db855 100644 (file)
@@ -1,13 +1,13 @@
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { MdsSummaryPipe } from './mds-summary.pipe';
 
 describe('MdsSummaryPipe', () => {
   let pipe: MdsSummaryPipe;
 
   configureTestBed({
-    providers: [MdsSummaryPipe, i18nProviders]
+    providers: [MdsSummaryPipe]
   });
 
   beforeEach(() => {
index 7bd1014d8de06aa9b3d22a5c0fce2e02156f8b09..68853cb0bee04b8a07800987dbef28a12c350536 100644 (file)
@@ -1,14 +1,11 @@
 import { Pipe, PipeTransform } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 @Pipe({
   name: 'mdsSummary'
 })
 export class MdsSummaryPipe implements PipeTransform {
-  constructor(private i18n: I18n) {}
-
   transform(value: any): any {
     if (!value) {
       return '';
@@ -24,10 +21,10 @@ export class MdsSummaryPipe implements PipeTransform {
     });
 
     if (value.standbys && !value.filesystems) {
-      contentLine1 = `${standbys} ${this.i18n('up')}`;
-      contentLine2 = this.i18n('no filesystems');
+      contentLine1 = `${standbys} ${$localize`up`}`;
+      contentLine2 = $localize`no filesystems`;
     } else if (value.filesystems.length === 0) {
-      contentLine1 = this.i18n('no filesystems');
+      contentLine1 = $localize`no filesystems`;
     } else {
       _.each(value.filesystems, (fs) => {
         _.each(fs.mdsmap.info, (mds) => {
@@ -39,24 +36,22 @@ export class MdsSummaryPipe implements PipeTransform {
         });
       });
 
-      contentLine1 = `${active} ${this.i18n('active')}`;
-      contentLine2 = `${standbys + standbyReplay} ${this.i18n('standby')}`;
+      contentLine1 = `${active} ${$localize`active`}`;
+      contentLine2 = `${standbys + standbyReplay} ${$localize`standby`}`;
     }
     const standbyHoverText = value.standbys.map((s: any): string => s.name).join(', ');
     const standbyTitleText = !standbyHoverText
       ? ''
-      : `${this.i18n('standby daemons')}: ${standbyHoverText}`;
+      : `${$localize`standby daemons`}: ${standbyHoverText}`;
     const fsLength = value.filesystems ? value.filesystems.length : 0;
     const infoObject = fsLength > 0 ? value.filesystems[0].mdsmap.info : {};
     const activeHoverText = Object.values(infoObject)
       .map((info: any): string => info.name)
       .join(', ');
-    let activeTitleText = !activeHoverText
-      ? ''
-      : `${this.i18n('active daemon')}: ${activeHoverText}`;
+    let activeTitleText = !activeHoverText ? '' : `${$localize`active daemon`}: ${activeHoverText}`;
     // There is always one standbyreplay to replace active daemon, if active one is down
     if (!active && fsLength > 0) {
-      activeTitleText = `${standbyReplay} ${this.i18n('standbyReplay')}`;
+      activeTitleText = `${standbyReplay} ${$localize`standbyReplay`}`;
     }
     const mgrSummary = [
       {
index 84dea63359253c276a29afe5714472e5784f1bd3..a81530c54d804d6a42d6214c036d19fc76421bf8 100644 (file)
@@ -1,13 +1,13 @@
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { MgrSummaryPipe } from './mgr-summary.pipe';
 
 describe('MgrSummaryPipe', () => {
   let pipe: MgrSummaryPipe;
 
   configureTestBed({
-    providers: [MgrSummaryPipe, i18nProviders]
+    providers: [MgrSummaryPipe]
   });
 
   beforeEach(() => {
index c99cd864635be19d02141292662e8b69e2b23788..286d5dd337f6adb4963e9e8aafcf647b1d2daa2b 100644 (file)
@@ -1,23 +1,20 @@
 import { Pipe, PipeTransform } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 @Pipe({
   name: 'mgrSummary'
 })
 export class MgrSummaryPipe implements PipeTransform {
-  constructor(private i18n: I18n) {}
-
   transform(value: any): any {
     if (!value) {
       return '';
     }
 
-    let activeCount = this.i18n('n/a');
+    let activeCount = $localize`n/a`;
     const activeTitleText = _.isUndefined(value.active_name)
       ? ''
-      : `${this.i18n('active daemon')}: ${value.active_name}`;
+      : `${$localize`active daemon`}: ${value.active_name}`;
     // There is always one standbyreplay to replace active daemon, if active one is down
     if (activeTitleText.length > 0) {
       activeCount = '1';
@@ -25,11 +22,11 @@ export class MgrSummaryPipe implements PipeTransform {
     const standbyHoverText = value.standbys.map((s: any): string => s.name).join(', ');
     const standbyTitleText = !standbyHoverText
       ? ''
-      : `${this.i18n('standby daemons')}: ${standbyHoverText}`;
+      : `${$localize`standby daemons`}: ${standbyHoverText}`;
     const standbyCount = value.standbys.length;
     const mgrSummary = [
       {
-        content: `${activeCount} ${this.i18n('active')}`,
+        content: `${activeCount} ${$localize`active`}`,
         class: 'popover-info',
         titleText: activeTitleText
       }
@@ -41,7 +38,7 @@ export class MgrSummaryPipe implements PipeTransform {
       titleText: ''
     });
     mgrSummary.push({
-      content: `${standbyCount} ${this.i18n('standby')}`,
+      content: `${standbyCount} ${$localize`standby`}`,
       class: 'popover-info',
       titleText: standbyTitleText
     });
index 5d64cd6c91e8e6217a6f29ea1ec2f8c2ec854f91..153746741906bfe8aacbffba4142f317e304817f 100644 (file)
@@ -1,13 +1,13 @@
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { MonSummaryPipe } from './mon-summary.pipe';
 
 describe('MonSummaryPipe', () => {
   let pipe: MonSummaryPipe;
 
   configureTestBed({
-    providers: [MonSummaryPipe, i18nProviders]
+    providers: [MonSummaryPipe]
   });
 
   beforeEach(() => {
index 31339f52e292e7fa517974e57f90481e16d1c69b..399045d5de32e36c2c4d361ef0f4b1e82e8d0f88 100644 (file)
@@ -1,21 +1,16 @@
 import { Pipe, PipeTransform } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 @Pipe({
   name: 'monSummary'
 })
 export class MonSummaryPipe implements PipeTransform {
-  constructor(private i18n: I18n) {}
-
   transform(value: any): any {
     if (!value) {
       return '';
     }
 
-    const result = `${value.monmap.mons.length.toString()} (${this.i18n(
-      'quorum'
-    )} ${value.quorum.join(', ')})`;
+    const result = $localize`${value.monmap.mons.length.toString()} (quorum \
+${value.quorum.join(', ')})`;
 
     return result;
   }
index 20914d52a553224fc6158e96d730bacf104011c6..13456e263430051e3768ffaa1189fc007501617c 100644 (file)
@@ -1,13 +1,13 @@
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { OsdSummaryPipe } from './osd-summary.pipe';
 
 describe('OsdSummaryPipe', () => {
   let pipe: OsdSummaryPipe;
 
   configureTestBed({
-    providers: [OsdSummaryPipe, i18nProviders]
+    providers: [OsdSummaryPipe]
   });
 
   beforeEach(() => {
index c007c313cf32c780a995fd1a78d9095088ca7dcf..05fc7ad7f80c62458c90e4b69d16715f7c9edd31 100644 (file)
@@ -1,14 +1,11 @@
 import { Pipe, PipeTransform } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 @Pipe({
   name: 'osdSummary'
 })
 export class OsdSummaryPipe implements PipeTransform {
-  constructor(private i18n: I18n) {}
-
   transform(value: any): any {
     if (!value) {
       return '';
@@ -27,7 +24,7 @@ export class OsdSummaryPipe implements PipeTransform {
 
     const osdSummary = [
       {
-        content: `${value.osds.length} ${this.i18n('total')}`,
+        content: `${value.osds.length} ${$localize`total`}`,
         class: ''
       }
     ];
@@ -36,7 +33,7 @@ export class OsdSummaryPipe implements PipeTransform {
       class: 'card-text-line-break'
     });
     osdSummary.push({
-      content: `${upCount} ${this.i18n('up')}, ${inCount} ${this.i18n('in')}`,
+      content: `${upCount} ${$localize`up`}, ${inCount} ${$localize`in`}`,
       class: ''
     });
 
@@ -48,9 +45,9 @@ export class OsdSummaryPipe implements PipeTransform {
         class: 'card-text-line-break'
       });
 
-      const downText = downCount > 0 ? `${downCount} ${this.i18n('down')}` : '';
+      const downText = downCount > 0 ? `${downCount} ${$localize`down`}` : '';
       const separator = downCount > 0 && outCount > 0 ? ', ' : '';
-      const outText = outCount > 0 ? `${outCount} ${this.i18n('out')}` : '';
+      const outText = outCount > 0 ? `${outCount} ${$localize`out`}` : '';
       osdSummary.push({
         content: `${downText}${separator}${outText}`,
         class: 'card-text-error'
index bde06ba857b8a2466aebbff94cf17f98c10589d7..cec861ba47f3c541634a0ca8af31a19eff9c9599 100644 (file)
@@ -2,7 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { Nfs501Component } from './nfs-501.component';
 
@@ -12,8 +12,7 @@ describe('Nfs501Component', () => {
 
   configureTestBed({
     declarations: [Nfs501Component],
-    imports: [HttpClientTestingModule, RouterTestingModule, SharedModule],
-    providers: i18nProviders
+    imports: [HttpClientTestingModule, RouterTestingModule, SharedModule]
   });
 
   beforeEach(() => {
index 985b3b3f531de656c49d10b758f53b8e8eca8e02..4654a5ca5c6b523915346d572d5fc1bb65c82d07 100644 (file)
@@ -1,8 +1,6 @@
 import { Component, OnDestroy, OnInit } from '@angular/core';
 import { ActivatedRoute } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
 import { SummaryService } from '../../../shared/services/summary.service';
 
@@ -13,14 +11,13 @@ import { SummaryService } from '../../../shared/services/summary.service';
 })
 export class Nfs501Component implements OnInit, OnDestroy {
   docsUrl: string;
-  message = this.i18n('The NFS Ganesha service is not configured.');
+  message = $localize`The NFS Ganesha service is not configured.`;
   routeParamsSubscribe: any;
 
   constructor(
     private route: ActivatedRoute,
     private summaryService: SummaryService,
-    private cephReleaseNamePipe: CephReleaseNamePipe,
-    private i18n: I18n
+    private cephReleaseNamePipe: CephReleaseNamePipe
   ) {}
 
   ngOnInit() {
index 9b8f7da73e043180fb63ea5535c5132966c413f8..2411aa22efff2e12c53f886182517b94b4013969 100644 (file)
@@ -6,7 +6,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import * as _ from 'lodash';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { NfsDetailsComponent } from './nfs-details.component';
 
@@ -18,8 +18,7 @@ describe('NfsDetailsComponent', () => {
 
   configureTestBed({
     declarations: [NfsDetailsComponent],
-    imports: [BrowserAnimationsModule, SharedModule, HttpClientTestingModule, NgbNavModule],
-    providers: i18nProviders
+    imports: [BrowserAnimationsModule, SharedModule, HttpClientTestingModule, NgbNavModule]
   });
 
   beforeEach(() => {
index c6a3ba0eca905cf61642305ec748bbbdca88afe1..a7760400f0962ac2228a3d892c20e78e11b11f2c 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, Input, OnChanges } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { CdTableColumn } from '../../../shared/models/cd-table-column';
 
 @Component({
@@ -19,20 +17,20 @@ export class NfsDetailsComponent implements OnChanges {
   clientsColumns: CdTableColumn[];
   clients: any[] = [];
 
-  constructor(private i18n: I18n) {
+  constructor() {
     this.clientsColumns = [
       {
-        name: this.i18n('Addresses'),
+        name: $localize`Addresses`,
         prop: 'addresses',
         flexGrow: 2
       },
       {
-        name: this.i18n('Access Type'),
+        name: $localize`Access Type`,
         prop: 'access_type',
         flexGrow: 1
       },
       {
-        name: this.i18n('Squash'),
+        name: $localize`Squash`,
         prop: 'squash',
         flexGrow: 1
       }
@@ -46,25 +44,25 @@ export class NfsDetailsComponent implements OnChanges {
       this.clients = this.selectedItem.clients;
 
       this.data = {};
-      this.data[this.i18n('Cluster')] = this.selectedItem.cluster_id;
-      this.data[this.i18n('Daemons')] = this.selectedItem.daemons;
-      this.data[this.i18n('NFS Protocol')] = this.selectedItem.protocols.map(
+      this.data[$localize`Cluster`] = this.selectedItem.cluster_id;
+      this.data[$localize`Daemons`] = this.selectedItem.daemons;
+      this.data[$localize`NFS Protocol`] = this.selectedItem.protocols.map(
         (protocol: string) => 'NFSv' + protocol
       );
-      this.data[this.i18n('Pseudo')] = this.selectedItem.pseudo;
-      this.data[this.i18n('Access Type')] = this.selectedItem.access_type;
-      this.data[this.i18n('Squash')] = this.selectedItem.squash;
-      this.data[this.i18n('Transport')] = this.selectedItem.transports;
-      this.data[this.i18n('Path')] = this.selectedItem.path;
+      this.data[$localize`Pseudo`] = this.selectedItem.pseudo;
+      this.data[$localize`Access Type`] = this.selectedItem.access_type;
+      this.data[$localize`Squash`] = this.selectedItem.squash;
+      this.data[$localize`Transport`] = this.selectedItem.transports;
+      this.data[$localize`Path`] = this.selectedItem.path;
 
       if (this.selectedItem.fsal.name === 'CEPH') {
-        this.data[this.i18n('Storage Backend')] = this.i18n('CephFS');
-        this.data[this.i18n('CephFS User')] = this.selectedItem.fsal.user_id;
-        this.data[this.i18n('CephFS Filesystem')] = this.selectedItem.fsal.fs_name;
-        this.data[this.i18n('Security Label')] = this.selectedItem.fsal.sec_label_xattr;
+        this.data[$localize`Storage Backend`] = $localize`CephFS`;
+        this.data[$localize`CephFS User`] = this.selectedItem.fsal.user_id;
+        this.data[$localize`CephFS Filesystem`] = this.selectedItem.fsal.fs_name;
+        this.data[$localize`Security Label`] = this.selectedItem.fsal.sec_label_xattr;
       } else {
-        this.data[this.i18n('Storage Backend')] = this.i18n('Object Gateway');
-        this.data[this.i18n('Object Gateway User')] = this.selectedItem.fsal.rgw_user_id;
+        this.data[$localize`Storage Backend`] = $localize`Object Gateway`;
+        this.data[$localize`Object Gateway User`] = this.selectedItem.fsal.rgw_user_id;
       }
     }
   }
index 4fd4e2f1f08b1f87be4061ce567a662690fea07b..e85e655626aa3ec0dacc1f8619250804ac2b8dc0 100644 (file)
@@ -2,7 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { FormControl, ReactiveFormsModule } from '@angular/forms';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { CdFormBuilder } from '../../../shared/forms/cd-form-builder';
 import { CdFormGroup } from '../../../shared/forms/cd-form-group';
 import { SharedModule } from '../../../shared/shared.module';
@@ -14,8 +14,7 @@ describe('NfsFormClientComponent', () => {
 
   configureTestBed({
     declarations: [NfsFormClientComponent],
-    imports: [ReactiveFormsModule, SharedModule, HttpClientTestingModule],
-    providers: i18nProviders
+    imports: [ReactiveFormsModule, SharedModule, HttpClientTestingModule]
   });
 
   beforeEach(() => {
index 6415b1f80d9775bc8b5b859f3dff7b53d87c5a7b..3ed39cff7c2cba8424ec56d74fb59ecec92584e9 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, Input, OnInit } from '@angular/core';
 import { FormArray, FormControl, NgForm, Validators } from '@angular/forms';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { NfsService } from '../../../shared/api/nfs.service';
@@ -24,7 +23,7 @@ export class NfsFormClientComponent implements OnInit {
   nfsAccessType: any[] = this.nfsService.nfsAccessType;
   icons = Icons;
 
-  constructor(private nfsService: NfsService, private i18n: I18n) {}
+  constructor(private nfsService: NfsService) {}
 
   ngOnInit() {
     _.forEach(this.clients, (client) => {
@@ -35,9 +34,9 @@ export class NfsFormClientComponent implements OnInit {
 
   getNoAccessTypeDescr() {
     if (this.form.getValue('access_type')) {
-      return `${this.form.getValue('access_type')} ${this.i18n('(inherited from global config)')}`;
+      return `${this.form.getValue('access_type')} ${$localize`(inherited from global config)`}`;
     }
-    return this.i18n('-- Select the access type --');
+    return $localize`-- Select the access type --`;
   }
 
   getAccessTypeHelp(index: number) {
@@ -49,9 +48,9 @@ export class NfsFormClientComponent implements OnInit {
 
   getNoSquashDescr() {
     if (this.form.getValue('squash')) {
-      return `${this.form.getValue('squash')} (${this.i18n('inherited from global config')})`;
+      return `${this.form.getValue('squash')} (${$localize`inherited from global config`})`;
     }
-    return this.i18n('-- Select what kind of user id squashing is performed --');
+    return $localize`-- Select what kind of user id squashing is performed --`;
   }
 
   addClient() {
index ee424ae51b13b6c111ba61f9f37539b87c0bfbee..f17ee20a3de3529851bab12d772c7c607aafc021 100644 (file)
@@ -9,7 +9,7 @@ import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
 import { ActivatedRouteStub } from '../../../../testing/activated-route-stub';
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { LoadingPanelComponent } from '../../../shared/components/loading-panel/loading-panel.component';
 import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
 import { SummaryService } from '../../../shared/services/summary.service';
@@ -39,7 +39,6 @@ describe('NfsFormComponent', () => {
           provide: ActivatedRoute,
           useValue: new ActivatedRouteStub({ cluster_id: undefined, export_id: undefined })
         },
-        i18nProviders,
         SummaryService,
         CephReleaseNamePipe
       ]
index 8744ff51cdf7b277b34c27f992958ce4fa0db3f5..4a62907fbecd0980d9de8d8e0c3885eaac007f48 100644 (file)
@@ -2,7 +2,6 @@ import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin, Observable, of } from 'rxjs';
 import { debounceTime, distinctUntilChanged, map, mergeMap } from 'rxjs/operators';
@@ -65,10 +64,7 @@ export class NfsFormComponent extends CdForm implements OnInit {
   docsUrl: string;
 
   daemonsSelections: SelectOption[] = [];
-  daemonsMessages = new SelectMessages(
-    { noOptions: this.i18n('There are no daemons available.') },
-    this.i18n
-  );
+  daemonsMessages = new SelectMessages({ noOptions: $localize`There are no daemons available.` });
 
   pathDataSource = (text$: Observable<string>) => {
     return text$.pipe(
@@ -98,12 +94,11 @@ export class NfsFormComponent extends CdForm implements OnInit {
     private cephReleaseNamePipe: CephReleaseNamePipe,
     private taskWrapper: TaskWrapperService,
     private cdRef: ChangeDetectorRef,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
     this.permission = this.authStorageService.getPermissions().pool;
-    this.resource = this.i18n('NFS export');
+    this.resource = $localize`NFS export`;
     this.createForm();
   }
 
index 046e2789c5feaecbcf1de25ef35b95678c51f53f..1748b7255822286364bdc567abee03c171255032 100644 (file)
@@ -10,7 +10,6 @@ import { of } from 'rxjs';
 import {
   configureTestBed,
   expectItemTasks,
-  i18nProviders,
   PermissionHelper
 } from '../../../../testing/unit-test-helper';
 import { NfsService } from '../../../shared/api/nfs.service';
@@ -44,7 +43,7 @@ describe('NfsListComponent', () => {
       NgbNavModule,
       ToastrModule.forRoot()
     ],
-    providers: [TaskListService, i18nProviders]
+    providers: [TaskListService]
   });
 
   beforeEach(() => {
index cf3994f0cac083f277be54157264010e5c82e4a1..6cebd9f1ebecf9fd3c9815249b60c88145854249 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { Subscription } from 'rxjs';
 
@@ -62,7 +61,6 @@ export class NfsListComponent extends ListWithDetails implements OnInit, OnDestr
 
   constructor(
     private authStorageService: AuthStorageService,
-    private i18n: I18n,
     private modalService: ModalService,
     private nfsService: NfsService,
     private taskListService: TaskListService,
@@ -105,34 +103,34 @@ export class NfsListComponent extends ListWithDetails implements OnInit, OnDestr
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Path'),
+        name: $localize`Path`,
         prop: 'path',
         flexGrow: 2,
         cellTransformation: CellTemplate.executing
       },
       {
-        name: this.i18n('Pseudo'),
+        name: $localize`Pseudo`,
         prop: 'pseudo',
         flexGrow: 2
       },
       {
-        name: this.i18n('Cluster'),
+        name: $localize`Cluster`,
         prop: 'cluster_id',
         flexGrow: 2
       },
       {
-        name: this.i18n('Daemons'),
+        name: $localize`Daemons`,
         prop: 'daemons',
         flexGrow: 2
       },
       {
-        name: this.i18n('Storage Backend'),
+        name: $localize`Storage Backend`,
         prop: 'fsal',
         flexGrow: 2,
         cellTemplate: this.nfsFsal
       },
       {
-        name: this.i18n('Access Type'),
+        name: $localize`Access Type`,
         prop: 'access_type',
         flexGrow: 2
       }
@@ -209,7 +207,7 @@ export class NfsListComponent extends ListWithDetails implements OnInit, OnDestr
     const export_id = this.selection.first().export_id;
 
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
-      itemDescription: this.i18n('NFS export'),
+      itemDescription: $localize`NFS export`,
       itemNames: [`${cluster_id}:${export_id}`],
       submitActionObservable: () =>
         this.taskWrapper.wrapTaskAroundCall({
index ed553e1b407f023fd83a0dd86c141a3a942ef04e..3f3affe685877f9ab00e72cf491ddb725851310a 100644 (file)
@@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { TablePerformanceCounterComponent } from '../table-performance-counter/table-performance-counter.component';
 import { PerformanceCounterComponent } from './performance-counter.component';
@@ -14,8 +14,7 @@ describe('PerformanceCounterComponent', () => {
 
   configureTestBed({
     declarations: [PerformanceCounterComponent, TablePerformanceCounterComponent],
-    imports: [RouterTestingModule, SharedModule, HttpClientTestingModule, BrowserAnimationsModule],
-    providers: i18nProviders
+    imports: [RouterTestingModule, SharedModule, HttpClientTestingModule, BrowserAnimationsModule]
   });
 
   beforeEach(() => {
index ae369f28281ab09256b9fe50d0bba24a38dc841f..4ca483cf671e9ffe5ce4bb3c209078cd553d0427 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { AppModule } from '../../../app.module';
 import { CdTableFetchDataContext } from '../../../shared/models/cd-table-fetch-data-context';
 import { TablePerformanceCounterComponent } from './table-performance-counter.component';
@@ -12,8 +12,7 @@ describe('TablePerformanceCounterComponent', () => {
   let httpTesting: HttpTestingController;
 
   configureTestBed({
-    imports: [AppModule, HttpClientTestingModule],
-    providers: i18nProviders
+    imports: [AppModule, HttpClientTestingModule]
   });
 
   beforeEach(() => {
index ac6ea523576a1f87e9b04f235c5c000a4ef108bc..0e06983369778517e17fda60be87ee0fe7d94b8b 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, Input, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { PerformanceCounterService } from '../../../shared/api/performance-counter.service';
 import { CdTableColumn } from '../../../shared/models/cd-table-column';
 import { CdTableFetchDataContext } from '../../../shared/models/cd-table-fetch-data-context';
@@ -33,22 +31,22 @@ export class TablePerformanceCounterComponent implements OnInit {
   @Input()
   serviceId: string;
 
-  constructor(private performanceCounterService: PerformanceCounterService, private i18n: I18n) {}
+  constructor(private performanceCounterService: PerformanceCounterService) {}
 
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'name',
         flexGrow: 1
       },
       {
-        name: this.i18n('Description'),
+        name: $localize`Description`,
         prop: 'description',
         flexGrow: 1
       },
       {
-        name: this.i18n('Value'),
+        name: $localize`Value`,
         prop: 'value',
         cellTemplate: this.valueTpl,
         flexGrow: 1
index 62bdbebc367ba9e62065b5262b204b49112dd7d8..2ecdfe9b5d2adb15af1730d2aa49edc0d1b353db 100644 (file)
@@ -11,7 +11,6 @@ import {
   configureTestBed,
   FixtureHelper,
   FormHelper,
-  i18nProviders,
   Mocks
 } from '../../../../testing/unit-test-helper';
 import { CrushRuleService } from '../../../shared/api/crush-rule.service';
@@ -79,7 +78,7 @@ describe('CrushRuleFormComponent', () => {
       PoolModule,
       NgBootstrapFormValidationModule.forRoot()
     ],
-    providers: [CrushRuleService, NgbActiveModal, i18nProviders]
+    providers: [CrushRuleService, NgbActiveModal]
   });
 
   beforeEach(() => {
index dcf60e4cd88bceeb2a568e3e286d999740230771..be4f85e0290d25fdc8087b15b616b0a8cccbedfa 100644 (file)
@@ -2,7 +2,6 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core';
 import { Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { CrushRuleService } from '../../../shared/api/crush-rule.service';
@@ -36,12 +35,11 @@ export class CrushRuleFormModalComponent extends CrushNodeSelectionClass impleme
     public activeModal: NgbActiveModal,
     private taskWrapper: TaskWrapperService,
     private crushRuleService: CrushRuleService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
     this.action = this.actionLabels.CREATE;
-    this.resource = this.i18n('Crush Rule');
+    this.resource = $localize`Crush Rule`;
     this.createForm();
   }
 
index 7499a3148cd6c671e4b2173ada78492a5df88b66..1ea007a1e320b27b291980701c53240153c080d7 100644 (file)
@@ -12,7 +12,6 @@ import {
   configureTestBed,
   FixtureHelper,
   FormHelper,
-  i18nProviders,
   Mocks
 } from '../../../../testing/unit-test-helper';
 import { ErasureCodeProfileService } from '../../../shared/api/erasure-code-profile.service';
@@ -37,7 +36,7 @@ describe('ErasureCodeProfileFormModalComponent', () => {
       PoolModule,
       NgBootstrapFormValidationModule.forRoot()
     ],
-    providers: [ErasureCodeProfileService, NgbActiveModal, i18nProviders]
+    providers: [ErasureCodeProfileService, NgbActiveModal]
   });
 
   beforeEach(() => {
index 814b1696fe0c3f89404c47b43ff7dc2880a06cc4..4cda73509f5856bbb4a7eb3b6fc845e9df02cef1 100644 (file)
@@ -2,7 +2,6 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core';
 import { Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 
 import { ErasureCodeProfileService } from '../../../shared/api/erasure-code-profile.service';
 import { CrushNodeSelectionClass } from '../../../shared/classes/crush.node.selection.class';
@@ -48,12 +47,11 @@ export class ErasureCodeProfileFormModalComponent extends CrushNodeSelectionClas
     public activeModal: NgbActiveModal,
     private taskWrapper: TaskWrapperService,
     private ecpService: ErasureCodeProfileService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
     this.action = this.actionLabels.CREATE;
-    this.resource = this.i18n('EC Profile');
+    this.resource = $localize`EC Profile`;
     this.createForm();
     this.setJerasureDefaults();
   }
index 9bb3f2422dfd9915dcd76d9312cb4b6720845a19..188f65d7905f38c14464b21783e7cfc484e9921b 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders, TabHelper } from '../../../../testing/unit-test-helper';
+import { configureTestBed, TabHelper } from '../../../../testing/unit-test-helper';
 import { Permissions } from '../../../shared/models/permissions';
 import { SharedModule } from '../../../shared/shared.module';
 import { RbdConfigurationListComponent } from '../../block/rbd-configuration-list/rbd-configuration-list.component';
@@ -23,8 +23,7 @@ describe('PoolDetailsComponent', () => {
       HttpClientTestingModule,
       RouterTestingModule
     ],
-    declarations: [PoolDetailsComponent, RbdConfigurationListComponent],
-    providers: [i18nProviders]
+    declarations: [PoolDetailsComponent, RbdConfigurationListComponent]
   });
 
   beforeEach(() => {
index bf517a84dcce36a65a994440140fe71c904e838e..74242d9ec2a6dcd8050c578b8f32e73f2df2d8a3 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, Input, OnChanges } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { PoolService } from '../../../shared/api/pool.service';
@@ -24,36 +23,36 @@ export class PoolDetailsComponent implements OnChanges {
   cacheTiers: any[];
   selectedPoolConfiguration: RbdConfigurationEntry[];
 
-  constructor(private i18n: I18n, private poolService: PoolService) {
+  constructor(private poolService: PoolService) {
     this.cacheTierColumns = [
       {
         prop: 'pool_name',
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         flexGrow: 3
       },
       {
         prop: 'cache_mode',
-        name: this.i18n('Cache Mode'),
+        name: $localize`Cache Mode`,
         flexGrow: 2
       },
       {
         prop: 'cache_min_evict_age',
-        name: this.i18n('Min Evict Age'),
+        name: $localize`Min Evict Age`,
         flexGrow: 2
       },
       {
         prop: 'cache_min_flush_age',
-        name: this.i18n('Min Flush Age'),
+        name: $localize`Min Flush Age`,
         flexGrow: 2
       },
       {
         prop: 'target_max_bytes',
-        name: this.i18n('Target Max Bytes'),
+        name: $localize`Target Max Bytes`,
         flexGrow: 2
       },
       {
         prop: 'target_max_objects',
-        name: this.i18n('Target Max Objects'),
+        name: $localize`Target Max Objects`,
         flexGrow: 2
       }
     ];
index 88d5664d6b6a6445183bf1f021d0d12670df6c8d..c0cd2438672f5109c82f1f72e36510ff328a9d7f 100644 (file)
@@ -1,7 +1,5 @@
 import { Validators } from '@angular/forms';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { SelectMessages } from '../../../shared/components/select/select-messages.model';
 import { Pool } from '../pool';
 
@@ -11,29 +9,26 @@ export class PoolFormData {
   crushInfo = false;
   applications: any;
 
-  constructor(i18n: I18n) {
+  constructor() {
     this.poolTypes = ['erasure', 'replicated'];
     this.applications = {
       selected: [],
       default: ['cephfs', 'rbd', 'rgw'],
       available: [], // Filled during runtime
       validators: [Validators.pattern('[A-Za-z0-9_]+'), Validators.maxLength(128)],
-      messages: new SelectMessages(
-        {
-          empty: i18n('No applications added'),
-          selectionLimit: {
-            text: i18n('Applications limit reached'),
-            tooltip: i18n('A pool can only have up to four applications definitions.')
-          },
-          customValidations: {
-            pattern: i18n(`Allowed characters '_a-zA-Z0-9'`),
-            maxlength: i18n('Maximum length is 128 characters')
-          },
-          filter: i18n('Filter or add applications'),
-          add: i18n('Add application')
+      messages: new SelectMessages({
+        empty: $localize`No applications added`,
+        selectionLimit: {
+          text: $localize`Applications limit reached`,
+          tooltip: $localize`A pool can only have up to four applications definitions.`
+        },
+        customValidations: {
+          pattern: $localize`Allowed characters '_a-zA-Z0-9'`,
+          maxlength: $localize`Maximum length is 128 characters`
         },
-        i18n
-      )
+        filter: $localize`Filter or add applications'`,
+        add: $localize`Add application`
+      })
     };
   }
 
index af8999a807c10bf4678b8a1ba0ad6a83e632d41c..0ca5df70d8cc19c61d8b688d509c240591fcf3b5 100644 (file)
@@ -21,7 +21,6 @@ import {
   configureTestBed,
   FixtureHelper,
   FormHelper,
-  i18nProviders,
   Mocks,
   modalServiceShow
 } from '../../../../testing/unit-test-helper';
@@ -152,8 +151,7 @@ describe('PoolFormComponent', () => {
         ErasureCodeProfileService,
         NgbActiveModal,
         SelectBadgesComponent,
-        { provide: ActivatedRoute, useValue: { params: of({ name: 'somePoolName' }) } },
-        i18nProviders
+        { provide: ActivatedRoute, useValue: { params: of({ name: 'somePoolName' }) } }
       ]
     },
     [CriticalConfirmationModalComponent]
index f57b70a1231cbd912a02feeb52ee280e758faa4e..7691b5e494ba7e089b3d00b02d6c1962361af3f4 100644 (file)
@@ -3,7 +3,6 @@ import { FormControl, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
 import { NgbNav, NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { Observable, Subscription } from 'rxjs';
 
@@ -66,7 +65,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
   editing = false;
   isReplicated = false;
   isErasure = false;
-  data = new PoolFormData(this.i18n);
+  data = new PoolFormData();
   externalPgChange = false;
   current: Record<string, any> = {
     rules: []
@@ -96,13 +95,12 @@ export class PoolFormComponent extends CdForm implements OnInit {
     private taskWrapper: TaskWrapperService,
     private ecpService: ErasureCodeProfileService,
     private crushRuleService: CrushRuleService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
     this.editing = this.router.url.startsWith(`/pool/${URLVerbs.EDIT}`);
     this.action = this.editing ? this.actionLabels.EDIT : this.actionLabels.CREATE;
-    this.resource = this.i18n('pool');
+    this.resource = $localize`pool`;
     this.authenticate();
     this.createForm();
   }
@@ -632,7 +630,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
       getTabs: () => this.ecpInfoTabs,
       tabPosition: 'used-by-pools',
       nameAttribute: 'name',
-      itemDescription: this.i18n('erasure code profile'),
+      itemDescription: $localize`erasure code profile`,
       reloadFn: () => this.reloadECPs(),
       deleteFn: (name) => this.ecpService.delete(name),
       taskName: 'ecp/delete'
@@ -720,7 +718,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
       getTabs: () => this.crushInfoTabs,
       tabPosition: 'used-by-pools',
       nameAttribute: 'rule_name',
-      itemDescription: this.i18n('crush rule'),
+      itemDescription: $localize`crush rule`,
       reloadFn: () => this.reloadCrushRules(),
       deleteFn: (name) => this.crushRuleService.delete(name),
       taskName: 'crushRule/delete'
index 048802fc1af8661b5b9c73175b28b6c8e5f3c966..1dbd72afb2b034f9a5edd9a0814625676a6cc95a 100644 (file)
@@ -8,11 +8,7 @@ import * as _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  expectItemTasks,
-  i18nProviders
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, expectItemTasks } from '../../../../testing/unit-test-helper';
 import { ConfigurationService } from '../../../shared/api/configuration.service';
 import { PoolService } from '../../../shared/api/pool.service';
 import { CriticalConfirmationModalComponent } from '../../../shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
@@ -57,7 +53,7 @@ describe('PoolListComponent', () => {
       NgbNavModule,
       HttpClientTestingModule
     ],
-    providers: [i18nProviders, PgCategoryService]
+    providers: [PgCategoryService]
   });
 
   beforeEach(() => {
index ede82bb58cc2b41d2c87773426445eadf8e7065b..eae76ef70c7f2fc2b36d8cbdcaa18017e065fecf 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { ConfigurationService } from '../../../shared/api/configuration.service';
@@ -66,7 +65,6 @@ export class PoolListComponent extends ListWithDetails implements OnInit {
     private authStorageService: AuthStorageService,
     private taskListService: TaskListService,
     private modalService: ModalService,
-    private i18n: I18n,
     private pgCategoryService: PgCategoryService,
     private dimlessPipe: DimlessPipe,
     private urlBuilder: URLBuilderService,
@@ -119,23 +117,23 @@ export class PoolListComponent extends ListWithDetails implements OnInit {
     this.columns = [
       {
         prop: 'pool_name',
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         flexGrow: 4,
         cellTransformation: CellTemplate.executing
       },
       {
         prop: 'type',
-        name: this.i18n('Type'),
+        name: $localize`Type`,
         flexGrow: 2
       },
       {
         prop: 'application_metadata',
-        name: this.i18n('Applications'),
+        name: $localize`Applications`,
         flexGrow: 3
       },
       {
         prop: 'pg_status',
-        name: this.i18n('PG Status'),
+        name: $localize`PG Status`,
         flexGrow: 3,
         cellClass: ({ row, column, value }): any => {
           return this.getPgStatusCellClass(row, column, value);
@@ -143,35 +141,35 @@ export class PoolListComponent extends ListWithDetails implements OnInit {
       },
       {
         prop: 'size',
-        name: this.i18n('Replica Size'),
+        name: $localize`Replica Size`,
         flexGrow: 2,
         cellClass: 'text-right'
       },
       {
         prop: 'last_change',
-        name: this.i18n('Last Change'),
+        name: $localize`Last Change`,
         flexGrow: 2,
         cellClass: 'text-right'
       },
       {
         prop: 'erasure_code_profile',
-        name: this.i18n('Erasure Coded Profile'),
+        name: $localize`Erasure Coded Profile`,
         flexGrow: 2
       },
       {
         prop: 'crush_rule',
-        name: this.i18n('Crush Ruleset'),
+        name: $localize`Crush Ruleset`,
         flexGrow: 3
       },
       {
-        name: this.i18n('Usage'),
+        name: $localize`Usage`,
         prop: 'usage',
         cellTemplate: this.poolUsageTpl,
         flexGrow: 3
       },
       {
         prop: 'stats.rd_bytes.rates',
-        name: this.i18n('Read bytes'),
+        name: $localize`Read bytes`,
         comparator: (_valueA: any, _valueB: any, rowA: Pool, rowB: Pool) =>
           compare('stats.rd_bytes.latest', rowA, rowB),
         cellTransformation: CellTemplate.sparkline,
@@ -179,7 +177,7 @@ export class PoolListComponent extends ListWithDetails implements OnInit {
       },
       {
         prop: 'stats.wr_bytes.rates',
-        name: this.i18n('Write bytes'),
+        name: $localize`Write bytes`,
         comparator: (_valueA: any, _valueB: any, rowA: Pool, rowB: Pool) =>
           compare('stats.wr_bytes.latest', rowA, rowB),
         cellTransformation: CellTemplate.sparkline,
@@ -187,14 +185,14 @@ export class PoolListComponent extends ListWithDetails implements OnInit {
       },
       {
         prop: 'stats.rd.rate',
-        name: this.i18n('Read ops'),
+        name: $localize`Read ops`,
         flexGrow: 1,
         pipe: this.dimlessPipe,
         cellTransformation: CellTemplate.perSecond
       },
       {
         prop: 'stats.wr.rate',
-        name: this.i18n('Write ops'),
+        name: $localize`Write ops`,
         flexGrow: 1,
         pipe: this.dimlessPipe,
         cellTransformation: CellTemplate.perSecond
@@ -295,9 +293,7 @@ export class PoolListComponent extends ListWithDetails implements OnInit {
 
   getDisableDesc(): string | undefined {
     if (!this.monAllowPoolDelete) {
-      return this.i18n(
-        'Pool deletion is disabled by the mon_allow_pool_delete configuration setting.'
-      );
+      return $localize`Pool deletion is disabled by the mon_allow_pool_delete configuration setting.`;
     }
 
     return undefined;
index 565caab1563cd9acc58ec1d1c536e41b59729a80..75941b9e30bd259ff62cb291386d0849a1ceecad 100644 (file)
@@ -2,7 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { Rgw501Component } from './rgw-501.component';
 
@@ -12,8 +12,7 @@ describe('Rgw501Component', () => {
 
   configureTestBed({
     declarations: [Rgw501Component],
-    imports: [HttpClientTestingModule, RouterTestingModule, SharedModule],
-    providers: i18nProviders
+    imports: [HttpClientTestingModule, RouterTestingModule, SharedModule]
   });
 
   beforeEach(() => {
index 68799f5ee36218d7777497acf10b0d5fd81301b3..60f2c67fa90bebe0e81e4b82a4592daeff67fc55 100644 (file)
@@ -1,6 +1,6 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
 import { SharedModule } from '../../../shared/shared.module';
 import { RgwBucketDetailsComponent } from './rgw-bucket-details.component';
@@ -11,8 +11,7 @@ describe('RgwBucketDetailsComponent', () => {
 
   configureTestBed({
     declarations: [RgwBucketDetailsComponent],
-    imports: [SharedModule],
-    providers: [i18nProviders]
+    imports: [SharedModule]
   });
 
   beforeEach(() => {
index acaecac88bae16cca7fe669c0a7d1f02f318ce14..5a9e3e221ad59676e5f9381abadb168f5e6fafd2 100644 (file)
@@ -8,7 +8,7 @@ import * as _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 import { of as observableOf } from 'rxjs';
 
-import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../testing/unit-test-helper';
 import { RgwBucketService } from '../../../shared/api/rgw-bucket.service';
 import { RgwSiteService } from '../../../shared/api/rgw-site.service';
 import { RgwUserService } from '../../../shared/api/rgw-user.service';
@@ -36,8 +36,7 @@ describe('RgwBucketFormComponent', () => {
       RouterTestingModule,
       SharedModule,
       ToastrModule.forRoot()
-    ],
-    providers: [i18nProviders]
+    ]
   });
 
   beforeEach(() => {
@@ -204,7 +203,7 @@ describe('RgwBucketFormComponent', () => {
       component.submit();
       expect(notificationService.show).toHaveBeenCalledWith(
         NotificationType.success,
-        `Created Object Gateway bucket ''`
+        `Created Object Gateway bucket 'null'`
       );
     });
 
@@ -215,7 +214,7 @@ describe('RgwBucketFormComponent', () => {
       component.submit();
       expect(notificationService.show).toHaveBeenCalledWith(
         NotificationType.success,
-        `Updated Object Gateway bucket ''.`
+        `Updated Object Gateway bucket 'null'.`
       );
     });
   });
index 21531ed73440017ca416b6b0d4e095a83b7384f8..484a2bf0a0fbfea00fc1c25a067371439b761403 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { AbstractControl, AsyncValidatorFn, ValidationErrors, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin } from 'rxjs';
 
@@ -52,13 +51,12 @@ export class RgwBucketFormComponent extends CdForm implements OnInit {
     private rgwSiteService: RgwSiteService,
     private rgwUserService: RgwUserService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
     this.editing = this.router.url.startsWith(`/rgw/bucket/${URLVerbs.EDIT}`);
     this.action = this.editing ? this.actionLabels.EDIT : this.actionLabels.CREATE;
-    this.resource = this.i18n('bucket');
+    this.resource = $localize`bucket`;
     this.createForm();
   }
 
@@ -114,7 +112,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit {
           const placementTargets = data['getPlacementTargets'];
           this.zonegroup = placementTargets['zonegroup'];
           _.forEach(placementTargets['placement_targets'], (placementTarget) => {
-            placementTarget['description'] = `${placementTarget['name']} (${this.i18n('pool')}: ${
+            placementTarget['description'] = `${placementTarget['name']} (${$localize`pool`}: ${
               placementTarget['data_pool']
             })`;
             this.placementTargets.push(placementTarget);
@@ -189,7 +187,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit {
           () => {
             this.notificationService.show(
               NotificationType.success,
-              this.i18n(`Updated Object Gateway bucket '{{bid}}'.`, values)
+              $localize`Updated Object Gateway bucket '${values.bid}'.`
             );
             this.goToListView();
           },
@@ -215,7 +213,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit {
           () => {
             this.notificationService.show(
               NotificationType.success,
-              this.i18n(`Created Object Gateway bucket '{{bid}}'`, values)
+              $localize`Created Object Gateway bucket '${values.bid}'`
             );
             this.goToListView();
           },
index b3ea48a093518f84cd55f331792faadbf6afdf9d..a41ff3c169d8f2bd7106be1424b87a264a279878 100644 (file)
@@ -6,11 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../testing/unit-test-helper';
 import { RgwBucketService } from '../../../shared/api/rgw-bucket.service';
 import { TableActionsComponent } from '../../../shared/datatable/table-actions/table-actions.component';
 import { SharedModule } from '../../../shared/shared.module';
@@ -31,8 +27,7 @@ describe('RgwBucketListComponent', () => {
       SharedModule,
       NgbNavModule,
       HttpClientTestingModule
-    ],
-    providers: i18nProviders
+    ]
   });
 
   beforeEach(() => {
index aceaffe07ee0369b9a17ed27c1f36fe4cbce20fc..f35b19f8280ab12e8daae2953b8d443e4a23af1f 100644 (file)
@@ -7,7 +7,6 @@ import {
   ViewChild
 } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin as observableForkJoin, Observable, Subscriber } from 'rxjs';
 
@@ -58,7 +57,6 @@ export class RgwBucketListComponent extends ListWithDetails implements OnInit {
     private dimlessPipe: DimlessPipe,
     private rgwBucketService: RgwBucketService,
     private modalService: ModalService,
-    private i18n: I18n,
     private urlBuilder: URLBuilderService,
     public actionLabels: ActionLabelsI18n,
     private ngZone: NgZone,
@@ -96,35 +94,35 @@ export class RgwBucketListComponent extends ListWithDetails implements OnInit {
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'bid',
         flexGrow: 2
       },
       {
-        name: this.i18n('Owner'),
+        name: $localize`Owner`,
         prop: 'owner',
         flexGrow: 2.5
       },
       {
-        name: this.i18n('Used Capacity'),
+        name: $localize`Used Capacity`,
         prop: 'bucket_size',
         flexGrow: 0.6,
         pipe: this.dimlessBinaryPipe
       },
       {
-        name: this.i18n('Capacity Limit %'),
+        name: $localize`Capacity Limit %`,
         prop: 'size_usage',
         cellTemplate: this.bucketSizeTpl,
         flexGrow: 0.8
       },
       {
-        name: this.i18n('Objects'),
+        name: $localize`Objects`,
         prop: 'num_objects',
         flexGrow: 0.6,
         pipe: this.dimlessPipe
       },
       {
-        name: this.i18n('Object Limit %'),
+        name: $localize`Object Limit %`,
         prop: 'object_usage',
         cellTemplate: this.bucketObjectTpl,
         flexGrow: 0.8
@@ -183,9 +181,7 @@ export class RgwBucketListComponent extends ListWithDetails implements OnInit {
 
   deleteAction() {
     this.modalService.show(CriticalConfirmationModalComponent, {
-      itemDescription: this.selection.hasSingleSelection
-        ? this.i18n('bucket')
-        : this.i18n('buckets'),
+      itemDescription: this.selection.hasSingleSelection ? $localize`bucket` : $localize`buckets`,
       itemNames: this.selection.selected.map((bucket: any) => bucket['bid']),
       submitActionObservable: () => {
         return new Observable((observer: Subscriber<any>) => {
index 8dce412135a8798efbb7f4c848febdf8be26c6e8..4ee44b7292285172914fb264ee3f62a1ac4df739 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders, TabHelper } from '../../../../testing/unit-test-helper';
+import { configureTestBed, TabHelper } from '../../../../testing/unit-test-helper';
 import { RgwSiteService } from '../../../shared/api/rgw-site.service';
 import { Permissions } from '../../../shared/models/permissions';
 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
@@ -37,8 +37,7 @@ describe('RgwDaemonListComponent', () => {
       PerformanceCounterModule,
       SharedModule,
       RouterTestingModule
-    ],
-    providers: i18nProviders
+    ]
   });
 
   beforeEach(() => {
index 7a43cfeeadfb94e5720f7bf4384348b666033df2..8d8be533a2d17e54b7e21d8f270e8c59809e2792 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, OnInit } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { RgwDaemonService } from '../../../shared/api/rgw-daemon.service';
 import { RgwSiteService } from '../../../shared/api/rgw-site.service';
 import { ListWithDetails } from '../../../shared/classes/list-with-details.class';
@@ -26,7 +24,6 @@ export class RgwDaemonListComponent extends ListWithDetails implements OnInit {
     private rgwDaemonService: RgwDaemonService,
     private authStorageService: AuthStorageService,
     private cephShortVersionPipe: CephShortVersionPipe,
-    private i18n: I18n,
     private rgwSiteService: RgwSiteService
   ) {
     super();
@@ -36,17 +33,17 @@ export class RgwDaemonListComponent extends ListWithDetails implements OnInit {
     this.grafanaPermission = this.authStorageService.getPermissions().grafana;
     this.columns = [
       {
-        name: this.i18n('ID'),
+        name: $localize`ID`,
         prop: 'id',
         flexGrow: 2
       },
       {
-        name: this.i18n('Hostname'),
+        name: $localize`Hostname`,
         prop: 'server_hostname',
         flexGrow: 2
       },
       {
-        name: this.i18n('Version'),
+        name: $localize`Version`,
         prop: 'version',
         flexGrow: 1,
         pipe: this.cephShortVersionPipe
index 9c457bec9c40c3f6f5055336d5a0403b0a546508..3b92991f3d36bd4740c7a7a527dab73fc8ae31cb 100644 (file)
@@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { RgwUserCapabilityModalComponent } from './rgw-user-capability-modal.component';
 
@@ -15,7 +15,7 @@ describe('RgwUserCapabilityModalComponent', () => {
   configureTestBed({
     declarations: [RgwUserCapabilityModalComponent],
     imports: [ReactiveFormsModule, SharedModule, RouterTestingModule],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index cb4ca3855454d0c93f637421dfd2f0adc807b138..3b1ce3fc81c37a31855840e5696915e1534cf08e 100644 (file)
@@ -2,7 +2,6 @@ import { Component, EventEmitter, Output } from '@angular/core';
 import { Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
@@ -33,10 +32,9 @@ export class RgwUserCapabilityModalComponent {
   constructor(
     private formBuilder: CdFormBuilder,
     public activeModal: NgbActiveModal,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
-    this.resource = this.i18n('capability');
+    this.resource = $localize`capability`;
     this.createForm();
   }
 
index 9dcf79a3c034b6a0c5ae1ceac39e1e9da2b19d3b..4156a4ada207178cd992ae117f6f753f3d4940a1 100644 (file)
@@ -4,7 +4,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders, TabHelper } from '../../../../testing/unit-test-helper';
+import { configureTestBed, TabHelper } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { RgwUserS3Key } from '../models/rgw-user-s3-key';
 import { RgwUserDetailsComponent } from './rgw-user-details.component';
@@ -15,8 +15,7 @@ describe('RgwUserDetailsComponent', () => {
 
   configureTestBed({
     declarations: [RgwUserDetailsComponent],
-    imports: [BrowserAnimationsModule, HttpClientTestingModule, SharedModule, NgbNavModule],
-    providers: [i18nProviders]
+    imports: [BrowserAnimationsModule, HttpClientTestingModule, SharedModule, NgbNavModule]
   });
 
   beforeEach(() => {
index f2cd8faa18b9a375787f89fba7450e32f6fd2f05..276950c8d6ebc5812e504b8395db414cfa9e0466 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { RgwUserService } from '../../../shared/api/rgw-user.service';
@@ -38,28 +37,24 @@ export class RgwUserDetailsComponent implements OnChanges, OnInit {
 
   icons = Icons;
 
-  constructor(
-    private rgwUserService: RgwUserService,
-    private modalService: ModalService,
-    private i18n: I18n
-  ) {}
+  constructor(private rgwUserService: RgwUserService, private modalService: ModalService) {}
 
   ngOnInit() {
     this.keysColumns = [
       {
-        name: this.i18n('Username'),
+        name: $localize`Username`,
         prop: 'username',
         flexGrow: 1
       },
       {
-        name: this.i18n('Type'),
+        name: $localize`Type`,
         prop: 'type',
         flexGrow: 1
       }
     ];
     this.maxBucketsMap = {
-      '-1': this.i18n('Disabled'),
-      0: this.i18n('Unlimited')
+      '-1': $localize`Disabled`,
+      0: $localize`Unlimited`
     };
   }
 
index c41e7384d28b656e5803891b735b73099b02a7bb..f434aae26a508b6da0d357ac8c1888cf6df691dd 100644 (file)
@@ -8,7 +8,7 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of as observableOf } from 'rxjs';
 
-import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../testing/unit-test-helper';
 import { RgwUserService } from '../../../shared/api/rgw-user.service';
 import { NotificationType } from '../../../shared/enum/notification-type.enum';
 import { NotificationService } from '../../../shared/services/notification.service';
@@ -33,8 +33,7 @@ describe('RgwUserFormComponent', () => {
       SharedModule,
       ToastrModule.forRoot(),
       NgbTooltipModule
-    ],
-    providers: [i18nProviders]
+    ]
   });
 
   beforeEach(() => {
@@ -295,7 +294,7 @@ describe('RgwUserFormComponent', () => {
       component.onSubmit();
       expect(notificationService.show).toHaveBeenCalledWith(
         NotificationType.success,
-        `Created Object Gateway user ''`
+        `Created Object Gateway user 'null'`
       );
     });
 
@@ -306,7 +305,7 @@ describe('RgwUserFormComponent', () => {
       component.onSubmit();
       expect(notificationService.show).toHaveBeenCalledWith(
         NotificationType.success,
-        `Updated Object Gateway user ''`
+        `Updated Object Gateway user 'null'`
       );
     });
   });
index 00a799f180f8d452e28488fddf191a25ee26814d..8055daf029a05976a8f4903127571c8e6c79e353 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { AbstractControl, ValidationErrors, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { concat as observableConcat, forkJoin as observableForkJoin, Observable } from 'rxjs';
 
@@ -55,14 +54,13 @@ export class RgwUserFormComponent extends CdForm implements OnInit {
     private rgwUserService: RgwUserService,
     private modalService: ModalService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
-    this.resource = this.i18n('user');
-    this.subuserLabel = this.i18n('subuser');
-    this.s3keyLabel = this.i18n('S3 Key');
-    this.capabilityLabel = this.i18n('capability');
+    this.resource = $localize`user`;
+    this.subuserLabel = $localize`subuser`;
+    this.s3keyLabel = $localize`S3 Key`;
+    this.capabilityLabel = $localize`capability`;
     this.createForm();
   }
 
@@ -250,12 +248,12 @@ export class RgwUserFormComponent extends CdForm implements OnInit {
         const args = this._getUpdateArgs();
         this.submitObservables.push(this.rgwUserService.update(uid, args));
       }
-      notificationTitle = this.i18n(`Updated Object Gateway user '{{uid}}'`, { uid: uid });
+      notificationTitle = $localize`Updated Object Gateway user '${uid}'`;
     } else {
       // Add
       const args = this._getCreateArgs();
       this.submitObservables.push(this.rgwUserService.create(args));
-      notificationTitle = this.i18n(`Created Object Gateway user '{{uid}}'`, { uid: uid });
+      notificationTitle = $localize`Created Object Gateway user '${uid}'`;
     }
     // Check if user quota has been modified.
     if (this._isUserQuotaDirty()) {
index a893a0db1feaa113a37a7a8be4281be577145fec..c037065e03ca9bf25cfb0532d9ae21838a294ebe 100644 (file)
@@ -4,11 +4,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../testing/unit-test-helper';
 import { TableActionsComponent } from '../../../shared/datatable/table-actions/table-actions.component';
 import { SharedModule } from '../../../shared/shared.module';
 import { RgwUserListComponent } from './rgw-user-list.component';
@@ -20,8 +16,7 @@ describe('RgwUserListComponent', () => {
   configureTestBed({
     declarations: [RgwUserListComponent],
     imports: [BrowserAnimationsModule, RouterTestingModule, HttpClientTestingModule, SharedModule],
-    schemas: [NO_ERRORS_SCHEMA],
-    providers: i18nProviders
+    schemas: [NO_ERRORS_SCHEMA]
   });
 
   beforeEach(() => {
index 4bad8007d7d0ac3ef9c2f51db9a80e4722ed3a5b..d5ed7c17e8474059437aaab74fcc67c2956bbcc2 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, NgZone, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { forkJoin as observableForkJoin, Observable, Subscriber } from 'rxjs';
 
 import { RgwUserService } from '../../../shared/api/rgw-user.service';
@@ -42,7 +41,6 @@ export class RgwUserListComponent extends ListWithDetails {
     private authStorageService: AuthStorageService,
     private rgwUserService: RgwUserService,
     private modalService: ModalService,
-    private i18n: I18n,
     private urlBuilder: URLBuilderService,
     public actionLabels: ActionLabelsI18n,
     private ngZone: NgZone
@@ -51,35 +49,35 @@ export class RgwUserListComponent extends ListWithDetails {
     this.permission = this.authStorageService.getPermissions().rgw;
     this.columns = [
       {
-        name: this.i18n('Username'),
+        name: $localize`Username`,
         prop: 'uid',
         flexGrow: 1
       },
       {
-        name: this.i18n('Full name'),
+        name: $localize`Full name`,
         prop: 'display_name',
         flexGrow: 1
       },
       {
-        name: this.i18n('Email address'),
+        name: $localize`Email address`,
         prop: 'email',
         flexGrow: 1
       },
       {
-        name: this.i18n('Suspended'),
+        name: $localize`Suspended`,
         prop: 'suspended',
         flexGrow: 1,
         cellClass: 'text-center',
         cellTransformation: CellTemplate.checkIcon
       },
       {
-        name: this.i18n('Max. buckets'),
+        name: $localize`Max. buckets`,
         prop: 'max_buckets',
         flexGrow: 1,
         cellTransformation: CellTemplate.map,
         customTemplateConfig: {
-          '-1': this.i18n('Disabled'),
-          0: this.i18n('Unlimited')
+          '-1': $localize`Disabled`,
+          0: $localize`Unlimited`
         }
       }
     ];
@@ -140,7 +138,7 @@ export class RgwUserListComponent extends ListWithDetails {
 
   deleteAction() {
     this.modalService.show(CriticalConfirmationModalComponent, {
-      itemDescription: this.selection.hasSingleSelection ? this.i18n('user') : this.i18n('users'),
+      itemDescription: this.selection.hasSingleSelection ? $localize`user` : $localize`users`,
       itemNames: this.selection.selected.map((user: any) => user['uid']),
       submitActionObservable: (): Observable<any> => {
         return new Observable((observer: Subscriber<any>) => {
index 0f124dcb2ff8208fa586fe1f3782997225d8f2c7..9c42e1c6d291335c67c518a3e548ab601ee12f98 100644 (file)
@@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { RgwUserS3KeyModalComponent } from './rgw-user-s3-key-modal.component';
 
@@ -15,7 +15,7 @@ describe('RgwUserS3KeyModalComponent', () => {
   configureTestBed({
     declarations: [RgwUserS3KeyModalComponent],
     imports: [ReactiveFormsModule, SharedModule, RouterTestingModule],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index bc762794d68d9143e6a58859e5d2330dbfb0c5db..c06129d39fc5118ea679302d5b15d0429401dc62 100644 (file)
@@ -2,7 +2,6 @@ import { Component, EventEmitter, Output } from '@angular/core';
 import { Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
@@ -32,10 +31,9 @@ export class RgwUserS3KeyModalComponent {
   constructor(
     private formBuilder: CdFormBuilder,
     public activeModal: NgbActiveModal,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
-    this.resource = this.i18n('S3 Key');
+    this.resource = $localize`S3 Key`;
     this.createForm();
   }
 
index 4c883468e7fb5d0a3a0b2227a0db7facd6577c09..4ebe26a298df755dcedbe2b4ee5d7628f5e63349 100644 (file)
@@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { RgwUserSubuserModalComponent } from './rgw-user-subuser-modal.component';
 
@@ -15,7 +15,7 @@ describe('RgwUserSubuserModalComponent', () => {
   configureTestBed({
     declarations: [RgwUserSubuserModalComponent],
     imports: [ReactiveFormsModule, SharedModule, RouterTestingModule],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index 663c7f937794caa6884405d49dd69f977a2e21d5..3a5344970017c9a673a3e82d0d10e0889502e348 100644 (file)
@@ -2,7 +2,6 @@ import { Component, EventEmitter, Output } from '@angular/core';
 import { AbstractControl, ValidationErrors, ValidatorFn, Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
@@ -33,10 +32,9 @@ export class RgwUserSubuserModalComponent {
   constructor(
     private formBuilder: CdFormBuilder,
     public bsModalRef: NgbActiveModal,
-    private i18n: I18n,
     private actionLabels: ActionLabelsI18n
   ) {
-    this.resource = this.i18n('Subuser');
+    this.resource = $localize`Subuser`;
     this.createForm();
   }
 
index af2c873bcdb8a9a96910a41788aa581b20314d2b..4d5e8fc4176c4f31581bb625ba7c96967de0cdbb 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { RgwUserSwiftKeyModalComponent } from './rgw-user-swift-key-modal.component';
 
@@ -16,7 +16,7 @@ describe('RgwUserSwiftKeyModalComponent', () => {
   configureTestBed({
     declarations: [RgwUserSwiftKeyModalComponent],
     imports: [ToastrModule.forRoot(), FormsModule, SharedModule, RouterTestingModule],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index aa34f6b7c7f0b9e99639cdc66c0623edae00d763..306e81be81f84f8fd17555239d2ad7f9ab5e0b6b 100644 (file)
@@ -1,7 +1,6 @@
 import { Component } from '@angular/core';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 
 import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
 
@@ -16,12 +15,8 @@ export class RgwUserSwiftKeyModalComponent {
   resource: string;
   action: string;
 
-  constructor(
-    public activeModal: NgbActiveModal,
-    private i18n: I18n,
-    public actionLabels: ActionLabelsI18n
-  ) {
-    this.resource = this.i18n('Swift Key');
+  constructor(public activeModal: NgbActiveModal, public actionLabels: ActionLabelsI18n) {
+    this.resource = $localize`Swift Key`;
     this.action = this.actionLabels.SHOW;
   }
 
index 2d136e799f9ba6fc41e9eea8ac6dccf504b78e18..37518b18693acdfa56d93ca1cd1cba4711300276 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { DeviceListComponent } from './device-list.component';
 
@@ -11,8 +11,7 @@ describe('DeviceListComponent', () => {
 
   configureTestBed({
     declarations: [DeviceListComponent],
-    imports: [SharedModule, HttpClientTestingModule],
-    providers: [i18nProviders]
+    imports: [SharedModule, HttpClientTestingModule]
   });
 
   beforeEach(() => {
index cc59e674f48f640e1d8b5b469a29d64eb6411c15..22ce27ff6734afb0275e948afec7f6b1488bd954 100644 (file)
@@ -1,8 +1,6 @@
 import { DatePipe } from '@angular/common';
 import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { HostService } from '../../../shared/api/host.service';
 import { OsdService } from '../../../shared/api/osd.service';
 import { CellTemplate } from '../../../shared/enum/cell-template.enum';
@@ -36,43 +34,42 @@ export class DeviceListComponent implements OnChanges, OnInit {
 
   constructor(
     private hostService: HostService,
-    private i18n: I18n,
     private datePipe: DatePipe,
     private osdService: OsdService
   ) {}
 
   ngOnInit() {
     this.columns = [
-      { prop: 'devid', name: this.i18n('Device ID'), minWidth: 200 },
+      { prop: 'devid', name: $localize`Device ID`, minWidth: 200 },
       {
         prop: 'state',
-        name: this.i18n('State of Health'),
+        name: $localize`State of Health`,
         flexGrow: 1,
         cellTransformation: CellTemplate.badge,
         customTemplateConfig: {
           map: {
-            good: { value: this.i18n('Good'), class: 'badge-success' },
-            warning: { value: this.i18n('Warning'), class: 'badge-warning' },
-            bad: { value: this.i18n('Bad'), class: 'badge-danger' },
-            stale: { value: this.i18n('Stale'), class: 'badge-info' },
-            unknown: { value: this.i18n('Unknown'), class: 'badge-dark' }
+            good: { value: $localize`Good`, class: 'badge-success' },
+            warning: { value: $localize`Warning`, class: 'badge-warning' },
+            bad: { value: $localize`Bad`, class: 'badge-danger' },
+            stale: { value: $localize`Stale`, class: 'badge-info' },
+            unknown: { value: $localize`Unknown`, class: 'badge-dark' }
           }
         }
       },
       {
         prop: 'life_expectancy_weeks',
-        name: this.i18n('Life Expectancy'),
+        name: $localize`Life Expectancy`,
         cellTemplate: this.lifeExpectancyTemplate
       },
       {
         prop: 'life_expectancy_stamp',
-        name: this.i18n('Prediction Creation Date'),
+        name: $localize`Prediction Creation Date`,
         cellTemplate: this.lifeExpectancyTimestampTemplate,
         pipe: this.datePipe,
         isHidden: true
       },
-      { prop: 'location', name: this.i18n('Device Name'), cellTemplate: this.locationTemplate },
-      { prop: 'readableDaemons', name: this.i18n('Daemons') }
+      { prop: 'location', name: $localize`Device Name`, cellTemplate: this.locationTemplate },
+      { prop: 'readableDaemons', name: $localize`Daemons` }
     ];
   }
 
index 138115750f8307dad37c258ecf8ea2e5c0cf6b1f..ac79d93fff7ff7167c61cbd0baffc4b566e6905b 100644 (file)
@@ -8,7 +8,7 @@ import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import * as _ from 'lodash';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { OsdService } from '../../../shared/api/osd.service';
 import { HddSmartDataV1, NvmeSmartDataV1, SmartDataResult } from '../../../shared/models/smart';
 import { SharedModule } from '../../../shared/shared.module';
@@ -81,8 +81,7 @@ describe('OsdSmartListComponent', () => {
 
   configureTestBed({
     declarations: [SmartListComponent],
-    imports: [BrowserAnimationsModule, SharedModule, HttpClientTestingModule, NgbNavModule],
-    providers: [i18nProviders]
+    imports: [BrowserAnimationsModule, SharedModule, HttpClientTestingModule, NgbNavModule]
   });
 
   beforeEach(() => {
index 7c29c98fda33b33df3e3c257d88723bb282c7c3f..f02a537c08c6db6164112aef1a0c2c7c5fed24e0 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { HostService } from '../../../shared/api/host.service';
@@ -33,11 +32,7 @@ export class SmartListComponent implements OnInit, OnChanges {
 
   smartDataColumns: CdTableColumn[];
 
-  constructor(
-    private i18n: I18n,
-    private osdService: OsdService,
-    private hostService: HostService
-  ) {}
+  constructor(private osdService: OsdService, private hostService: HostService) {}
 
   isSmartError(data: any): data is SmartError {
     return _.get(data, 'error') !== undefined;
@@ -57,16 +52,12 @@ export class SmartListComponent implements OnInit, OnChanges {
       if (this.isSmartError(smartData)) {
         let userMessage = '';
         if (smartData.smartctl_error_code === -22) {
-          userMessage = this.i18n(
-            `Smartctl has received an unknown argument (error code {{code}}). \
+          userMessage = $localize`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 successfully retrieve data.`,
-            { code: smartData.smartctl_error_code }
-          );
+smartmontools is required to successfully retrieve data.`;
         } else {
-          userMessage = this.i18n('An error with error code {{code}} occurred.', {
-            code: smartData.smartctl_error_code
-          });
+          userMessage = $localize`An error with error code ${smartData.smartctl_error_code} occurred.`;
         }
         const _result: SmartErrorResult = {
           error: smartData.error,
@@ -152,13 +143,13 @@ smartmontools is required to successfully retrieve data.`,
 
   ngOnInit() {
     this.smartDataColumns = [
-      { prop: 'id', name: this.i18n('ID') },
-      { prop: 'name', name: this.i18n('Name') },
-      { prop: 'raw.value', name: this.i18n('Raw') },
-      { prop: 'thresh', name: this.i18n('Threshold') },
-      { prop: 'value', name: this.i18n('Value') },
-      { prop: 'when_failed', name: this.i18n('When Failed') },
-      { prop: 'worst', name: this.i18n('Worst') }
+      { prop: 'id', name: $localize`ID` },
+      { prop: 'name', name: $localize`Name` },
+      { prop: 'raw.value', name: $localize`Raw` },
+      { prop: 'thresh', name: $localize`Threshold` },
+      { prop: 'value', name: $localize`Value` },
+      { prop: 'when_failed', name: $localize`When Failed` },
+      { prop: 'worst', name: $localize`Worst` }
     ];
   }
 
index eae34d33f9d85ae745308362623f2dea209fdb73..36bef19ef88fb0acfb088922849d67a4a95e432a 100755 (executable)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../testing/unit-test-helper';
 import { AuthService } from '../../../shared/api/auth.service';
 import { ComponentsModule } from '../../../shared/components/components.module';
 import { CdFormGroup } from '../../../shared/forms/cd-form-group';
@@ -33,8 +33,7 @@ describe('LoginPasswordFormComponent', () => {
       ToastrModule.forRoot(),
       SharedModule
     ],
-    declarations: [LoginPasswordFormComponent],
-    providers: i18nProviders
+    declarations: [LoginPasswordFormComponent]
   });
 
   beforeEach(() => {
index e952faf38d88b782fe5ca08c52a94cc13dda8c8d..18c2c02a49d55d49c95c161b355df5dcc8f2bf6f 100755 (executable)
@@ -1,8 +1,6 @@
 import { Component } from '@angular/core';
 import { Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { AuthService } from '../../../shared/api/auth.service';
 import { UserService } from '../../../shared/api/user.service';
 import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
@@ -19,7 +17,6 @@ import { UserPasswordFormComponent } from '../user-password-form/user-password-f
 })
 export class LoginPasswordFormComponent extends UserPasswordFormComponent {
   constructor(
-    public i18n: I18n,
     public actionLabels: ActionLabelsI18n,
     public notificationService: NotificationService,
     public userService: UserService,
@@ -30,7 +27,6 @@ export class LoginPasswordFormComponent extends UserPasswordFormComponent {
     public authService: AuthService
   ) {
     super(
-      i18n,
       actionLabels,
       notificationService,
       userService,
index 7d1fe5b80bbd589a881b930af2cce8e44b9c3651..1f918bb06fbc3929e0d96374ce1de6b5d36b7f10 100644 (file)
@@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
 import { RoleDetailsComponent } from './role-details.component';
 
@@ -14,8 +14,7 @@ describe('RoleDetailsComponent', () => {
 
   configureTestBed({
     imports: [SharedModule, RouterTestingModule, HttpClientTestingModule, NgbNavModule],
-    declarations: [RoleDetailsComponent],
-    providers: i18nProviders
+    declarations: [RoleDetailsComponent]
   });
 
   beforeEach(() => {
index 6ee91494104229df26cb345fa5c9425d2c35d561..8470836fbcde4ffb0506f7f0443ab0a7d0c145d9 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, Input, OnChanges, OnInit } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { CellTemplate } from '../../../shared/enum/cell-template.enum';
@@ -21,39 +20,37 @@ export class RoleDetailsComponent implements OnChanges, OnInit {
   columns: CdTableColumn[];
   scopes_permissions: Array<any> = [];
 
-  constructor(private i18n: I18n) {}
-
   ngOnInit() {
     this.columns = [
       {
         prop: 'scope',
-        name: this.i18n('Scope'),
+        name: $localize`Scope`,
         flexGrow: 2
       },
       {
         prop: 'read',
-        name: this.i18n('Read'),
+        name: $localize`Read`,
         flexGrow: 1,
         cellClass: 'text-center',
         cellTransformation: CellTemplate.checkIcon
       },
       {
         prop: 'create',
-        name: this.i18n('Create'),
+        name: $localize`Create`,
         flexGrow: 1,
         cellClass: 'text-center',
         cellTransformation: CellTemplate.checkIcon
       },
       {
         prop: 'update',
-        name: this.i18n('Update'),
+        name: $localize`Update`,
         flexGrow: 1,
         cellClass: 'text-center',
         cellTransformation: CellTemplate.checkIcon
       },
       {
         prop: 'delete',
-        name: this.i18n('Delete'),
+        name: $localize`Delete`,
         flexGrow: 1,
         cellClass: 'text-center',
         cellTransformation: CellTemplate.checkIcon
index 54786e73761b40ae7ed1e80fc10c5177a7092925..cd2109c0293688dae69bf95b235caa63f3c16f68 100644 (file)
@@ -8,7 +8,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../testing/unit-test-helper';
 import { RoleService } from '../../../shared/api/role.service';
 import { ScopeService } from '../../../shared/api/scope.service';
 import { LoadingPanelComponent } from '../../../shared/components/loading-panel/loading-panel.component';
@@ -41,8 +41,7 @@ describe('RoleFormComponent', () => {
         ToastrModule.forRoot(),
         SharedModule
       ],
-      declarations: [RoleFormComponent, FakeComponent],
-      providers: i18nProviders
+      declarations: [RoleFormComponent, FakeComponent]
     },
     [LoadingPanelComponent]
   );
index e042a4f2f26fc3cc7c3bbc4df4c49661264e9885..08d8f463b028132c8cb837d18eded37d42200cd5 100644 (file)
@@ -2,7 +2,6 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { forkJoin as observableForkJoin } from 'rxjs';
 
@@ -50,11 +49,10 @@ export class RoleFormComponent extends CdForm implements OnInit {
     private roleService: RoleService,
     private scopeService: ScopeService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n
   ) {
     super();
-    this.resource = this.i18n('role');
+    this.resource = $localize`role`;
     this.createForm();
     this.listenToChanges();
   }
@@ -74,14 +72,14 @@ export class RoleFormComponent extends CdForm implements OnInit {
     this.columns = [
       {
         prop: 'scope',
-        name: this.i18n('All'),
+        name: $localize`All`,
         flexGrow: 2,
         cellTemplate: this.cellScopeCheckboxTpl,
         headerTemplate: this.headerPermissionCheckboxTpl
       },
       {
         prop: 'read',
-        name: this.i18n('Read'),
+        name: $localize`Read`,
         flexGrow: 1,
         cellClass: 'text-center',
         cellTemplate: this.cellPermissionCheckboxTpl,
@@ -89,7 +87,7 @@ export class RoleFormComponent extends CdForm implements OnInit {
       },
       {
         prop: 'create',
-        name: this.i18n('Create'),
+        name: $localize`Create`,
         flexGrow: 1,
         cellClass: 'text-center',
         cellTemplate: this.cellPermissionCheckboxTpl,
@@ -97,7 +95,7 @@ export class RoleFormComponent extends CdForm implements OnInit {
       },
       {
         prop: 'update',
-        name: this.i18n('Update'),
+        name: $localize`Update`,
         flexGrow: 1,
         cellClass: 'text-center',
         cellTemplate: this.cellPermissionCheckboxTpl,
@@ -105,7 +103,7 @@ export class RoleFormComponent extends CdForm implements OnInit {
       },
       {
         prop: 'delete',
-        name: this.i18n('Delete'),
+        name: $localize`Delete`,
         flexGrow: 1,
         cellClass: 'text-center',
         cellTemplate: this.cellPermissionCheckboxTpl,
@@ -281,7 +279,7 @@ export class RoleFormComponent extends CdForm implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Created role '{{role_name}}'`, { role_name: roleFormModel.name })
+          $localize`Created role '${roleFormModel.name}'`
         );
         this.router.navigate(['/user-management/roles']);
       },
@@ -297,7 +295,7 @@ export class RoleFormComponent extends CdForm implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Updated role '{{role_name}}'`, { role_name: roleFormModel.name })
+          $localize`Updated role '${roleFormModel.name}'`
         );
         this.router.navigate(['/user-management/roles']);
       },
index dc3c71c38ed41ddcba3308c17b16091c30b50325..bc6d1fdfc3c0cb4e0313af8daaad391068a81e63 100644 (file)
@@ -6,11 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../testing/unit-test-helper';
 import { TableActionsComponent } from '../../../shared/datatable/table-actions/table-actions.component';
 import { SharedModule } from '../../../shared/shared.module';
 import { RoleDetailsComponent } from '../role-details/role-details.component';
@@ -30,8 +26,7 @@ describe('RoleListComponent', () => {
       NgbNavModule,
       RouterTestingModule,
       HttpClientTestingModule
-    ],
-    providers: i18nProviders
+    ]
   });
 
   beforeEach(() => {
index f1cd8753868ee4aa9c6958376fbbeea63df0f80b..ecf254051fa6624419f0c61881240e650c87bd1b 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnInit } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { forkJoin } from 'rxjs';
 
 import { RoleService } from '../../../shared/api/role.service';
@@ -48,7 +47,6 @@ export class RoleListComponent extends ListWithDetails implements OnInit {
     private authStorageService: AuthStorageService,
     private modalService: ModalService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     private urlBuilder: URLBuilderService,
     public actionLabels: ActionLabelsI18n
   ) {
@@ -88,18 +86,18 @@ export class RoleListComponent extends ListWithDetails implements OnInit {
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'name',
         flexGrow: 3
       },
       {
-        name: this.i18n('Description'),
+        name: $localize`Description`,
         prop: 'description',
         flexGrow: 5,
         pipe: this.emptyPipe
       },
       {
-        name: this.i18n('System Role'),
+        name: $localize`System Role`,
         prop: 'system',
         cellClass: 'text-center',
         flexGrow: 1,
@@ -126,10 +124,7 @@ export class RoleListComponent extends ListWithDetails implements OnInit {
       () => {
         this.getRoles();
         this.modalRef.close();
-        this.notificationService.show(
-          NotificationType.success,
-          this.i18n(`Deleted role '{{role_name}}'`, { role_name: role })
-        );
+        this.notificationService.show(NotificationType.success, $localize`Deleted role '${role}'`);
       },
       () => {
         this.modalRef.componentInstance.stopLoadingSpinner();
@@ -154,21 +149,18 @@ export class RoleListComponent extends ListWithDetails implements OnInit {
           type: 'text',
           name: 'newName',
           value: `${name}_clone`,
-          label: this.i18n('New name'),
+          label: $localize`New name`,
           required: true
         }
       ],
-      titleText: this.i18n('Clone Role'),
-      submitButtonText: this.i18n('Clone Role'),
+      titleText: $localize`Clone Role`,
+      submitButtonText: $localize`Clone Role`,
       onSubmit: (values: object) => {
         this.roleService.clone(name, values['newName']).subscribe(() => {
           this.getRoles();
           this.notificationService.show(
             NotificationType.success,
-            this.i18n(`Cloned role '{{dst_name}}' from '{{src_name}}'`, {
-              src_name: name,
-              dst_name: values['newName']
-            })
+            $localize`Cloned role '${values['newName']}' from '${name}'`
           );
         });
       }
index 9eb6bde2aec62a0824a290c2d1f7d0cc88fe2c90..fb16065527cdc4d42d4e7df8ec35ed1bec8e2563 100644 (file)
@@ -9,7 +9,7 @@ import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../testing/unit-test-helper';
 import { RoleService } from '../../../shared/api/role.service';
 import { SettingsService } from '../../../shared/api/settings.service';
 import { UserService } from '../../../shared/api/user.service';
@@ -55,8 +55,7 @@ describe('UserFormComponent', () => {
         SharedModule,
         NgbPopoverModule
       ],
-      declarations: [UserFormComponent, FakeComponent],
-      providers: i18nProviders
+      declarations: [UserFormComponent, FakeComponent]
     },
     [LoadingPanelComponent]
   );
index 6568f47422940a9cad2c41d13e40dbefddf9f92b..c3e1b22777942def645339039cb33aec65b4f5b1 100644 (file)
@@ -3,7 +3,6 @@ import { Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import * as moment from 'moment';
 import { forkJoin as observableForkJoin } from 'rxjs';
@@ -47,7 +46,7 @@ export class UserFormComponent extends CdForm implements OnInit {
   userFormMode = UserFormMode;
   mode: UserFormMode;
   allRoles: Array<UserFormRoleModel>;
-  messages = new SelectMessages({ empty: this.i18n('There are no roles.') }, this.i18n);
+  messages = new SelectMessages({ empty: $localize`There are no roles.` });
   action: string;
   resource: string;
   passwordPolicyHelpText = '';
@@ -66,16 +65,15 @@ export class UserFormComponent extends CdForm implements OnInit {
     private roleService: RoleService,
     private userService: UserService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     public actionLabels: ActionLabelsI18n,
     private passwordPolicyService: PasswordPolicyService,
     private formBuilder: CdFormBuilder,
     private settingsService: SettingsService
   ) {
     super();
-    this.resource = this.i18n('user');
+    this.resource = $localize`user`;
     this.createForm();
-    this.messages = new SelectMessages({ empty: this.i18n('There are no roles.') }, this.i18n);
+    this.messages = new SelectMessages({ empty: $localize`There are no roles.` });
   }
 
   createForm() {
@@ -210,7 +208,7 @@ export class UserFormComponent extends CdForm implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Created user '{{username}}'`, { username: userFormModel.username })
+          $localize`Created user '${userFormModel.username}'`
         );
         this.router.navigate(['/user-management/users']);
       },
@@ -223,8 +221,8 @@ export class UserFormComponent extends CdForm implements OnInit {
   editAction() {
     if (this.isUserRemovingNeededRolePermissions()) {
       const initialState = {
-        titleText: this.i18n('Update user'),
-        buttonText: this.i18n('Continue'),
+        titleText: $localize`Update user`,
+        buttonText: $localize`Continue`,
         bodyTpl: this.removeSelfUserReadUpdatePermissionTpl,
         onSubmit: () => {
           this.modalRef.close();
@@ -279,13 +277,13 @@ export class UserFormComponent extends CdForm implements OnInit {
           this.authService.logout(() => {
             this.notificationService.show(
               NotificationType.info,
-              this.i18n('You were automatically logged out because your roles have been changed.')
+              $localize`You were automatically logged out because your roles have been changed.`
             );
           });
         } else {
           this.notificationService.show(
             NotificationType.success,
-            this.i18n(`Updated user '{{username}}'`, { username: userFormModel.username })
+            $localize`Updated user '${userFormModel.username}'`
           );
           this.router.navigate(['/user-management/users']);
         }
index f5ead615831ef98bf5c0fa809f7d96e5c7b55563..7cc70765a151f939bcf1a88b07174f2ab6330c50 100644 (file)
@@ -6,11 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PermissionHelper
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, PermissionHelper } from '../../../../testing/unit-test-helper';
 import { TableActionsComponent } from '../../../shared/datatable/table-actions/table-actions.component';
 import { SharedModule } from '../../../shared/shared.module';
 import { UserTabsComponent } from '../user-tabs/user-tabs.component';
@@ -29,8 +25,7 @@ describe('UserListComponent', () => {
       RouterTestingModule,
       HttpClientTestingModule
     ],
-    declarations: [UserListComponent, UserTabsComponent],
-    providers: i18nProviders
+    declarations: [UserListComponent, UserTabsComponent]
   });
 
   beforeEach(() => {
index cadc8c929ed156590b35fdfb93cd73a90eae8b9b..c9b21f267a4674c9a693cfa8ddf8ea9674825cb9 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 
 import { UserService } from '../../../shared/api/user.service';
 import { CriticalConfirmationModalComponent } from '../../../shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
@@ -46,7 +45,6 @@ export class UserListComponent implements OnInit {
     private modalService: ModalService,
     private notificationService: NotificationService,
     private authStorageService: AuthStorageService,
-    private i18n: I18n,
     private urlBuilder: URLBuilderService,
     private cdDatePipe: CdDatePipe,
     public actionLabels: ActionLabelsI18n
@@ -77,36 +75,36 @@ export class UserListComponent implements OnInit {
   ngOnInit() {
     this.columns = [
       {
-        name: this.i18n('Username'),
+        name: $localize`Username`,
         prop: 'username',
         flexGrow: 1
       },
       {
-        name: this.i18n('Name'),
+        name: $localize`Name`,
         prop: 'name',
         flexGrow: 1,
         pipe: this.emptyPipe
       },
       {
-        name: this.i18n('Email'),
+        name: $localize`Email`,
         prop: 'email',
         flexGrow: 1,
         pipe: this.emptyPipe
       },
       {
-        name: this.i18n('Roles'),
+        name: $localize`Roles`,
         prop: 'roles',
         flexGrow: 1,
         cellTemplate: this.userRolesTpl
       },
       {
-        name: this.i18n('Enabled'),
+        name: $localize`Enabled`,
         prop: 'enabled',
         flexGrow: 1,
         cellTransformation: CellTemplate.checkIcon
       },
       {
-        name: this.i18n('Password expiration date'),
+        name: $localize`Password expiration date`,
         prop: 'pwdExpirationDate',
         flexGrow: 1,
         pipe: this.cdDatePipe
@@ -136,7 +134,7 @@ export class UserListComponent implements OnInit {
         this.modalRef.close();
         this.notificationService.show(
           NotificationType.success,
-          this.i18n(`Deleted user '{{username}}'`, { username: username })
+          $localize`Deleted user '${username}'`
         );
       },
       () => {
@@ -151,8 +149,8 @@ export class UserListComponent implements OnInit {
     if (sessionUsername === username) {
       this.notificationService.show(
         NotificationType.error,
-        this.i18n(`Failed to delete user '{{username}}'`, { username: username }),
-        this.i18n(`You are currently logged in as '{{username}}'.`, { username: username })
+        $localize`Failed to delete user '${username}'`,
+        $localize`You are currently logged in as '${username}'.`
       );
       return;
     }
index faaa3057c927eb3960a614aff4be30f8e7528a85..7adaebaba3bb6bff1c0dd360b7c31ec673896f87 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed, FormHelper } from '../../../../testing/unit-test-helper';
 import { ComponentsModule } from '../../../shared/components/components.module';
 import { CdFormGroup } from '../../../shared/forms/cd-form-group';
 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
@@ -31,8 +31,7 @@ describe('UserPasswordFormComponent', () => {
       ToastrModule.forRoot(),
       SharedModule
     ],
-    declarations: [UserPasswordFormComponent],
-    providers: i18nProviders
+    declarations: [UserPasswordFormComponent]
   });
 
   beforeEach(() => {
index cf08a134fb33f6fb3fbe3405afaee41a6106a924..e7ef06c15a5082f609ee2349ba1baab5672dd2db 100644 (file)
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
 import { Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { UserService } from '../../../shared/api/user.service';
@@ -31,7 +30,6 @@ export class UserPasswordFormComponent {
   icons = Icons;
 
   constructor(
-    public i18n: I18n,
     public actionLabels: ActionLabelsI18n,
     public notificationService: NotificationService,
     public userService: UserService,
@@ -41,7 +39,7 @@ export class UserPasswordFormComponent {
     public passwordPolicyService: PasswordPolicyService
   ) {
     this.action = this.actionLabels.CHANGE;
-    this.resource = this.i18n('password');
+    this.resource = $localize`password`;
     this.createForm();
   }
 
@@ -115,7 +113,7 @@ export class UserPasswordFormComponent {
    * Override this in derived classes to change the behaviour.
    */
   onPasswordChange() {
-    this.notificationService.show(NotificationType.success, this.i18n('Updated user password"'));
+    this.notificationService.show(NotificationType.success, $localize`Updated user password"`);
     this.router.navigate(['/login']);
   }
 }
index 3d1d440824f86503960effb5c7c670f3879e4506..587925bf46b24a7a65f9792a31149a80e38f23a6 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { RbdService } from '../../../shared/api/rbd.service';
 import { PipesModule } from '../../../shared/pipes/pipes.module';
 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
@@ -19,7 +19,7 @@ describe('WorkbenchLayoutComponent', () => {
     imports: [RouterTestingModule, ToastrModule.forRoot(), PipesModule, HttpClientTestingModule],
     declarations: [WorkbenchLayoutComponent],
     schemas: [NO_ERRORS_SCHEMA],
-    providers: [AuthStorageService, i18nProviders, RbdService]
+    providers: [AuthStorageService, RbdService]
   });
 
   beforeEach(() => {
index 3111d482b02e14dc7601acad85abca25af868ae3..e7c2d97f35aa3cf1f39c9838672c11812c7188a6 100644 (file)
@@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { ExecutingTask } from '../../../shared/models/executing-task';
 import { SummaryService } from '../../../shared/services/summary.service';
 import { SharedModule } from '../../../shared/shared.module';
@@ -17,8 +17,7 @@ describe('NotificationsComponent', () => {
 
   configureTestBed({
     imports: [HttpClientTestingModule, SharedModule, ToastrModule.forRoot(), RouterTestingModule],
-    declarations: [NotificationsComponent],
-    providers: i18nProviders
+    declarations: [NotificationsComponent]
   });
 
   beforeEach(() => {
index 493fc920238dfc07cd0f52444050461630bd28bd..39bdf0c8183eb1385a19d0e4beda28f45fa5a1df 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { CrushRuleService } from './crush-rule.service';
 
 describe('CrushRuleService', () => {
@@ -11,7 +11,7 @@ describe('CrushRuleService', () => {
 
   configureTestBed({
     imports: [HttpClientTestingModule],
-    providers: [CrushRuleService, i18nProviders]
+    providers: [CrushRuleService]
   });
 
   beforeEach(() => {
index 74d061a0205122cb36ccf7082b4f509312a31e63..e4e7bb6054045780c70039052b7ac61117464019 100644 (file)
@@ -1,8 +1,6 @@
 import { HttpClient } from '@angular/common/http';
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { CrushRuleConfig } from '../models/crush-rule';
 
 @Injectable({
@@ -13,12 +11,12 @@ export class CrushRuleService {
 
   formTooltips = {
     // Copied from /doc/rados/operations/crush-map.rst
-    root: this.i18n(`The name of the node under which data should be placed.`),
-    failure_domain: this.i18n(`The type of CRUSH nodes across which we should separate replicas.`),
-    device_class: this.i18n(`The device class data should be placed on.`)
+    root: $localize`The name of the node under which data should be placed.`,
+    failure_domain: $localize`The type of CRUSH nodes across which we should separate replicas.`,
+    device_class: $localize`The device class data should be placed on.`
   };
 
-  constructor(private http: HttpClient, private i18n: I18n) {}
+  constructor(private http: HttpClient) {}
 
   create(rule: CrushRuleConfig) {
     return this.http.post(this.apiPath, rule, { observe: 'response' });
index 591ca879b6d1e6493d1a82c4f3245e4377a91aa5..88888b5222e7dade7a175f899e092b6fa572b277 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { ErasureCodeProfile } from '../models/erasure-code-profile';
 import { ErasureCodeProfileService } from './erasure-code-profile.service';
 
@@ -13,7 +13,7 @@ describe('ErasureCodeProfileService', () => {
 
   configureTestBed({
     imports: [HttpClientTestingModule],
-    providers: [ErasureCodeProfileService, i18nProviders]
+    providers: [ErasureCodeProfileService]
   });
 
   beforeEach(() => {
index f99841250f591c7cd0ca04f59f993e6e1ec26b19..47817367e7262c8e1612c5a51c806e1eb6d6c96a 100644 (file)
@@ -1,7 +1,6 @@
 import { HttpClient } from '@angular/common/http';
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Observable } from 'rxjs';
 
 import { ErasureCodeProfile } from '../models/erasure-code-profile';
@@ -14,25 +13,25 @@ export class ErasureCodeProfileService {
 
   formTooltips = {
     // Copied from /doc/rados/operations/erasure-code.*.rst
-    k: this.i18n(`Each object is split in data-chunks parts, each stored on a different OSD.`),
+    k: $localize`Each object is split in data-chunks parts, each stored on a different OSD.`,
 
-    m: this.i18n(`Compute coding chunks for each object and store them on different OSDs.
-      The number of coding chunks is also the number of OSDs that can be down without losing data.`),
+    m: $localize`Compute coding chunks for each object and store them on different OSDs.
+      The number of coding chunks is also the number of OSDs that can be down without losing data.`,
 
     plugins: {
       jerasure: {
-        description: this.i18n(`The jerasure plugin is the most generic and flexible plugin,
-          it is also the default for Ceph erasure coded pools.`),
-        technique: this.i18n(`The more flexible technique is reed_sol_van : it is enough to set k
+        description: $localize`The jerasure plugin is the most generic and flexible plugin,
+          it is also the default for Ceph erasure coded pools.`,
+        technique: $localize`The more flexible technique is reed_sol_van : it is enough to set k
           and m. The cauchy_good technique can be faster but you need to chose the packetsize
           carefully. All of reed_sol_r6_op, liberation, blaum_roth, liber8tion are RAID6 equivalents
-          in the sense that they can only be configured with m=2.`),
-        packetSize: this.i18n(`The encoding will be done on packets of bytes size at a time.
+          in the sense that they can only be configured with m=2.`,
+        packetSize: $localize`The encoding will be done on packets of bytes size at a time.
           Chosing the right packet size is difficult.
-          The jerasure documentation contains extensive information on this topic.`)
+          The jerasure documentation contains extensive information on this topic.`
       },
       lrc: {
-        description: this.i18n(`With the jerasure plugin, when an erasure coded object is stored on
+        description: $localize`With the jerasure plugin, when an erasure coded object is stored on
           multiple OSDs, recovering from the loss of one OSD requires reading from all the others.
           For instance if jerasure is configured with k=8 and m=4, losing one OSD requires reading
           from the eleven others to repair.
@@ -40,45 +39,43 @@ export class ErasureCodeProfileService {
           The lrc erasure code plugin creates local parity chunks to be able to recover using
           less OSDs. For instance if lrc is configured with k=8, m=4 and l=4, it will create
           an additional parity chunk for every four OSDs. When a single OSD is lost, it can be
-          recovered with only four OSDs instead of eleven.`),
-        l: this.i18n(`Group the coding and data chunks into sets of size locality. For instance,
+          recovered with only four OSDs instead of eleven.`,
+        l: $localize`Group the coding and data chunks into sets of size locality. For instance,
           for k=4 and m=2, when locality=3 two groups of three are created. Each set can
-          be recovered without reading chunks from another set.`),
-        crushLocality: this.i18n(`The type of the crush bucket in which each set of chunks defined
+          be recovered without reading chunks from another set.`,
+        crushLocality: $localize`The type of the crush bucket in which each set of chunks defined
           by l will be stored. For instance, if it is set to rack, each group of l chunks will be
           placed in a different rack. It is used to create a CRUSH rule step such as step choose
-          rack. If it is not set, no such grouping is done.`)
+          rack. If it is not set, no such grouping is done.`
       },
       isa: {
-        description: this.i18n(
-          `The isa plugin encapsulates the ISA library. It only runs on Intel processors.`
-        ),
-        technique: this.i18n(`The ISA plugin comes in two Reed Solomon forms.
-          If reed_sol_van is set, it is Vandermonde, if cauchy is set, it is Cauchy.`)
+        description: $localize`The isa plugin encapsulates the ISA library. It only runs on Intel processors.`,
+        technique: $localize`The ISA plugin comes in two Reed Solomon forms.
+          If reed_sol_van is set, it is Vandermonde, if cauchy is set, it is Cauchy.`
       },
       shec: {
-        description: this.i18n(`The shec plugin encapsulates the multiple SHEC library.
-          It allows ceph to recover data more efficiently than Reed Solomon codes.`),
-        c: this.i18n(`The number of parity chunks each of which includes each data chunk in its
+        description: $localize`The shec plugin encapsulates the multiple SHEC library.
+          It allows ceph to recover data more efficiently than Reed Solomon codes.`,
+        c: $localize`The number of parity chunks each of which includes each data chunk in its
           calculation range. The number is used as a durability estimator. For instance, if c=2,
-          2 OSDs can be down without losing data.`)
+          2 OSDs can be down without losing data.`
       }
     },
 
-    crushRoot: this.i18n(`The name of the crush bucket used for the first step of the CRUSH rule.
-      For instance step take default.`),
+    crushRoot: $localize`The name of the crush bucket used for the first step of the CRUSH rule.
+      For instance step take default.`,
 
-    crushFailureDomain: this.i18n(`Ensure that no two chunks are in a bucket with the same failure
+    crushFailureDomain: $localize`Ensure that no two chunks are in a bucket with the same failure
       domain. For instance, if the failure domain is host no two chunks will be stored on the same
-      host. It is used to create a CRUSH rule step such as step chooseleaf host.`),
+      host. It is used to create a CRUSH rule step such as step chooseleaf host.`,
 
-    crushDeviceClass: this.i18n(`Restrict placement to devices of a specific class
-      (e.g., ssd or hdd), using the crush device class names in the CRUSH map.`),
+    crushDeviceClass: $localize`Restrict placement to devices of a specific class
+      (e.g., ssd or hdd), using the crush device class names in the CRUSH map.`,
 
-    directory: this.i18n(`Set the directory name from which the erasure code plugin is loaded.`)
+    directory: $localize`Set the directory name from which the erasure code plugin is loaded.`
   };
 
-  constructor(private http: HttpClient, private i18n: I18n) {}
+  constructor(private http: HttpClient) {}
 
   list(): Observable<ErasureCodeProfile[]> {
     return this.http.get<ErasureCodeProfile[]>(this.apiPath);
index a960500705a94797174c7fc56b2e4fd034a0cffb..b90e816d97927b9bb076d21275bba01209ccf612 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { NfsService } from './nfs.service';
 
 describe('NfsService', () => {
@@ -9,7 +9,7 @@ describe('NfsService', () => {
   let httpTesting: HttpTestingController;
 
   configureTestBed({
-    providers: [NfsService, i18nProviders],
+    providers: [NfsService],
     imports: [HttpClientTestingModule]
   });
 
index f5de5bd412b3de662f39de6156cac6257e331f8c..e9858416919a397b82bd7ce55cf87bca889f868e 100644 (file)
@@ -1,8 +1,6 @@
 import { HttpClient } from '@angular/common/http';
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 @Injectable({
   providedIn: 'root'
 })
@@ -13,43 +11,40 @@ export class NfsService {
   nfsAccessType = [
     {
       value: 'RW',
-      help: this.i18n('Allows all operations')
+      help: $localize`Allows all operations`
     },
     {
       value: 'RO',
-      help: this.i18n('Allows only operations that do not modify the server')
+      help: $localize`Allows only operations that do not modify the server`
     },
     {
       value: 'MDONLY',
-      help: this.i18n('Does not allow read or write operations, but allows any other operation')
+      help: $localize`Does not allow read or write operations, but allows any other operation`
     },
     {
       value: 'MDONLY_RO',
-      help: this.i18n(
-        'Does not allow read, write, or any operation that modifies file \
-       attributes or directory content'
-      )
+      help: $localize`Does not allow read, write, or any operation that modifies file attributes or directory content`
     },
     {
       value: 'NONE',
-      help: this.i18n('Allows no access at all')
+      help: $localize`Allows no access at all`
     }
   ];
 
   nfsFsal = [
     {
       value: 'CEPH',
-      descr: this.i18n('CephFS')
+      descr: $localize`CephFS`
     },
     {
       value: 'RGW',
-      descr: this.i18n('Object Gateway')
+      descr: $localize`Object Gateway`
     }
   ];
 
   nfsSquash = ['no_root_squash', 'root_id_squash', 'root_squash', 'all_squash'];
 
-  constructor(private http: HttpClient, private i18n: I18n) {}
+  constructor(private http: HttpClient) {}
 
   list() {
     return this.http.get(`${this.apiPath}/export`);
index 41527a428ea36da72985b83bf5f3a90b3aa2e4eb..94c957e49c6ce2eaa0110c836a64afc328d6d0a0 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { OrchestratorService } from './orchestrator.service';
 
 describe('OrchestratorService', () => {
@@ -10,7 +10,7 @@ describe('OrchestratorService', () => {
   const apiPath = 'api/orchestrator';
 
   configureTestBed({
-    providers: [OrchestratorService, i18nProviders],
+    providers: [OrchestratorService],
     imports: [HttpClientTestingModule]
   });
 
index 4c8e7eeedeb4ccb3892c282b3264004d8daa6e7e..e96a13ae3066c4565adaacff33ceb76a399b67eb 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { OsdService } from './osd.service';
 
 describe('OsdService', () => {
@@ -9,7 +9,7 @@ describe('OsdService', () => {
   let httpTesting: HttpTestingController;
 
   configureTestBed({
-    providers: [OsdService, i18nProviders],
+    providers: [OsdService],
     imports: [HttpClientTestingModule]
   });
 
index ea407605da6fa45a0ac8e6aa1c90e4e5d12b8721..cc088d0e95f602e53b9acdebf53020fc2dab7e39 100644 (file)
@@ -1,7 +1,6 @@
 import { HttpClient } from '@angular/common/http';
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { map } from 'rxjs/operators';
 
@@ -19,7 +18,7 @@ export class OsdService {
     KNOWN_PRIORITIES: [
       {
         name: null,
-        text: this.i18n('-- Select the priority --'),
+        text: $localize`-- Select the priority --`,
         values: {
           osd_max_backfills: null,
           osd_recovery_max_active: null,
@@ -29,7 +28,7 @@ export class OsdService {
       },
       {
         name: 'low',
-        text: this.i18n('Low'),
+        text: $localize`Low`,
         values: {
           osd_max_backfills: 1,
           osd_recovery_max_active: 1,
@@ -39,7 +38,7 @@ export class OsdService {
       },
       {
         name: 'default',
-        text: this.i18n('Default'),
+        text: $localize`Default`,
         values: {
           osd_max_backfills: 1,
           osd_recovery_max_active: 3,
@@ -49,7 +48,7 @@ export class OsdService {
       },
       {
         name: 'high',
-        text: this.i18n('High'),
+        text: $localize`High`,
         values: {
           osd_max_backfills: 4,
           osd_recovery_max_active: 4,
@@ -60,7 +59,7 @@ export class OsdService {
     ]
   };
 
-  constructor(private http: HttpClient, private i18n: I18n, private deviceService: DeviceService) {}
+  constructor(private http: HttpClient, private deviceService: DeviceService) {}
 
   create(driveGroups: Object[]) {
     const request = {
index 197864d22a7d1fd803f2e37d52f2decea2abf8d5..c0e7cb0eabb911583df792ae6dc7fd9320d3d18d 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { fakeAsync, TestBed, tick } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { RbdConfigurationSourceField } from '../models/configuration';
 import { RbdConfigurationService } from '../services/rbd-configuration.service';
 import { PoolService } from './pool.service';
@@ -12,7 +12,7 @@ describe('PoolService', () => {
   const apiPath = 'api/pool';
 
   configureTestBed({
-    providers: [PoolService, RbdConfigurationService, i18nProviders],
+    providers: [PoolService, RbdConfigurationService],
     imports: [HttpClientTestingModule]
   });
 
index a9f3a36a437304636a39535a645c2c97a1a1b3f4..72af80b977d9f1c975e767707608532a51775a44 100644 (file)
@@ -1,7 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { ImageSpec } from '../models/image-spec';
 import { RbdConfigurationService } from '../services/rbd-configuration.service';
 import { RbdService } from './rbd.service';
@@ -11,7 +11,7 @@ describe('RbdService', () => {
   let httpTesting: HttpTestingController;
 
   configureTestBed({
-    providers: [RbdService, RbdConfigurationService, i18nProviders],
+    providers: [RbdService, RbdConfigurationService],
     imports: [HttpClientTestingModule]
   });
 
index d1ed14d57a22f6f2a085f552fd3efc7d2ce7d6f2..6b73b47c3b835702f9981194b75365aaa86a3d71 100644 (file)
@@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { NgbAlertModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { AlertPanelComponent } from './alert-panel.component';
 
 describe('AlertPanelComponent', () => {
@@ -11,8 +11,7 @@ describe('AlertPanelComponent', () => {
 
   configureTestBed({
     declarations: [AlertPanelComponent],
-    imports: [NgbAlertModule],
-    providers: [i18nProviders]
+    imports: [NgbAlertModule]
   });
 
   beforeEach(() => {
index d457a0ed7efe2c5be947e3d14b15e533a014b9a9..f72aa73c11272aa625463a6c254ab42bd32c0c9a 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, Input, OnInit } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { Icons } from '../../enum/icons.enum';
 
 @Component({
@@ -27,27 +25,25 @@ export class AlertPanelComponent implements OnInit {
 
   icons = Icons;
 
-  constructor(private i18n: I18n) {}
-
   ngOnInit() {
     switch (this.type) {
       case 'warning':
-        this.title = this.title || this.i18n('Warning');
+        this.title = this.title || $localize`Warning`;
         this.typeIcon = this.typeIcon || Icons.warning;
         this.bootstrapClass = this.bootstrapClass || 'warning';
         break;
       case 'error':
-        this.title = this.title || this.i18n('Error');
+        this.title = this.title || $localize`Error`;
         this.typeIcon = this.typeIcon || Icons.destroyCircle;
         this.bootstrapClass = this.bootstrapClass || 'danger';
         break;
       case 'info':
-        this.title = this.title || this.i18n('Information');
+        this.title = this.title || $localize`Information`;
         this.typeIcon = this.typeIcon || Icons.infoCircle;
         this.bootstrapClass = this.bootstrapClass || 'info';
         break;
       case 'success':
-        this.title = this.title || this.i18n('Success');
+        this.title = this.title || $localize`Success`;
         this.typeIcon = this.typeIcon || Icons.check;
         this.bootstrapClass = this.bootstrapClass || 'success';
         break;
index 150e0567a169159026b876b8e3b96ea5ceac836e..7b62b625683e2b8bee28196bea7e8b6fba8dda24 100644 (file)
@@ -1,7 +1,7 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { BackButtonComponent } from './back-button.component';
 
 describe('BackButtonComponent', () => {
@@ -10,8 +10,7 @@ describe('BackButtonComponent', () => {
 
   configureTestBed({
     imports: [RouterTestingModule],
-    declarations: [BackButtonComponent],
-    providers: [i18nProviders]
+    declarations: [BackButtonComponent]
   });
 
   beforeEach(() => {
index c66910a5ea2fc513779640b8a4774501ddb0f8cd..dca77404a0d5da85caba9edaf118769ef13a2d31 100644 (file)
@@ -6,11 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal, NgbModalModule, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 
-import {
-  configureTestBed,
-  FixtureHelper,
-  i18nProviders
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, FixtureHelper } from '../../../../testing/unit-test-helper';
 import { ModalService } from '../../services/modal.service';
 import { BackButtonComponent } from '../back-button/back-button.component';
 import { ModalComponent } from '../modal/modal.component';
@@ -84,7 +80,7 @@ describe('ConfirmationModalComponent', () => {
     ],
     schemas: [NO_ERRORS_SCHEMA],
     imports: [ReactiveFormsModule, MockModule, RouterTestingModule, NgbModalModule],
-    providers: [NgbActiveModal, i18nProviders, SubmitButtonComponent]
+    providers: [NgbActiveModal, SubmitButtonComponent]
   });
 
   beforeEach(() => {
index fbf10aa4594eeeca70fbd31bbaaaaf32c0422730..653b00bc4aa208760ca29ce168f26b5b232b52a7 100755 (executable)
@@ -5,12 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 
-import {
-  configureTestBed,
-  FixtureHelper,
-  FormHelper,
-  i18nProviders
-} from '../../../../testing/unit-test-helper';
+import { configureTestBed, FixtureHelper, FormHelper } from '../../../../testing/unit-test-helper';
 import { CdValidators } from '../../forms/cd-validators';
 import { SharedModule } from '../../shared.module';
 import { FormModalComponent } from './form-modal.component';
@@ -58,7 +53,7 @@ describe('InputModalComponent', () => {
       ReactiveFormsModule,
       SharedModule
     ],
-    providers: [i18nProviders, NgbActiveModal]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index a4017941229092e3e8c9c8874718ee7790e7cec1..b8dad67a46b5d567ddd763da7a174cd0efcb2927 100755 (executable)
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
 import { FormControl, ValidatorFn, Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { CdFormBuilder } from '../../forms/cd-form-builder';
@@ -31,8 +30,7 @@ export class FormModalComponent implements OnInit {
     public activeModal: NgbActiveModal,
     private formBuilder: CdFormBuilder,
     private formatter: FormatterService,
-    private dimlessBinaryPipe: DimlessBinaryPipe,
-    private i18n: I18n
+    private dimlessBinaryPipe: DimlessBinaryPipe
   ) {}
 
   ngOnInit() {
@@ -86,12 +84,12 @@ export class FormModalComponent implements OnInit {
     if (['binaryMin', 'binaryMax'].includes(error)) {
       // binaryMin and binaryMax return a function that take I18n to
       // provide a translated error message.
-      return errorContext(this.i18n);
+      return errorContext();
     }
     if (error === 'required') {
-      return this.i18n('This field is required.');
+      return $localize`This field is required.`;
     }
-    return this.i18n('An error occurred.');
+    return $localize`An error occurred.`;
   }
 
   onSubmitForm(values: any) {
index 0568fc5806abe51136fc7c2cd237993480b63d69..fb7747cabf5bd649362bda23a2f9b81df4f86ccc 100644 (file)
@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { NgbAlertModule } from '@ng-bootstrap/ng-bootstrap';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SummaryService } from '../../../shared/services/summary.service';
 import { SettingsService } from '../../api/settings.service';
 import { CephReleaseNamePipe } from '../../pipes/ceph-release-name.pipe';
@@ -21,7 +21,7 @@ describe('GrafanaComponent', () => {
   configureTestBed({
     declarations: [GrafanaComponent, AlertPanelComponent, LoadingPanelComponent],
     imports: [NgbAlertModule, HttpClientTestingModule, RouterTestingModule, FormsModule],
-    providers: [CephReleaseNamePipe, SettingsService, SummaryService, i18nProviders]
+    providers: [CephReleaseNamePipe, SettingsService, SummaryService]
   });
 
   beforeEach(() => {
index afb4136189005b68b0e982cd2aea5952b541ec20..827210ccb6b3ef41f44d2ecf5e155f5af7aafe8a 100644 (file)
@@ -1,8 +1,6 @@
 import { Component, Input, OnChanges, OnInit } from '@angular/core';
 import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { Icons } from '../../../shared/enum/icons.enum';
 import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
 import { SummaryService } from '../../../shared/services/summary.service';
@@ -44,128 +42,127 @@ export class GrafanaComponent implements OnInit, OnChanges {
     private summaryService: SummaryService,
     private sanitizer: DomSanitizer,
     private settingsService: SettingsService,
-    private cephReleaseNamePipe: CephReleaseNamePipe,
-    private i18n: I18n
+    private cephReleaseNamePipe: CephReleaseNamePipe
   ) {
     this.grafanaTimes = [
       {
-        name: this.i18n('Last 5 minutes'),
+        name: $localize`Last 5 minutes`,
         value: 'from=now-5m&to=now'
       },
       {
-        name: this.i18n('Last 15 minutes'),
+        name: $localize`Last 15 minutes`,
         value: 'from=now-15m&to=now'
       },
       {
-        name: this.i18n('Last 30 minutes'),
+        name: $localize`Last 30 minutes`,
         value: 'from=now-30m&to=now'
       },
       {
-        name: this.i18n('Last 1 hour (Default)'),
+        name: $localize`Last 1 hour (Default)`,
         value: 'from=now-1h&to=now'
       },
       {
-        name: this.i18n('Last 3 hours'),
+        name: $localize`Last 3 hours`,
         value: 'from=now-3h&to=now'
       },
       {
-        name: this.i18n('Last 6 hours'),
+        name: $localize`Last 6 hours`,
         value: 'from=now-6h&to=now'
       },
       {
-        name: this.i18n('Last 12 hours'),
+        name: $localize`Last 12 hours`,
         value: 'from=now-12h&to=now'
       },
       {
-        name: this.i18n('Last 24 hours'),
+        name: $localize`Last 24 hours`,
         value: 'from=now-24h&to=now'
       },
       {
-        name: this.i18n('Yesterday'),
+        name: $localize`Yesterday`,
         value: 'from=now-1d%2Fd&to=now-1d%2Fd'
       },
       {
-        name: this.i18n('Today'),
+        name: $localize`Today`,
         value: 'from=now%2Fd&to=now%2Fd'
       },
       {
-        name: this.i18n('Today so far'),
+        name: $localize`Today so far`,
         value: 'from=now%2Fd&to=now'
       },
       {
-        name: this.i18n('Day before yesterday'),
+        name: $localize`Day before yesterday`,
         value: 'from=now-2d%2Fd&to=now-2d%2Fd'
       },
       {
-        name: this.i18n('Last 2 days'),
+        name: $localize`Last 2 days`,
         value: 'from=now-2d&to=now'
       },
       {
-        name: this.i18n('This day last week'),
+        name: $localize`This day last week`,
         value: 'from=now-7d%2Fd&to=now-7d%2Fd'
       },
       {
-        name: this.i18n('Previous week'),
+        name: $localize`Previous week`,
         value: 'from=now-1w%2Fw&to=now-1w%2Fw'
       },
       {
-        name: this.i18n('This week'),
+        name: $localize`This week`,
         value: 'from=now%2Fw&to=now%2Fw'
       },
       {
-        name: this.i18n('This week so far'),
+        name: $localize`This week so far`,
         value: 'from=now%2Fw&to=now'
       },
       {
-        name: this.i18n('Last 7 days'),
+        name: $localize`Last 7 days`,
         value: 'from=now-7d&to=now'
       },
       {
-        name: this.i18n('Previous month'),
+        name: $localize`Previous month`,
         value: 'from=now-1M%2FM&to=now-1M%2FM'
       },
       {
-        name: this.i18n('This month'),
+        name: $localize`This month`,
         value: 'from=now%2FM&to=now%2FM'
       },
       {
-        name: this.i18n('This month so far'),
+        name: $localize`This month so far`,
         value: 'from=now%2FM&to=now'
       },
       {
-        name: this.i18n('Last 30 days'),
+        name: $localize`Last 30 days`,
         value: 'from=now-30d&to=now'
       },
       {
-        name: this.i18n('Last 90 days'),
+        name: $localize`Last 90 days`,
         value: 'from=now-90d&to=now'
       },
       {
-        name: this.i18n('Last 6 months'),
+        name: $localize`Last 6 months`,
         value: 'from=now-6M&to=now'
       },
       {
-        name: this.i18n('Last 1 year'),
+        name: $localize`Last 1 year`,
         value: 'from=now-1y&to=now'
       },
       {
-        name: this.i18n('Previous year'),
+        name: $localize`Previous year`,
         value: 'from=now-1y%2Fy&to=now-1y%2Fy'
       },
       {
-        name: this.i18n('This year'),
+        name: $localize`This year`,
         value: 'from=now%2Fy&to=now%2Fy'
       },
       {
-        name: this.i18n('This year so far'),
+        name: $localize`This year so far`,
         value: 'from=now%2Fy&to=now'
       },
       {
-        name: this.i18n('Last 2 years'),
+        name: $localize`Last 2 years`,
         value: 'from=now-2y&to=now'
       },
       {
-        name: this.i18n('Last 5 years'),
+        name: $localize`Last 5 years`,
         value: 'from=now-5y&to=now'
       }
     ];
index fa3790b18fbb2b250344b84e97c893b26e522b29..857595f07d0791eba688401b26cb53984b9e0beb 100644 (file)
@@ -8,7 +8,7 @@ import { ClickOutsideModule } from 'ng-click-outside';
 import { ToastrModule } from 'ngx-toastr';
 import { SimplebarAngularModule } from 'simplebar-angular';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { PrometheusService } from '../../api/prometheus.service';
 import { RbdService } from '../../api/rbd.service';
 import { SettingsService } from '../../api/settings.service';
@@ -39,14 +39,7 @@ describe('NotificationsSidebarComponent', () => {
       ClickOutsideModule
     ],
     declarations: [NotificationsSidebarComponent],
-    providers: [
-      i18nProviders,
-      PrometheusService,
-      SettingsService,
-      SummaryService,
-      NotificationService,
-      RbdService
-    ]
+    providers: [PrometheusService, SettingsService, SummaryService, NotificationService, RbdService]
   });
 
   beforeEach(() => {
index 2bcf2ae317fff9f1bbd2fcb65e4754fa5b2976ed..ef4ed3eb12cc0c97cecc99d0128ba367d88dc228 100644 (file)
@@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { ComponentsModule } from '../components.module';
 import { OrchestratorDocModalComponent } from './orchestrator-doc-modal.component';
 
@@ -14,7 +14,7 @@ describe('OrchestratorDocModalComponent', () => {
 
   configureTestBed({
     imports: [ComponentsModule, HttpClientTestingModule, RouterTestingModule],
-    providers: [NgbActiveModal, i18nProviders]
+    providers: [NgbActiveModal]
   });
 
   beforeEach(() => {
index e2c7935127b20fcb8719f4e5cd02802a308b29ab..27b42fa707e48b04748c9f01916f8fc4f9356901 100644 (file)
@@ -2,7 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { CephReleaseNamePipe } from '../../pipes/ceph-release-name.pipe';
 import { SummaryService } from '../../services/summary.service';
 import { ComponentsModule } from '../components.module';
@@ -14,7 +14,7 @@ describe('OrchestratorDocPanelComponent', () => {
 
   configureTestBed({
     imports: [ComponentsModule, HttpClientTestingModule, RouterTestingModule],
-    providers: [CephReleaseNamePipe, SummaryService, i18nProviders]
+    providers: [CephReleaseNamePipe, SummaryService]
   });
 
   beforeEach(() => {
index 8986901b3b442823650b91094b071ea5d2b44ce3..c71d058fb040aa79b037369363bcea7568576f85 100644 (file)
@@ -2,9 +2,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { ReactiveFormsModule, Validators } from '@angular/forms';
 
 import { NgbPopoverModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SelectMessages } from '../select/select-messages.model';
 import { SelectComponent } from '../select/select.component';
 import { SelectBadgesComponent } from './select-badges.component';
@@ -15,8 +14,7 @@ describe('SelectBadgesComponent', () => {
 
   configureTestBed({
     declarations: [SelectBadgesComponent, SelectComponent],
-    imports: [NgbPopoverModule, NgbTooltipModule, ReactiveFormsModule],
-    providers: i18nProviders
+    imports: [NgbPopoverModule, NgbTooltipModule, ReactiveFormsModule]
   });
 
   beforeEach(() => {
@@ -35,8 +33,7 @@ describe('SelectBadgesComponent', () => {
       { name: 'option1', description: '', selected: false, enabled: true },
       { name: 'option2', description: '', selected: false, enabled: true }
     ];
-    const i18n = TestBed.inject(I18n);
-    const messages = new SelectMessages({ empty: 'foo bar' }, i18n);
+    const messages = new SelectMessages({ empty: 'foo bar' });
     const selectionLimit = 2;
     const customBadges = true;
     const customBadgeValidators = [Validators.required];
index 9c4e381aa9b3051701dbed9dbab921cddaa8c0e4..17d05ed4b48d76c81325374d31ac113686030bdd 100644 (file)
@@ -1,8 +1,6 @@
 import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
 import { ValidatorFn } from '@angular/forms';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { Icons } from '../../../shared/enum/icons.enum';
 import { SelectMessages } from '../select/select-messages.model';
 import { SelectOption } from '../select/select-option.model';
@@ -19,7 +17,7 @@ export class SelectBadgesComponent {
   @Input()
   options: Array<SelectOption> = [];
   @Input()
-  messages = new SelectMessages({}, this.i18n);
+  messages = new SelectMessages({});
   @Input()
   selectionLimit: number;
   @Input()
@@ -34,6 +32,4 @@ export class SelectBadgesComponent {
   cdSelect: SelectComponent;
 
   icons = Icons;
-
-  constructor(private i18n: I18n) {}
 }
index 3f1f9fd264f97efc152101692f13e66c09e62b05..6362b4e26cb564d4cc4481a895f66d8f12d48105 100644 (file)
@@ -1,9 +1,6 @@
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 export class SelectMessages {
-  i18n: I18n;
-
   empty: string;
   selectionLimit: any;
   customValidations = {};
@@ -11,17 +8,15 @@ export class SelectMessages {
   add: string;
   noOptions: string;
 
-  constructor(messages: {}, i18n: I18n) {
-    this.i18n = i18n;
-
-    this.empty = this.i18n('No items selected.');
+  constructor(messages: {}) {
+    this.empty = $localize`No items selected.`;
     this.selectionLimit = {
-      tooltip: this.i18n('Deselect item to select again'),
-      text: this.i18n('Selection limit reached')
+      tooltip: $localize`Deselect item to select again`,
+      text: $localize`Selection limit reached`
     };
-    this.filter = this.i18n('Filter tags');
-    this.add = this.i18n('Add badge'); // followed by " '{{filter.value}}'"
-    this.noOptions = this.i18n('There are no items available.');
+    this.filter = $localize`Filter tags`;
+    this.add = $localize`Add badge`; // followed by " '{{filter.value}}'"
+    this.noOptions = $localize`There are no items available.`;
 
     _.merge(this, messages);
   }
index 45bb8d38ba748526f5b8dc4459b59ba291ba13f4..4d1e78624e704e8dc80801935603055650087956 100644 (file)
@@ -3,7 +3,7 @@ import { ReactiveFormsModule, Validators } from '@angular/forms';
 
 import { NgbPopoverModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SelectOption } from './select-option.model';
 import { SelectComponent } from './select.component';
 
@@ -19,8 +19,7 @@ describe('SelectComponent', () => {
 
   configureTestBed({
     declarations: [SelectComponent],
-    imports: [NgbPopoverModule, NgbTooltipModule, ReactiveFormsModule],
-    providers: i18nProviders
+    imports: [NgbPopoverModule, NgbTooltipModule, ReactiveFormsModule]
   });
 
   beforeEach(() => {
index ad3a97c09a3c4a20a9f96863b8ebe1cabf0616b7..e4b780fcdf956ca38163ede2c84a188288cf889b 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
 import { FormControl, ValidatorFn } from '@angular/forms';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import { Icons } from '../../../shared/enum/icons.enum';
@@ -22,7 +21,7 @@ export class SelectComponent implements OnInit, OnChanges {
   @Input()
   options: Array<SelectOption> = [];
   @Input()
-  messages = new SelectMessages({}, this.i18n);
+  messages = new SelectMessages({});
   @Input()
   selectionLimit: number;
   @Input()
@@ -39,8 +38,6 @@ export class SelectComponent implements OnInit, OnChanges {
   filteredOptions: Array<SelectOption> = [];
   icons = Icons;
 
-  constructor(private i18n: I18n) {}
-
   ngOnInit() {
     this.initFilter();
     if (this.data.length > 0) {
index 2aac85321116ea6569d9a0fe01693e9c6f8ed251..484770b0905beb34ba27abb5185c05422f3b920e 100644 (file)
@@ -13,7 +13,6 @@ describe('SparklineComponent', () => {
   configureTestBed({
     declarations: [SparklineComponent],
     schemas: [NO_ERRORS_SCHEMA],
-    imports: [],
     providers: [DimlessBinaryPipe, FormatterService]
   });
 
index 7f2b4725193b98443f6da31fc95202828efbee3f..cc9fa591c3185c0375897da7e880402d9ed1e329 100644 (file)
@@ -5,7 +5,7 @@ import { NgbAlertModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { UserFormModel } from '../../../core/auth/user-form/user-form.model';
 import { MgrModuleService } from '../../api/mgr-module.service';
 import { UserService } from '../../api/user.service';
@@ -59,7 +59,7 @@ describe('TelemetryActivationNotificationComponent', () => {
   configureTestBed({
     declarations: [TelemetryNotificationComponent],
     imports: [NgbAlertModule, HttpClientTestingModule, ToastrModule.forRoot(), PipesModule],
-    providers: [MgrModuleService, UserService, i18nProviders]
+    providers: [MgrModuleService, UserService]
   });
 
   beforeEach(() => {
index 4b881e2f8e0b1a86d1830fc4d34bb04c787d75ff..ce3e97fd516c4058e21e449af9257b5014c5112f 100644 (file)
@@ -1,7 +1,5 @@
 import { Component, OnDestroy, OnInit } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { UserFormModel } from '../../../core/auth/user-form/user-form.model';
 import { MgrModuleService } from '../../api/mgr-module.service';
 import { UserService } from '../../api/user.service';
@@ -23,8 +21,7 @@ export class TelemetryNotificationComponent implements OnInit, OnDestroy {
     private authStorageService: AuthStorageService,
     private userService: UserService,
     private notificationService: NotificationService,
-    private telemetryNotificationService: TelemetryNotificationService,
-    private i18n: I18n
+    private telemetryNotificationService: TelemetryNotificationService
   ) {}
 
   ngOnInit() {
@@ -59,10 +56,9 @@ export class TelemetryNotificationComponent implements OnInit, OnDestroy {
     localStorage.setItem('telemetry_notification_hidden', 'true');
     this.notificationService.show(
       NotificationType.success,
-      this.i18n('Telemetry activation reminder muted'),
-      this.i18n(
-        'You can activate the module on the Telemetry configuration page (<b>Dashboard Settings</b> -> <b>Telemetry configuration</b>) at any time.'
-      )
+      $localize`Telemetry activation reminder muted`,
+      $localize`You can activate the module on the Telemetry configuration \
+page (<b>Dashboard Settings</b> -> <b>Telemetry configuration</b>) at any time.`
     );
   }
 }
index 802c0d96f34eaeff23cba136469b9c3774ac5fba..5f8d310d9c5248d2901cce12d4ca0cd3b678e1a8 100644 (file)
@@ -1,7 +1,5 @@
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 export class AppConstants {
   public static readonly organization = 'ceph';
   public static readonly projectName = 'Ceph Dashboard';
@@ -109,52 +107,52 @@ export class ActionLabelsI18n {
   UNSET: string;
   UPDATE: string;
 
-  constructor(private i18n: I18n) {
+  constructor() {
     /* Create a new item */
-    this.CREATE = this.i18n('Create');
+    this.CREATE = $localize`Create`;
 
     /* Destroy an existing item */
-    this.DELETE = this.i18n('Delete');
+    this.DELETE = $localize`Delete`;
 
     /* Add an existing item to a container */
-    this.ADD = this.i18n('Add');
-    this.SET = this.i18n('Set');
+    this.ADD = $localize`Add`;
+    this.SET = $localize`Set`;
 
     /* Remove an item from a container WITHOUT deleting it */
-    this.REMOVE = this.i18n('Remove');
-    this.UNSET = this.i18n('Unset');
+    this.REMOVE = $localize`Remove`;
+    this.UNSET = $localize`Unset`;
 
     /* Make changes to an existing item */
-    this.EDIT = this.i18n('Edit');
-    this.UPDATE = this.i18n('Update');
-    this.CANCEL = this.i18n('Cancel');
+    this.EDIT = $localize`Edit`;
+    this.UPDATE = $localize`Update`;
+    this.CANCEL = $localize`Cancel`;
 
     /* Non-standard actions */
-    this.CLONE = this.i18n('Clone');
-    this.COPY = this.i18n('Copy');
-    this.DEEP_SCRUB = this.i18n('Deep Scrub');
-    this.DESTROY = this.i18n('Destroy');
-    this.EVICT = this.i18n('Evict');
-    this.FLATTEN = this.i18n('Flatten');
-    this.MARK_DOWN = this.i18n('Mark Down');
-    this.MARK_IN = this.i18n('Mark In');
-    this.MARK_LOST = this.i18n('Mark Lost');
-    this.MARK_OUT = this.i18n('Mark Out');
-    this.PROTECT = this.i18n('Protect');
-    this.PURGE = this.i18n('Purge');
-    this.RENAME = this.i18n('Rename');
-    this.RESTORE = this.i18n('Restore');
-    this.REWEIGHT = this.i18n('Reweight');
-    this.ROLLBACK = this.i18n('Rollback');
-    this.SCRUB = this.i18n('Scrub');
-    this.SHOW = this.i18n('Show');
-    this.TRASH = this.i18n('Move to Trash');
-    this.UNPROTECT = this.i18n('Unprotect');
-    this.CHANGE = this.i18n('Change');
+    this.CLONE = $localize`Clone`;
+    this.COPY = $localize`Copy`;
+    this.DEEP_SCRUB = $localize`Deep Scrub`;
+    this.DESTROY = $localize`Destroy`;
+    this.EVICT = $localize`Evict`;
+    this.FLATTEN = $localize`Flatten`;
+    this.MARK_DOWN = $localize`Mark Down`;
+    this.MARK_IN = $localize`Mark In`;
+    this.MARK_LOST = $localize`Mark Lost`;
+    this.MARK_OUT = $localize`Mark Out`;
+    this.PROTECT = $localize`Protect`;
+    this.PURGE = $localize`Purge`;
+    this.RENAME = $localize`Rename`;
+    this.RESTORE = $localize`Restore`;
+    this.REWEIGHT = $localize`Reweight`;
+    this.ROLLBACK = $localize`Rollback`;
+    this.SCRUB = $localize`Scrub`;
+    this.SHOW = $localize`Show`;
+    this.TRASH = $localize`Move to Trash`;
+    this.UNPROTECT = $localize`Unprotect`;
+    this.CHANGE = $localize`Change`;
 
     /* Prometheus wording */
-    this.RECREATE = this.i18n('Recreate');
-    this.EXPIRE = this.i18n('Expire');
+    this.RECREATE = $localize`Recreate`;
+    this.EXPIRE = $localize`Expire`;
   }
 }
 
@@ -194,47 +192,47 @@ export class SucceededActionLabelsI18n {
   RECREATED: string;
   EXPIRED: string;
 
-  constructor(private i18n: I18n) {
+  constructor() {
     /* Create a new item */
-    this.CREATED = this.i18n('Created');
+    this.CREATED = $localize`Created`;
 
     /* Destroy an existing item */
-    this.DELETED = this.i18n('Deleted');
+    this.DELETED = $localize`Deleted`;
 
     /* Add an existing item to a container */
-    this.ADDED = this.i18n('Added');
+    this.ADDED = $localize`Added`;
 
     /* Remove an item from a container WITHOUT deleting it */
-    this.REMOVED = this.i18n('Removed');
+    this.REMOVED = $localize`Removed`;
 
     /* Make changes to an existing item */
-    this.EDITED = this.i18n('Edited');
-    this.CANCELED = this.i18n('Canceled');
+    this.EDITED = $localize`Edited`;
+    this.CANCELED = $localize`Canceled`;
 
     /* Non-standard actions */
-    this.CLONED = this.i18n('Cloned');
-    this.COPIED = this.i18n('Copied');
-    this.DEEP_SCRUBBED = this.i18n('Deep Scrubbed');
-    this.DESTROYED = this.i18n('Destroyed');
-    this.FLATTENED = this.i18n('Flattened');
-    this.MARKED_DOWN = this.i18n('Marked Down');
-    this.MARKED_IN = this.i18n('Marked In');
-    this.MARKED_LOST = this.i18n('Marked Lost');
-    this.MARKED_OUT = this.i18n('Marked Out');
-    this.PROTECTED = this.i18n('Protected');
-    this.PURGED = this.i18n('Purged');
-    this.RENAMED = this.i18n('Renamed');
-    this.RESTORED = this.i18n('Restored');
-    this.REWEIGHTED = this.i18n('Reweighted');
-    this.ROLLED_BACK = this.i18n('Rolled back');
-    this.SCRUBBED = this.i18n('Scrubbed');
-    this.SHOWED = this.i18n('Showed');
-    this.TRASHED = this.i18n('Moved to Trash');
-    this.UNPROTECTED = this.i18n('Unprotected');
-    this.CHANGE = this.i18n('Change');
+    this.CLONED = $localize`Cloned`;
+    this.COPIED = $localize`Copied`;
+    this.DEEP_SCRUBBED = $localize`Deep Scrubbed`;
+    this.DESTROYED = $localize`Destroyed`;
+    this.FLATTENED = $localize`Flattened`;
+    this.MARKED_DOWN = $localize`Marked Down`;
+    this.MARKED_IN = $localize`Marked In`;
+    this.MARKED_LOST = $localize`Marked Lost`;
+    this.MARKED_OUT = $localize`Marked Out`;
+    this.PROTECTED = $localize`Protected`;
+    this.PURGED = $localize`Purged`;
+    this.RENAMED = $localize`Renamed`;
+    this.RESTORED = $localize`Restored`;
+    this.REWEIGHTED = $localize`Reweighted`;
+    this.ROLLED_BACK = $localize`Rolled back`;
+    this.SCRUBBED = $localize`Scrubbed`;
+    this.SHOWED = $localize`Showed`;
+    this.TRASHED = $localize`Moved to Trash`;
+    this.UNPROTECTED = $localize`Unprotected`;
+    this.CHANGE = $localize`Change`;
 
     /* Prometheus wording */
-    this.RECREATED = this.i18n('Recreated');
-    this.EXPIRED = this.i18n('Expired');
+    this.RECREATED = $localize`Recreated`;
+    this.EXPIRED = $localize`Expired`;
   }
 }
index e4f09edd03c19bf8b2681f0c210c0bc23b3617ec..e50fd86332c435b970d370bdf648105f3e4e58cc 100644 (file)
@@ -1,18 +1,8 @@
-import { TestBed } from '@angular/core/testing';
-
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
 import { Copy2ClipboardButtonDirective } from './copy2clipboard-button.directive';
 
 describe('Copy2clipboardButtonDirective', () => {
-  configureTestBed({
-    providers: [i18nProviders]
-  });
-
   it('should create an instance', () => {
-    const i18n = TestBed.inject(I18n);
-    const directive = new Copy2ClipboardButtonDirective(null, null, null, i18n);
+    const directive = new Copy2ClipboardButtonDirective(null, null, null);
     expect(directive).toBeTruthy();
   });
 });
index ff5218acb70fdbd3b68329b2fe2c150504e6a4d9..78e4767e53946e6986dc08fdbe421c169d8f05cf 100644 (file)
@@ -1,6 +1,5 @@
 import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2 } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { ToastrService } from 'ngx-toastr';
 
 @Directive({
@@ -13,15 +12,14 @@ export class Copy2ClipboardButtonDirective implements OnInit {
   constructor(
     private elementRef: ElementRef,
     private renderer: Renderer2,
-    private toastr: ToastrService,
-    private i18n: I18n
+    private toastr: ToastrService
   ) {}
 
   ngOnInit() {
     const iElement = this.renderer.createElement('i');
     this.renderer.addClass(iElement, 'fa');
     this.renderer.addClass(iElement, 'fa-clipboard');
-    this.renderer.setAttribute(iElement, 'title', this.i18n('Copy to clipboard'));
+    this.renderer.setAttribute(iElement, 'title', $localize`Copy to clipboard`);
     this.renderer.appendChild(this.elementRef.nativeElement, iElement);
   }
 
index d30233a69b9ae36b1dd3dca9e101cf85f18a092a..ed9299124ae9212ec4ad9e98ffacd7b1fb4eee5d 100644 (file)
@@ -4,7 +4,7 @@ import { By } from '@angular/platform-browser';
 
 import { NgbAlertModule } from '@ng-bootstrap/ng-bootstrap';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { AlertPanelComponent } from '../components/alert-panel/alert-panel.component';
 import { LoadingPanelComponent } from '../components/loading-panel/loading-panel.component';
 import { CdForm } from '../forms/cd-form';
@@ -31,8 +31,7 @@ describe('FormLoadingDirective', () => {
   configureTestBed(
     {
       declarations: [TestComponent],
-      imports: [SharedModule, NgbAlertModule],
-      providers: [i18nProviders]
+      imports: [SharedModule, NgbAlertModule]
     },
     [LoadingPanelComponent, AlertPanelComponent]
   );
@@ -48,7 +47,7 @@ describe('FormLoadingDirective', () => {
   });
 
   it('should create an instance', () => {
-    const directive = new FormLoadingDirective(null, null, null, null);
+    const directive = new FormLoadingDirective(null, null, null);
     expect(directive).toBeTruthy();
   });
 
index 9b063948520c8fa1e5e637868c594e36f52e9f91..e83614b84a5553f5e1431665e28ec4545d536f9f 100644 (file)
@@ -6,8 +6,6 @@ import {
   ViewContainerRef
 } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { AlertPanelComponent } from '../components/alert-panel/alert-panel.component';
 import { LoadingPanelComponent } from '../components/loading-panel/loading-panel.component';
 import { LoadingStatus } from '../forms/cd-form';
@@ -19,8 +17,7 @@ export class FormLoadingDirective {
   constructor(
     private templateRef: TemplateRef<any>,
     private viewContainer: ViewContainerRef,
-    private componentFactoryResolver: ComponentFactoryResolver,
-    private i18n: I18n
+    private componentFactoryResolver: ComponentFactoryResolver
   ) {}
 
   @Input('cdFormLoading') set cdFormLoading(condition: LoadingStatus) {
@@ -32,7 +29,7 @@ export class FormLoadingDirective {
     switch (condition) {
       case LoadingStatus.Loading:
         factory = this.componentFactoryResolver.resolveComponentFactory(LoadingPanelComponent);
-        content = this.resolveNgContent(this.i18n(`Loading form data...`));
+        content = this.resolveNgContent($localize`Loading form data...`);
         this.viewContainer.createComponent(factory, null, null, content);
         break;
       case LoadingStatus.Ready:
@@ -40,7 +37,7 @@ export class FormLoadingDirective {
         break;
       case LoadingStatus.Error:
         factory = this.componentFactoryResolver.resolveComponentFactory(AlertPanelComponent);
-        content = this.resolveNgContent(this.i18n(`Form data could not be loaded.`));
+        content = this.resolveNgContent($localize`Form data could not be loaded.`);
         const componentRef = this.viewContainer.createComponent(factory, null, null, content);
         (<AlertPanelComponent>componentRef.instance).type = 'error';
         break;
index b0cd8133edad204d66ca8e813a813a6513c900e2..bcc5629a9e00a2525f435075c79c522c86c0020a 100644 (file)
@@ -6,7 +6,6 @@ import {
   Validators
 } from '@angular/forms';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { Observable, of as observableOf, timer as observableTimer } from 'rxjs';
 import { map, switchMapTo, take } from 'rxjs/operators';
@@ -333,7 +332,7 @@ export class CdValidators {
    * be called in a static one.
    */
   static binaryMin(bytes: number): ValidatorFn {
-    return (control: AbstractControl): { [key: string]: (i18n: I18n) => string } | null => {
+    return (control: AbstractControl): { [key: string]: () => string } | null => {
       const formatterService = new FormatterService();
       const currentBytes = new FormatterService().toBytes(control.value);
       if (bytes <= currentBytes) {
@@ -341,7 +340,7 @@ export class CdValidators {
       }
       const value = new DimlessBinaryPipe(formatterService).transform(bytes);
       return {
-        binaryMin: (i18n: I18n) => i18n(`Size has to be at least {{value}} or more`, { value })
+        binaryMin: () => $localize`Size has to be at least ${value} or more`
       };
     };
   }
@@ -353,7 +352,7 @@ export class CdValidators {
    * be called in a static one.
    */
   static binaryMax(bytes: number): ValidatorFn {
-    return (control: AbstractControl): { [key: string]: (i18n: I18n) => string } | null => {
+    return (control: AbstractControl): { [key: string]: () => string } | null => {
       const formatterService = new FormatterService();
       const currentBytes = formatterService.toBytes(control.value);
       if (bytes >= currentBytes) {
@@ -361,7 +360,7 @@ export class CdValidators {
       }
       const value = new DimlessBinaryPipe(formatterService).transform(bytes);
       return {
-        binaryMax: (i18n: I18n) => i18n(`Size has to be at most {{value}} or less`, { value })
+        binaryMax: () => $localize`Size has to be at most ${value} or less`
       };
     };
   }
index 5293059e75d8c3d78a1b619b8d863672e1eaf112..a0b8019a7caae854662673979f22fab8d88a81c3 100644 (file)
@@ -1,20 +1,10 @@
-import { TestBed } from '@angular/core/testing';
-
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
 import { BooleanTextPipe } from './boolean-text.pipe';
 
 describe('BooleanTextPipe', () => {
   let pipe: BooleanTextPipe;
 
-  configureTestBed({
-    providers: [i18nProviders]
-  });
-
   beforeEach(() => {
-    const i18n = TestBed.inject(I18n);
-    pipe = new BooleanTextPipe(i18n);
+    pipe = new BooleanTextPipe();
   });
 
   it('create an instance', () => {
index dba4e8bc010226f8785a4529c98b808bad0823c1..70432f9be5d4be66caecb81f1678797b7393c36e 100644 (file)
@@ -1,17 +1,13 @@
 import { Pipe, PipeTransform } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 @Pipe({
   name: 'booleanText'
 })
 export class BooleanTextPipe implements PipeTransform {
-  constructor(private i18n: I18n) {}
-
   transform(
     value: any,
-    truthyText: string = this.i18n('Yes'),
-    falsyText: string = this.i18n('No')
+    truthyText: string = $localize`Yes`,
+    falsyText: string = $localize`No`
   ): string {
     return Boolean(value) ? truthyText : falsyText;
   }
index f658365e2d2ae6e0e6a7ee88064a84f3127982f4..9d36defb937f95743784431a4aa5bdb20ce0729b 100644 (file)
@@ -1,20 +1,10 @@
-import { TestBed } from '@angular/core/testing';
-
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
 import { NotAvailablePipe } from './not-available.pipe';
 
 describe('NotAvailablePipe', () => {
   let pipe: NotAvailablePipe;
 
-  configureTestBed({
-    providers: [i18nProviders]
-  });
-
   beforeEach(() => {
-    const i18n = TestBed.inject(I18n);
-    pipe = new NotAvailablePipe(i18n);
+    pipe = new NotAvailablePipe();
   });
 
   it('create an instance', () => {
index 75cb8a5cf0c2ed0655b67b40829eda2ba64b7c87..17184c38ae10e0762517acbba991bd35624f0ecd 100644 (file)
@@ -1,15 +1,12 @@
 import { Pipe, PipeTransform } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 @Pipe({
   name: 'notAvailable'
 })
 export class NotAvailablePipe implements PipeTransform {
-  constructor(private i18n: I18n) {}
   transform(value: any): any {
     if (value === '') {
-      return this.i18n('n/a');
+      return $localize`n/a`;
     }
     return value;
   }
index 9467cc3f7baf31417b9782984022365149cd83c7..2b37ffafaa327c119a2da2ea613f0df819fed74d 100644 (file)
@@ -5,7 +5,7 @@ import { Router } from '@angular/router';
 
 import { ToastrService } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { AppModule } from '../../app.module';
 import { NotificationType } from '../enum/notification-type.enum';
 import { CdNotification, CdNotificationConfig } from '../models/cd-notification';
@@ -62,7 +62,6 @@ describe('ApiInterceptorService', () => {
     imports: [AppModule, HttpClientTestingModule],
     providers: [
       NotificationService,
-      i18nProviders,
       {
         provide: ToastrService,
         useValue: {
index fa235acefc611da655faf0fd5701c84a4bf07630..226fa4712fcd7cbe895ad6688580d10d4f34377a 100644 (file)
@@ -4,7 +4,7 @@ import { fakeAsync, TestBed, tick } from '@angular/core/testing';
 import * as _ from 'lodash';
 import { ToastrService } from 'ngx-toastr';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { RbdService } from '../api/rbd.service';
 import { NotificationType } from '../enum/notification-type.enum';
 import { CdNotificationConfig } from '../models/cd-notification';
@@ -27,7 +27,6 @@ describe('NotificationService', () => {
       TaskMessageService,
       { provide: ToastrService, useValue: toastFakeService },
       { provide: CdDatePipe, useValue: { transform: (d: any) => d } },
-      i18nProviders,
       RbdService
     ],
     imports: [HttpClientTestingModule]
index cae1993b58b28e0b0b8614c94a071d090943301d..ff88fcb620645323ec86d1b1e0690dcd83bd5bff 100644 (file)
@@ -3,7 +3,7 @@ import { TestBed } from '@angular/core/testing';
 
 import { of as observableOf } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { SettingsService } from '../api/settings.service';
 import { SharedModule } from '../shared.module';
 import { PasswordPolicyService } from './password-policy.service';
@@ -33,8 +33,7 @@ describe('PasswordPolicyService', () => {
   };
 
   configureTestBed({
-    imports: [HttpClientTestingModule, SharedModule],
-    providers: [i18nProviders]
+    imports: [HttpClientTestingModule, SharedModule]
   });
 
   beforeEach(() => {
index e3030b10a676682a4ba0272e18f989474848ec77..c768a36aa94fd1da0917ab530ee0b0acce50b76b 100644 (file)
@@ -1,6 +1,5 @@
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { Observable } from 'rxjs';
 import { map } from 'rxjs/operators';
@@ -12,7 +11,7 @@ import { CdPwdPolicySettings } from '../models/cd-pwd-policy-settings';
   providedIn: 'root'
 })
 export class PasswordPolicyService {
-  constructor(private i18n: I18n, private settingsService: SettingsService) {}
+  constructor(private settingsService: SettingsService) {}
 
   getHelpText(): Observable<string> {
     return this.settingsService.getStandardSettings().pipe(
@@ -20,27 +19,19 @@ export class PasswordPolicyService {
         const settings = new CdPwdPolicySettings(resp);
         let helpText: string[] = [];
         if (settings.pwdPolicyEnabled) {
-          helpText.push(this.i18n('Required rules for passwords:'));
+          helpText.push($localize`Required rules for passwords:`);
           const i18nHelp: { [key: string]: string } = {
-            pwdPolicyCheckLengthEnabled: this.i18n('Must contain at least {{length}} characters', {
-              length: settings.pwdPolicyMinLength
-            }),
-            pwdPolicyCheckOldpwdEnabled: this.i18n('Must not be the same as the previous one'),
-            pwdPolicyCheckUsernameEnabled: this.i18n('Cannot contain the username'),
-            pwdPolicyCheckExclusionListEnabled: this.i18n('Cannot contain any configured keyword'),
-            pwdPolicyCheckRepetitiveCharsEnabled: this.i18n(
-              'Cannot contain any repetitive characters e.g. "aaa"'
-            ),
-            pwdPolicyCheckSequentialCharsEnabled: this.i18n(
-              'Cannot contain any sequential characters e.g. "abc"'
-            ),
-            pwdPolicyCheckComplexityEnabled: this.i18n(
-              `Must consist of characters from the following groups:
+            pwdPolicyCheckLengthEnabled: $localize`Must contain at least ${settings.pwdPolicyMinLength} characters`,
+            pwdPolicyCheckOldpwdEnabled: $localize`Must not be the same as the previous one`,
+            pwdPolicyCheckUsernameEnabled: $localize`Cannot contain the username`,
+            pwdPolicyCheckExclusionListEnabled: $localize`Cannot contain any configured keyword`,
+            pwdPolicyCheckRepetitiveCharsEnabled: $localize`Cannot contain any repetitive characters e.g. "aaa"`,
+            pwdPolicyCheckSequentialCharsEnabled: $localize`Cannot contain any sequential characters e.g. "abc"`,
+            pwdPolicyCheckComplexityEnabled: $localize`Must consist of characters from the following groups:
   * Alphabetic a-z, A-Z
   * Numbers 0-9
   * Special chars: !"#$%& '()*+,-./:;<=>?@[\\]^_\`{{|}}~
   * Any other characters (signs)`
-            )
           };
           helpText = helpText.concat(
             _.keys(i18nHelp)
index ee76530ecc58584e1e5570c698486ef55b0572d4..c4ffc5e8444d131ecade0ed6b17a3b6dc07eaa14 100644 (file)
@@ -3,11 +3,7 @@ import { TestBed } from '@angular/core/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PrometheusHelper
-} from '../../../testing/unit-test-helper';
+import { configureTestBed, PrometheusHelper } from '../../../testing/unit-test-helper';
 import { NotificationType } from '../enum/notification-type.enum';
 import { CdNotificationConfig } from '../models/cd-notification';
 import { PrometheusCustomAlert } from '../models/prometheus-alerts';
@@ -22,7 +18,7 @@ describe('PrometheusAlertFormatter', () => {
 
   configureTestBed({
     imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule],
-    providers: [PrometheusAlertFormatter, i18nProviders]
+    providers: [PrometheusAlertFormatter]
   });
 
   beforeEach(() => {
index cefbb78be0b6f5782c9412c937eac5a531508ee1..eaca61b48a35089cf02d907ffc9ccce9c2a6e459 100644 (file)
@@ -4,11 +4,7 @@ import { TestBed } from '@angular/core/testing';
 import { ToastrModule } from 'ngx-toastr';
 import { Observable, of } from 'rxjs';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PrometheusHelper
-} from '../../../testing/unit-test-helper';
+import { configureTestBed, PrometheusHelper } from '../../../testing/unit-test-helper';
 import { PrometheusService } from '../api/prometheus.service';
 import { NotificationType } from '../enum/notification-type.enum';
 import { CdNotificationConfig } from '../models/cd-notification';
@@ -27,7 +23,7 @@ describe('PrometheusAlertService', () => {
 
   configureTestBed({
     imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule],
-    providers: [PrometheusAlertService, PrometheusAlertFormatter, i18nProviders]
+    providers: [PrometheusAlertService, PrometheusAlertFormatter]
   });
 
   beforeEach(() => {
index de3130a9dc8d87c07155e989af9d1ddfd61848ae..6500d51f26a414212960b1475bb06c2f8aa293a0 100644 (file)
@@ -4,11 +4,7 @@ import { fakeAsync, TestBed, tick } from '@angular/core/testing';
 import { ToastrModule, ToastrService } from 'ngx-toastr';
 import { of, throwError } from 'rxjs';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PrometheusHelper
-} from '../../../testing/unit-test-helper';
+import { configureTestBed, PrometheusHelper } from '../../../testing/unit-test-helper';
 import { PrometheusService } from '../api/prometheus.service';
 import { NotificationType } from '../enum/notification-type.enum';
 import { CdNotificationConfig } from '../models/cd-notification';
@@ -38,7 +34,6 @@ describe('PrometheusNotificationService', () => {
     providers: [
       PrometheusNotificationService,
       PrometheusAlertFormatter,
-      i18nProviders,
       { provide: ToastrService, useValue: toastFakeService }
     ]
   });
index 5e92b52a59eb6b1b8fce56413fd980e4f6469c6b..57f0442c43f3f42e742aed9a7c1b6e024c36cfc8 100644 (file)
@@ -1,10 +1,6 @@
 import { TestBed } from '@angular/core/testing';
 
-import {
-  configureTestBed,
-  i18nProviders,
-  PrometheusHelper
-} from '../../../testing/unit-test-helper';
+import { configureTestBed, PrometheusHelper } from '../../../testing/unit-test-helper';
 import { PrometheusRule } from '../models/prometheus-alerts';
 import { SharedModule } from '../shared.module';
 import { PrometheusSilenceMatcherService } from './prometheus-silence-matcher.service';
@@ -15,8 +11,7 @@ describe('PrometheusSilenceMatcherService', () => {
   let rules: PrometheusRule[];
 
   configureTestBed({
-    imports: [SharedModule],
-    providers: [i18nProviders]
+    imports: [SharedModule]
   });
 
   const addMatcher = (name: string, value: any) => ({
index dbd0da04eb167c6654a01dc0c4dce00ac6b9965f..c819a16f426faef62dda07b6e8cf579a9bf4e265 100644 (file)
@@ -1,6 +1,5 @@
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 
 import {
@@ -20,8 +19,6 @@ export class PrometheusSilenceMatcherService {
     severity: 'labels.severity'
   };
 
-  constructor(private i18n: I18n) {}
-
   singleMatch(
     matcher: AlertmanagerSilenceMatcher,
     rules: PrometheusRule[]
@@ -65,18 +62,17 @@ export class PrometheusSilenceMatcherService {
 
   private getMatchText(rules: number, alerts: number): string {
     const msg = {
-      noRule: this.i18n('Your matcher seems to match no currently defined rule or active alert.'),
-      noAlerts: this.i18n('no active alerts'),
-      alert: this.i18n('1 active alert'),
-      alerts: this.i18n('{{n}} active alerts', { n: alerts }),
-      rule: this.i18n('Matches 1 rule'),
-      rules: this.i18n('Matches {{n}} rules', { n: rules })
+      noRule: $localize`Your matcher seems to match no currently defined rule or active alert.`,
+      noAlerts: $localize`no active alerts`,
+      alert: $localize`1 active alert`,
+      alerts: $localize`${alerts} active alerts`,
+      rule: $localize`Matches 1 rule`,
+      rules: $localize`Matches ${rules} rules`
     };
-    return rules
-      ? this.i18n('{{rules}} with {{alerts}}.', {
-          rules: rules > 1 ? msg.rules : msg.rule,
-          alerts: alerts ? (alerts > 1 ? msg.alerts : msg.alert) : msg.noAlerts
-        })
-      : msg.noRule;
+
+    const rule = rules > 1 ? msg.rules : msg.rule;
+    const alert = alerts ? (alerts > 1 ? msg.alerts : msg.alert) : msg.noAlerts;
+
+    return rules ? $localize`${rule} with ${alert}.` : msg.noRule;
   }
 }
index e1db61a5ebb334fa58b79ecbdb87500d37671d1a..15b2e4e7e1496034ae16a82d80d1252fbac4ab54 100644 (file)
@@ -1,6 +1,6 @@
 import { TestBed } from '@angular/core/testing';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { RbdConfigurationType } from '../models/configuration';
 import { RbdConfigurationService } from './rbd-configuration.service';
 
@@ -8,7 +8,7 @@ describe('RbdConfigurationService', () => {
   let service: RbdConfigurationService;
 
   configureTestBed({
-    providers: [RbdConfigurationService, i18nProviders]
+    providers: [RbdConfigurationService]
   });
 
   beforeEach(() => {
index 10a0ac7060ec1621e95c4fca16619c28d57fb101..4499718e1fab77ecd78057202590bcb29a113eee 100644 (file)
@@ -1,7 +1,5 @@
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import {
   RbdConfigurationExtraField,
   RbdConfigurationSection,
@@ -19,82 +17,82 @@ import {
 export class RbdConfigurationService {
   readonly sections: RbdConfigurationSection[];
 
-  constructor(private i18n: I18n) {
+  constructor() {
     this.sections = [
       {
-        heading: this.i18n('Quality of Service'),
+        heading: $localize`Quality of Service`,
         class: 'quality-of-service',
         options: [
           {
             name: 'rbd_qos_bps_limit',
-            displayName: this.i18n('BPS Limit'),
-            description: this.i18n('The desired limit of IO bytes per second.'),
+            displayName: $localize`BPS Limit`,
+            description: $localize`The desired limit of IO bytes per second.`,
             type: RbdConfigurationType.bps
           },
           {
             name: 'rbd_qos_iops_limit',
-            displayName: this.i18n('IOPS Limit'),
-            description: this.i18n('The desired limit of IO operations per second.'),
+            displayName: $localize`IOPS Limit`,
+            description: $localize`The desired limit of IO operations per second.`,
             type: RbdConfigurationType.iops
           },
           {
             name: 'rbd_qos_read_bps_limit',
-            displayName: this.i18n('Read BPS Limit'),
-            description: this.i18n('The desired limit of read bytes per second.'),
+            displayName: $localize`Read BPS Limit`,
+            description: $localize`The desired limit of read bytes per second.`,
             type: RbdConfigurationType.bps
           },
           {
             name: 'rbd_qos_read_iops_limit',
-            displayName: this.i18n('Read IOPS Limit'),
-            description: this.i18n('The desired limit of read operations per second.'),
+            displayName: $localize`Read IOPS Limit`,
+            description: $localize`The desired limit of read operations per second.`,
             type: RbdConfigurationType.iops
           },
           {
             name: 'rbd_qos_write_bps_limit',
-            displayName: this.i18n('Write BPS Limit'),
-            description: this.i18n('The desired limit of write bytes per second.'),
+            displayName: $localize`Write BPS Limit`,
+            description: $localize`The desired limit of write bytes per second.`,
             type: RbdConfigurationType.bps
           },
           {
             name: 'rbd_qos_write_iops_limit',
-            displayName: this.i18n('Write IOPS Limit'),
-            description: this.i18n('The desired limit of write operations per second.'),
+            displayName: $localize`Write IOPS Limit`,
+            description: $localize`The desired limit of write operations per second.`,
             type: RbdConfigurationType.iops
           },
           {
             name: 'rbd_qos_bps_burst',
-            displayName: this.i18n('BPS Burst'),
-            description: this.i18n('The desired burst limit of IO bytes.'),
+            displayName: $localize`BPS Burst`,
+            description: $localize`The desired burst limit of IO bytes.`,
             type: RbdConfigurationType.bps
           },
           {
             name: 'rbd_qos_iops_burst',
-            displayName: this.i18n('IOPS Burst'),
-            description: this.i18n('The desired burst limit of IO operations.'),
+            displayName: $localize`IOPS Burst`,
+            description: $localize`The desired burst limit of IO operations.`,
             type: RbdConfigurationType.iops
           },
           {
             name: 'rbd_qos_read_bps_burst',
-            displayName: this.i18n('Read BPS Burst'),
-            description: this.i18n('The desired burst limit of read bytes.'),
+            displayName: $localize`Read BPS Burst`,
+            description: $localize`The desired burst limit of read bytes.`,
             type: RbdConfigurationType.bps
           },
           {
             name: 'rbd_qos_read_iops_burst',
-            displayName: this.i18n('Read IOPS Burst'),
-            description: this.i18n('The desired burst limit of read operations.'),
+            displayName: $localize`Read IOPS Burst`,
+            description: $localize`The desired burst limit of read operations.`,
             type: RbdConfigurationType.iops
           },
           {
             name: 'rbd_qos_write_bps_burst',
-            displayName: this.i18n('Write BPS Burst'),
-            description: this.i18n('The desired burst limit of write bytes.'),
+            displayName: $localize`Write BPS Burst`,
+            description: $localize`The desired burst limit of write bytes.`,
             type: RbdConfigurationType.bps
           },
           {
             name: 'rbd_qos_write_iops_burst',
-            displayName: this.i18n('Write IOPS Burst'),
-            description: this.i18n('The desired burst limit of write operations.'),
+            displayName: $localize`Write IOPS Burst`,
+            description: $localize`The desired burst limit of write operations.`,
             type: RbdConfigurationType.iops
           }
         ] as RbdConfigurationExtraField[]
index 1d11fc5561fbecc26008557cad250d2bc365f82f..51be86591379f2328a047e891f0c61c8f3fc7505 100644 (file)
@@ -8,7 +8,6 @@ describe('RefreshIntervalService', () => {
   let service: RefreshIntervalService;
 
   configureTestBed({
-    imports: [],
     providers: [RefreshIntervalService]
   });
 
index e52459b0b855d6b0e309987a82f97987f2fd0349..5ec08671eca429daeed9275b061b29cdaf50869c 100644 (file)
@@ -4,11 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { of } from 'rxjs';
 
-import {
-  configureTestBed,
-  expectItemTasks,
-  i18nProviders
-} from '../../../testing/unit-test-helper';
+import { configureTestBed, expectItemTasks } from '../../../testing/unit-test-helper';
 import { RbdService } from '../api/rbd.service';
 import { ExecutingTask } from '../models/executing-task';
 import { SummaryService } from './summary.service';
@@ -29,7 +25,7 @@ describe('TaskListService', () => {
   };
 
   configureTestBed({
-    providers: [TaskListService, TaskMessageService, SummaryService, i18nProviders, RbdService],
+    providers: [TaskListService, TaskMessageService, SummaryService, RbdService],
     imports: [HttpClientTestingModule, RouterTestingModule]
   });
 
index 9d037aecb9b55ea644536af8f6734cdc76dd3ad1..920d79dd73ab3b0949528f2d3d9cb3211be00081 100644 (file)
@@ -3,7 +3,7 @@ import { TestBed } from '@angular/core/testing';
 
 import * as _ from 'lodash';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { RbdService } from '../api/rbd.service';
 import { FinishedTask } from '../models/finished-task';
 import { TaskException } from '../models/task-exception';
@@ -14,7 +14,7 @@ describe('TaskManagerMessageService', () => {
   let finishedTask: FinishedTask;
 
   configureTestBed({
-    providers: [TaskMessageService, i18nProviders, RbdService],
+    providers: [TaskMessageService, RbdService],
     imports: [HttpClientTestingModule]
   });
 
@@ -247,7 +247,7 @@ describe('TaskManagerMessageService', () => {
         finishedTask.name = 'rbd/trash/restore';
         testMessages(
           new TaskMessageOperation('Restoring', 'restore', 'Restored'),
-          `image '${metadata.image_id_spec}' ` + `into '${metadata.new_image_name}'`
+          `image '${metadata.image_id_spec}' into '${metadata.new_image_name}'`
         );
         testErrorCode(17, `Image name '${metadata.new_image_name}' is already in use.`);
       });
index 3047a287db329ad297e8b6c63eb3cbb54fb62233..026765a14ce8f5c10cb44589ad0d2b0e1e16a097 100644 (file)
@@ -1,7 +1,5 @@
 import { Injectable } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
 import { Components } from '../enum/components.enum';
 import { FinishedTask } from '../models/finished-task';
 import { ImageSpec } from '../models/image-spec';
@@ -20,17 +18,12 @@ export class TaskMessageOperation {
 }
 
 class TaskMessage {
-  i18n: I18n;
-
   operation: TaskMessageOperation;
   involves: (object: any) => string;
   errors: (metadata: any) => object;
 
   failure(metadata: any): string {
-    return this.i18n('Failed to {{failure}} {{metadata}}', {
-      failure: this.operation.failure,
-      metadata: this.involves(metadata)
-    });
+    return $localize`Failed to ${this.operation.failure} ${this.involves(metadata)}`;
   }
 
   running(metadata: any): string {
@@ -42,12 +35,10 @@ class TaskMessage {
   }
 
   constructor(
-    i18n: I18n,
     operation: TaskMessageOperation,
     involves: (metadata: any) => string,
     errors?: (metadata: any) => object
   ) {
-    this.i18n = i18n;
     this.operation = operation;
     this.involves = involves;
     this.errors = errors || (() => ({}));
@@ -58,14 +49,12 @@ class TaskMessage {
   providedIn: 'root'
 })
 export class TaskMessageService {
-  constructor(private i18n: I18n) {}
-
   defaultMessage = this.newTaskMessage(
-    new TaskMessageOperation(this.i18n('Executing'), this.i18n('execute'), this.i18n('Executed')),
+    new TaskMessageOperation($localize`Executing`, $localize`execute`, $localize`Executed`),
     (metadata) => {
       return (
         (metadata && (Components[metadata.component] || metadata.component)) ||
-        this.i18n('unknown task')
+        $localize`unknown task`
       );
     },
     () => {
@@ -74,48 +63,23 @@ export class TaskMessageService {
   );
 
   commonOperations = {
-    create: new TaskMessageOperation(
-      this.i18n('Creating'),
-      this.i18n('create'),
-      this.i18n('Created')
-    ),
-    update: new TaskMessageOperation(
-      this.i18n('Updating'),
-      this.i18n('update'),
-      this.i18n('Updated')
-    ),
-    delete: new TaskMessageOperation(
-      this.i18n('Deleting'),
-      this.i18n('delete'),
-      this.i18n('Deleted')
-    ),
-    add: new TaskMessageOperation(this.i18n('Adding'), this.i18n('add'), this.i18n('Added')),
-    remove: new TaskMessageOperation(
-      this.i18n('Removing'),
-      this.i18n('remove'),
-      this.i18n('Removed')
-    ),
-    import: new TaskMessageOperation(
-      this.i18n('Importing'),
-      this.i18n('import'),
-      this.i18n('Imported')
-    )
+    create: new TaskMessageOperation($localize`Creating`, $localize`create`, $localize`Created`),
+    update: new TaskMessageOperation($localize`Updating`, $localize`update`, $localize`Updated`),
+    delete: new TaskMessageOperation($localize`Deleting`, $localize`delete`, $localize`Deleted`),
+    add: new TaskMessageOperation($localize`Adding`, $localize`add`, $localize`Added`),
+    remove: new TaskMessageOperation($localize`Removing`, $localize`remove`, $localize`Removed`),
+    import: new TaskMessageOperation($localize`Importing`, $localize`import`, $localize`Imported`)
   };
 
   rbd = {
-    default: (metadata: any) =>
-      this.i18n(`RBD '{{id}}'`, {
-        id: `${metadata.image_spec}`
-      }),
+    default: (metadata: any) => $localize`RBD '${metadata.image_spec}'`,
     create: (metadata: any) => {
       const id = new ImageSpec(
         metadata.pool_name,
         metadata.namespace,
         metadata.image_name
       ).toString();
-      return this.i18n(`RBD '{{id}}'`, {
-        id: id
-      });
+      return $localize`RBD '${id}'`;
     },
     child: (metadata: any) => {
       const id = new ImageSpec(
@@ -123,9 +87,7 @@ export class TaskMessageService {
         metadata.child_namespace,
         metadata.child_image_name
       ).toString();
-      return this.i18n(`RBD '{{id}}'`, {
-        id: id
-      });
+      return $localize`RBD '${id}'`;
     },
     destination: (metadata: any) => {
       const id = new ImageSpec(
@@ -133,31 +95,21 @@ export class TaskMessageService {
         metadata.dest_namespace,
         metadata.dest_image_name
       ).toString();
-      return this.i18n(`RBD '{{id}}'`, {
-        id: id
-      });
+      return $localize`RBD '${id}'`;
     },
     snapshot: (metadata: any) =>
-      this.i18n(`RBD snapshot '{{id}}'`, {
-        id: `${metadata.image_spec}@${metadata.snapshot_name}`
-      })
+      $localize`RBD snapshot '${metadata.image_spec}@${metadata.snapshot_name}'`
   };
 
   rbd_mirroring = {
-    site_name: () => this.i18n('mirroring site name'),
-    bootstrap: () => this.i18n('bootstrap token'),
-    pool: (metadata: any) =>
-      this.i18n(`mirror mode for pool '{{id}}'`, {
-        id: `${metadata.pool_name}`
-      }),
-    pool_peer: (metadata: any) =>
-      this.i18n(`mirror peer for pool '{{id}}'`, {
-        id: `${metadata.pool_name}`
-      })
+    site_name: () => $localize`mirroring site name`,
+    bootstrap: () => $localize`bootstrap token`,
+    pool: (metadata: any) => $localize`mirror mode for pool '${metadata.pool_name}'`,
+    pool_peer: (metadata: any) => $localize`mirror peer for pool '${metadata.pool_name}'`
   };
 
   grafana = {
-    update_dashboards: () => this.i18n('all dashboards')
+    update_dashboards: () => $localize`all dashboards`
   };
 
   messages = {
@@ -169,10 +121,9 @@ export class TaskMessageService {
       this.host(metadata)
     ),
     // OSD tasks
-    'osd/create': this.newTaskMessage(this.commonOperations.create, (metadata) =>
-      this.i18n(`OSDs (DriveGroups: {{tracking_id}})`, {
-        tracking_id: metadata.tracking_id
-      })
+    'osd/create': this.newTaskMessage(
+      this.commonOperations.create,
+      (metadata) => $localize`OSDs (DriveGroups: ${metadata.tracking_id})`
     ),
     'osd/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) =>
       this.osd(metadata)
@@ -182,18 +133,14 @@ export class TaskMessageService {
       this.commonOperations.create,
       (metadata) => this.pool(metadata),
       (metadata) => ({
-        '17': this.i18n('Name is already used by {{pool_name}}.', {
-          pool_name: this.pool(metadata)
-        })
+        '17': $localize`Name is already used by ${this.pool(metadata)}.`
       })
     ),
     'pool/edit': this.newTaskMessage(
       this.commonOperations.update,
       (metadata) => this.pool(metadata),
       (metadata) => ({
-        '17': this.i18n('Name is already used by {{pool_name}}.', {
-          pool_name: this.pool(metadata)
-        })
+        '17': $localize`Name is already used by ${this.pool(metadata)}.`
       })
     ),
     'pool/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) =>
@@ -204,9 +151,7 @@ export class TaskMessageService {
       this.commonOperations.create,
       (metadata) => this.ecp(metadata),
       (metadata) => ({
-        '17': this.i18n('Name is already used by {{name}}.', {
-          name: this.ecp(metadata)
-        })
+        '17': $localize`Name is already used by ${this.ecp(metadata)}.`
       })
     ),
     'ecp/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) =>
@@ -217,9 +162,7 @@ export class TaskMessageService {
       this.commonOperations.create,
       (metadata) => this.crushRule(metadata),
       (metadata) => ({
-        '17': this.i18n('Name is already used by {{name}}.', {
-          name: this.crushRule(metadata)
-        })
+        '17': $localize`Name is already used by ${this.crushRule(metadata)}.`
       })
     ),
     'crushRule/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) =>
@@ -230,55 +173,37 @@ export class TaskMessageService {
       this.commonOperations.create,
       this.rbd.create,
       (metadata) => ({
-        '17': this.i18n('Name is already used by {{rbd_name}}.', {
-          rbd_name: this.rbd.create(metadata)
-        })
+        '17': $localize`Name is already used by ${this.rbd.create(metadata)}.`
       })
     ),
     'rbd/edit': this.newTaskMessage(this.commonOperations.update, this.rbd.default, (metadata) => ({
-      '17': this.i18n('Name is already used by {{rbd_name}}.', {
-        rbd_name: this.rbd.default(metadata)
-      })
+      '17': $localize`Name is already used by ${this.rbd.default(metadata)}.`
     })),
     'rbd/delete': this.newTaskMessage(
       this.commonOperations.delete,
       this.rbd.default,
       (metadata) => ({
-        '16': this.i18n('{{rbd_name}} is busy.', {
-          rbd_name: this.rbd.default(metadata)
-        }),
-        '39': this.i18n('{{rbd_name}} contains snapshots.', {
-          rbd_name: this.rbd.default(metadata)
-        })
+        '16': $localize`${this.rbd.default(metadata)} is busy.`,
+        '39': $localize`${this.rbd.default(metadata)} contains snapshots.`
       })
     ),
     'rbd/clone': this.newTaskMessage(
-      new TaskMessageOperation(this.i18n('Cloning'), this.i18n('clone'), this.i18n('Cloned')),
+      new TaskMessageOperation($localize`Cloning`, $localize`clone`, $localize`Cloned`),
       this.rbd.child,
       (metadata) => ({
-        '17': this.i18n('Name is already used by {{rbd_name}}.', {
-          rbd_name: this.rbd.child(metadata)
-        }),
-        '22': this.i18n('Snapshot of {{rbd_name}} must be protected.', {
-          rbd_name: this.rbd.child(metadata)
-        })
+        '17': $localize`Name is already used by ${this.rbd.child(metadata)}.`,
+        '22': $localize`Snapshot of ${this.rbd.child(metadata)} must be protected.`
       })
     ),
     'rbd/copy': this.newTaskMessage(
-      new TaskMessageOperation(this.i18n('Copying'), this.i18n('copy'), this.i18n('Copied')),
+      new TaskMessageOperation($localize`Copying`, $localize`copy`, $localize`Copied`),
       this.rbd.destination,
       (metadata) => ({
-        '17': this.i18n('Name is already used by {{rbd_name}}.', {
-          rbd_name: this.rbd.destination(metadata)
-        })
+        '17': $localize`Name is already used by ${this.rbd.destination(metadata)}.`
       })
     ),
     'rbd/flatten': this.newTaskMessage(
-      new TaskMessageOperation(
-        this.i18n('Flattening'),
-        this.i18n('flatten'),
-        this.i18n('Flattened')
-      ),
+      new TaskMessageOperation($localize`Flattening`, $localize`flatten`, $localize`Flattened`),
       this.rbd.default
     ),
     // RBD snapshot tasks
@@ -286,78 +211,60 @@ export class TaskMessageService {
       this.commonOperations.create,
       this.rbd.snapshot,
       (metadata) => ({
-        '17': this.i18n('Name is already used by {{snap_name}}.', {
-          snap_name: this.rbd.snapshot(metadata)
-        })
+        '17': $localize`Name is already used by ${this.rbd.snapshot(metadata)}.`
       })
     ),
     'rbd/snap/edit': this.newTaskMessage(
       this.commonOperations.update,
       this.rbd.snapshot,
       (metadata) => ({
-        '16': this.i18n('Cannot unprotect {{snap_name}} because it contains child images.', {
-          snap_name: this.rbd.snapshot(metadata)
-        })
+        '16': $localize`Cannot unprotect ${this.rbd.snapshot(
+          metadata
+        )} because it contains child images.`
       })
     ),
     'rbd/snap/delete': this.newTaskMessage(
       this.commonOperations.delete,
       this.rbd.snapshot,
       (metadata) => ({
-        '16': this.i18n(`Cannot delete {{snap_name}} because it's protected.`, {
-          snap_name: this.rbd.snapshot(metadata)
-        })
+        '16': $localize`Cannot delete ${this.rbd.snapshot(metadata)} because it's protected.`
       })
     ),
     'rbd/snap/rollback': this.newTaskMessage(
       new TaskMessageOperation(
-        this.i18n('Rolling back'),
-        this.i18n('rollback'),
-        this.i18n('Rolled back')
+        $localize`Rolling back`,
+        $localize`rollback`,
+        $localize`Rolled back`
       ),
       this.rbd.snapshot
     ),
     // RBD trash tasks
     'rbd/trash/move': this.newTaskMessage(
-      new TaskMessageOperation(this.i18n('Moving'), this.i18n('move'), this.i18n('Moved')),
-      (metadata) =>
-        this.i18n(`image '{{id}}' to trash`, {
-          id: metadata.image_spec
-        }),
+      new TaskMessageOperation($localize`Moving`, $localize`move`, $localize`Moved`),
+      (metadata) => $localize`image '${metadata.image_spec}' to trash`,
       () => ({
-        2: this.i18n('Could not find image.')
+        2: $localize`Could not find image.`
       })
     ),
     'rbd/trash/restore': this.newTaskMessage(
-      new TaskMessageOperation(this.i18n('Restoring'), this.i18n('restore'), this.i18n('Restored')),
-      (metadata) =>
-        this.i18n(`image '{{id}}' into '{{new_id}}'`, {
-          id: metadata.image_id_spec,
-          new_id: metadata.new_image_name
-        }),
+      new TaskMessageOperation($localize`Restoring`, $localize`restore`, $localize`Restored`),
+      (metadata) => $localize`image '${metadata.image_id_spec}' into '${metadata.new_image_name}'`,
       (metadata) => ({
-        17: this.i18n(`Image name '{{id}}' is already in use.`, {
-          id: metadata.new_image_name
-        })
+        17: $localize`Image name '${metadata.new_image_name}' is already in use.`
       })
     ),
     'rbd/trash/remove': this.newTaskMessage(
-      new TaskMessageOperation(this.i18n('Deleting'), this.i18n('delete'), this.i18n('Deleted')),
-      (metadata) =>
-        this.i18n(`image '{{id}}'`, {
-          id: `${metadata.image_id_spec}`
-        })
+      new TaskMessageOperation($localize`Deleting`, $localize`delete`, $localize`Deleted`),
+      (metadata) => $localize`image '${metadata.image_id_spec}'`
     ),
     'rbd/trash/purge': this.newTaskMessage(
-      new TaskMessageOperation(this.i18n('Purging'), this.i18n('purge'), this.i18n('Purged')),
+      new TaskMessageOperation($localize`Purging`, $localize`purge`, $localize`Purged`),
       (metadata) => {
-        let message = this.i18n('all pools');
+        let message = $localize`all pools`;
         if (metadata.pool_name) {
           message = `'${metadata.pool_name}'`;
         }
-        return this.i18n('images from {{message}}', {
-          message: message
-        });
+        return $localize`images from ${message}`;
       }
     ),
     // RBD mirroring tasks
@@ -380,7 +287,7 @@ export class TaskMessageService {
       this.commonOperations.update,
       this.rbd_mirroring.pool,
       () => ({
-        16: this.i18n('Cannot disable mirroring because it contains a peer.')
+        16: $localize`Cannot disable mirroring because it contains a peer.`
       })
     ),
     'rbd/mirroring/peer/add': this.newTaskMessage(
@@ -423,12 +330,8 @@ export class TaskMessageService {
     ),
     // Orchestrator tasks
     'orchestrator/identify_device': this.newTaskMessage(
-      new TaskMessageOperation(
-        this.i18n('Identifying'),
-        this.i18n('identify'),
-        this.i18n('Identified')
-      ),
-      (metadata) => this.i18n(`device '{{device}}' on host '{{hostname}}'`, metadata)
+      new TaskMessageOperation($localize`Identifying`, $localize`identify`, $localize`Identified`),
+      (metadata) => $localize`device '${metadata.device}' on host '${metadata.hostname}'`
     )
   };
 
@@ -437,43 +340,37 @@ export class TaskMessageService {
     involves: (metadata: any) => string,
     errors?: (metadata: any) => object
   ) {
-    return new TaskMessage(this.i18n, operation, involves, errors);
+    return new TaskMessage(operation, involves, errors);
   }
 
   host(metadata: any) {
-    return this.i18n(`host '{{hostname}}'`, {
-      hostname: metadata.hostname
-    });
+    return $localize`host '${metadata.hostname}'`;
   }
 
   osd(metadata: any) {
-    return this.i18n(`OSD '{{svc_id}}'`, {
-      svc_id: metadata.svc_id
-    });
+    return $localize`OSD '${metadata.svc_id}'`;
   }
 
   pool(metadata: any) {
-    return this.i18n(`pool '{{pool_name}}'`, {
-      pool_name: metadata.pool_name
-    });
+    return $localize`pool '${metadata.pool_name}'`;
   }
 
   ecp(metadata: any) {
-    return this.i18n(`erasure code profile '{{name}}'`, { name: metadata.name });
+    return $localize`erasure code profile '${metadata.name}'`;
   }
 
   crushRule(metadata: any) {
-    return this.i18n(`crush rule '{{name}}'`, { name: metadata.name });
+    return $localize`crush rule '${metadata.name}'`;
   }
 
   iscsiTarget(metadata: any) {
-    return this.i18n(`target '{{target_iqn}}'`, { target_iqn: metadata.target_iqn });
+    return $localize`target '${metadata.target_iqn}'`;
   }
 
   nfs(metadata: any) {
-    return this.i18n(`NFS {{nfs_id}}`, {
-      nfs_id: `'${metadata.cluster_id}:${metadata.export_id ? metadata.export_id : metadata.path}'`
-    });
+    return $localize`NFS '${metadata.cluster_id}\:${
+      metadata.export_id ? metadata.export_id : metadata.path
+    }'`;
   }
 
   _getTaskTitle(task: Task) {
index 698b2affa2c9816ab4e066be74ffe31ea5a5ca2b..2d64dd191da00ce2e57dacb2ae77075aaf776903 100644 (file)
@@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 import { ToastrModule } from 'ngx-toastr';
 import { Observable } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
+import { configureTestBed } from '../../../testing/unit-test-helper';
 import { FinishedTask } from '../models/finished-task';
 import { SharedModule } from '../shared.module';
 import { NotificationService } from './notification.service';
@@ -18,7 +18,7 @@ describe('TaskWrapperService', () => {
 
   configureTestBed({
     imports: [HttpClientTestingModule, ToastrModule.forRoot(), SharedModule, RouterTestingModule],
-    providers: [TaskWrapperService, i18nProviders]
+    providers: [TaskWrapperService]
   });
 
   beforeEach(inject([TaskWrapperService], (wrapper: TaskWrapperService) => {
index 9ff62e112368fddb46266cfff44ad6620615e615..8fc004375a2d3afa1297109bb0fa5b361f5c4997 100644 (file)
@@ -1,3 +1,5 @@
+import '@angular/localize/init';
+
 import 'jest-preset-angular';
 
 import './jestGlobalMocks';
index da024dc1990fc67028e913c03ab077b5a2c9f77b..c260a6fe0c1e5fdbe2b2df943e362bf70aa236d3 100644 (file)
@@ -1,11 +1,10 @@
-import { DebugElement, LOCALE_ID, TRANSLATIONS, TRANSLATIONS_FORMAT, Type } from '@angular/core';
+import { DebugElement, Type } from '@angular/core';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { AbstractControl } from '@angular/forms';
 import { By } from '@angular/platform-browser';
 import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
 
 import { NgbModal, NgbNav, NgbNavItem } from '@ng-bootstrap/ng-bootstrap';
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { configureTestSuite } from 'ng-bullet';
 
 import { InventoryDevice } from '../app/ceph/cluster/inventory/inventory-devices/inventory-device.model';
@@ -339,24 +338,6 @@ export class PrometheusHelper {
   }
 }
 
-const XLIFF = `<?xml version="1.0" encoding="UTF-8" ?>
-<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
-  <file source-language="en" datatype="plaintext" original="ng2.template">
-    <body>
-    </body>
-  </file>
-</xliff>
-`;
-
-const i18nProviders = [
-  { provide: TRANSLATIONS_FORMAT, useValue: 'xlf' },
-  { provide: TRANSLATIONS, useValue: XLIFF },
-  { provide: LOCALE_ID, useValue: 'en' },
-  I18n
-];
-
-export { i18nProviders };
-
 export function expectItemTasks(item: any, executing: string, percentage?: number) {
   if (executing) {
     executing = executing + '...';