Skip to content

Commit 008097f

Browse files
nvazquezyadvr
authored andcommitted
state: Internationalize VM state output (#493)
CloudStack API methods return resources states in English, switching Primate to a different language should also translate these states. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent df50082 commit 008097f

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

ui/src/components/widgets/Status.vue

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,37 @@ export default {
3838
methods: {
3939
getText () {
4040
if (this.displayText && this.text) {
41-
return this.text.charAt(0).toUpperCase() + this.text.slice(1)
41+
var state = this.text
42+
switch (state) {
43+
case 'Running':
44+
state = this.$t('state.running')
45+
break
46+
case 'Stopped':
47+
state = this.$t('state.stopped')
48+
break
49+
case 'Starting':
50+
state = this.$t('state.starting')
51+
break
52+
case 'Stopping':
53+
state = this.$t('state.stopping')
54+
break
55+
case 'Suspended':
56+
state = this.$t('state.suspended')
57+
break
58+
case 'Pending':
59+
state = this.$t('state.pending')
60+
break
61+
case 'Migrating':
62+
state = this.$t('state.migrating')
63+
break
64+
case 'Expunging':
65+
state = this.$t('state.expunging')
66+
break
67+
case 'Error':
68+
state = this.$t('state.error')
69+
break
70+
}
71+
return state.charAt(0).toUpperCase() + state.slice(1)
4272
}
4373
return ''
4474
},

0 commit comments

Comments
 (0)