mirror of https://github.com/rancher/ui.git
commit
6ab0bd2315
|
|
@ -1,9 +1,5 @@
|
||||||
{{#if hasBlock}}
|
{{#if hasBlock}}
|
||||||
{{yield}}
|
{{yield}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if model.localizedState}}
|
{{model.displayState}}
|
||||||
{{t model.localizedState}}
|
{{/if}}
|
||||||
{{else}}
|
|
||||||
{{model.displayState}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
|
||||||
|
|
@ -465,23 +465,20 @@ export default Mixin.create({
|
||||||
|
|
||||||
// This is like this so you can override the displayed state calculation
|
// This is like this so you can override the displayed state calculation
|
||||||
displayState: alias('_displayState'),
|
displayState: alias('_displayState'),
|
||||||
_displayState: computed('relevantState', function() {
|
_displayState: computed('relevantState', 'intl.locale', function() {
|
||||||
var state = get(this, 'relevantState') || '';
|
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 state.split(/-/).map((word) => {
|
||||||
return ucFirst(word);
|
return ucFirst(word);
|
||||||
}).join('-');
|
}).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() {
|
showTransitioningMessage: computed('transitioning', 'transitioningMessage', 'displayState', function() {
|
||||||
var trans = get(this, 'transitioning');
|
var trans = get(this, 'transitioning');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue