Skip to content

Commit f922091

Browse files
vishesh92DaanHoogland
authored andcommitted
UI: Fix missing locale strings for Status widget
1 parent 5f8450f commit f922091

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

ui/src/components/widgets/Status.vue

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,24 @@ export default {
166166
if (!(state && this.displayText)) {
167167
return ''
168168
}
169+
let result
169170
if (this.$route.path === '/vmsnapshot' || this.$route.path.includes('/vmsnapshot/')) {
170-
return this.$t('message.vmsnapshot.state.' + state.toLowerCase())
171+
result = this.$t('message.vmsnapshot.state.' + state.toLowerCase())
172+
} else if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) {
173+
result = this.$t('message.vm.state.' + state.toLowerCase())
174+
} else if (this.$route.path === '/volume' || this.$route.path.includes('/volume/')) {
175+
result = this.$t('message.volume.state.' + state.toLowerCase())
176+
} else if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) {
177+
result = this.$t('message.guestnetwork.state.' + state.toLowerCase())
178+
} else if (this.$route.path === '/publicip' || this.$route.path.includes('/publicip/')) {
179+
result = this.$t('message.publicip.state.' + state.toLowerCase())
171180
}
172-
if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) {
173-
return this.$t('message.vm.state.' + state.toLowerCase())
174-
}
175-
if (this.$route.path === '/volume' || this.$route.path.includes('/volume/')) {
176-
return this.$t('message.volume.state.' + state.toLowerCase())
177-
}
178-
if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) {
179-
return this.$t('message.guestnetwork.state.' + state.toLowerCase())
180-
}
181-
if (this.$route.path === '/publicip' || this.$route.path.includes('/publicip/')) {
182-
return this.$t('message.publicip.state.' + state.toLowerCase())
181+
182+
if (!result || (result.startsWith('message.') && result.endsWith('.state.' + state.toLowerCase()))) {
183+
// Nothing for snapshots, vpcs, gateways, vnpnconn, vpnuser, kubectl, event, project, account, infra. They're all self explanatory
184+
result = this.$t(state)
183185
}
184-
// Nothing for snapshots, vpcs, gateways, vnpnconn, vpnuser, kubectl, event, project, account, infra. They're all self explanatory
185-
return this.$t(state)
186+
return result
186187
},
187188
getStyle () {
188189
let styles = { display: 'inline-flex' }

0 commit comments

Comments
 (0)