mirror of https://github.com/rancher/ui.git
commit
6ab0bd2315
|
|
@ -1,9 +1,5 @@
|
|||
{{#if hasBlock}}
|
||||
{{yield}}
|
||||
{{else}}
|
||||
{{#if model.localizedState}}
|
||||
{{t model.localizedState}}
|
||||
{{else}}
|
||||
{{model.displayState}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{model.displayState}}
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue