From c5d30b818760b6ef1e1b6ef69dbf6b0b44dc175e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20M=C3=BCller?= Date: Tue, 28 May 2019 16:49:04 +0200 Subject: [PATCH] mgr/dashboard: Add succeeded action labels MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Succeeded action labels can be used in order to show the right tense for a succeeded action in a success notification. Fixes: https://tracker.ceph.com/issues/36722 Signed-off-by: Stephan Müller --- .../src/app/shared/constants/app.constants.ts | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts index 15bafc6c7da..b8762e15ac3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts @@ -131,3 +131,76 @@ export class ActionLabelsI18n { this.UNPROTECT = this.i18n('Unprotect'); } } + +@Injectable({ + providedIn: 'root' +}) +export class SucceededActionLabelsI18n { + /* This service is required as the i18n polyfill does not provide static + translation + */ + CREATED: string; + DELETED: string; + ADDED: string; + REMOVED: string; + EDITED: string; + CANCELED: string; + COPIED: string; + CLONED: string; + DEEP_SCRUBBED: string; + DESTROYED: string; + FLATTENED: string; + MARKED_DOWN: string; + MARKED_IN: string; + MARKED_LOST: string; + MARKED_OUT: string; + PROTECTED: string; + PURGED: string; + RENAMED: string; + RESTORED: string; + REWEIGHTED: string; + ROLLED_BACK: string; + SCRUBBED: string; + SHOWED: string; + TRASHED: string; + UNPROTECTED: string; + + constructor(private i18n: I18n) { + /* Create a new item */ + this.CREATED = this.i18n('Created'); + + /* Destroy an existing item */ + this.DELETED = this.i18n('Deleted'); + + /* Add an existing item to a container */ + this.ADDED = this.i18n('Added'); + + /* Remove an item from a container WITHOUT deleting it */ + this.REMOVED = this.i18n('Removed'); + + /* Make changes to an existing item */ + this.EDITED = this.i18n('Edited'); + this.CANCELED = this.i18n('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'); + } +} -- 2.39.5