From: Stephan Müller Date: Tue, 28 May 2019 14:49:04 +0000 (+0200) Subject: mgr/dashboard: Add succeeded action labels X-Git-Tag: v15.1.0~2271^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c5d30b818760b6ef1e1b6ef69dbf6b0b44dc175e;p=ceph.git mgr/dashboard: Add succeeded action labels 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 --- 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 15bafc6c7da8..b8762e15ac35 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'); + } +}