diff --git a/lib/shared/addon/components/badge-state/template.hbs b/lib/shared/addon/components/badge-state/template.hbs index 75eaab892..bc4c89027 100644 --- a/lib/shared/addon/components/badge-state/template.hbs +++ b/lib/shared/addon/components/badge-state/template.hbs @@ -1,9 +1,5 @@ {{#if hasBlock}} {{yield}} {{else}} - {{#if model.localizedState}} - {{t model.localizedState}} - {{else}} - {{model.displayState}} - {{/if}} -{{/if}} \ No newline at end of file + {{model.displayState}} +{{/if}} diff --git a/lib/shared/addon/mixins/cattle-transitioning-resource.js b/lib/shared/addon/mixins/cattle-transitioning-resource.js index e0275150b..37e92e3b3 100644 --- a/lib/shared/addon/mixins/cattle-transitioning-resource.js +++ b/lib/shared/addon/mixins/cattle-transitioning-resource.js @@ -465,23 +465,20 @@ export default Mixin.create({ // This is like this so you can override the displayed state calculation displayState: alias('_displayState'), - _displayState: computed('relevantState', function() { - var state = get(this, 'relevantState') || ''; + _displayState: computed('relevantState', 'intl.locale', function() { + const intl = get(this, 'intl'); + const state = get(this, 'relevantState') || ''; + const key = `resourceState.${ (state || 'unknown').toLowerCase() }`; + + if ( intl.locale && intl.exists(key) ) { + return intl.t(key); + } return state.split(/-/).map((word) => { return ucFirst(word); }).join('-'); }), - localizedState: computed('relevantState', function() { - const intl = get(this, 'intl'); - const key = `resourceState.${ (get(this, 'relevantState') || 'unknown').toLowerCase() }`; - - if ( intl.exists(key) ) { - return key; - } - }), - showTransitioningMessage: computed('transitioning', 'transitioningMessage', 'displayState', function() { var trans = get(this, 'transitioning');