You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/07/05 15:56:21 UTC

[GitHub] [cloudstack-primate] nvazquez opened a new pull request #493: Internationalize state output

nvazquez opened a new pull request #493:
URL: https://github.com/apache/cloudstack-primate/pull/493


   CloudStack API methods return resources states in English, switching Primate to a different language should also translate these states.
   
   Example: VM states: Running, Stopped, Migrating,...
   
   ![image](https://user-images.githubusercontent.com/5295080/86536532-ce27cd00-bebe-11ea-87a4-d7c079539435.png)
   ![image](https://user-images.githubusercontent.com/5295080/86536536-da138f00-bebe-11ea-8865-60b0751b5404.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack-primate] rhtyd commented on a change in pull request #493: Internationalize state output

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #493:
URL: https://github.com/apache/cloudstack-primate/pull/493#discussion_r449892692



##########
File path: src/components/widgets/Status.vue
##########
@@ -38,7 +38,37 @@ export default {
   methods: {
     getText () {
       if (this.displayText && this.text) {
-        return this.text.charAt(0).toUpperCase() + this.text.slice(1)
+        var state = this.text
+        switch (state) {
+          case 'Running':
+            state = this.$t('state.running')
+            break
+          case 'Stopped':
+            state = this.$t('state.stopped')
+            break
+          case 'Starting':
+            state = this.$t('state.starting')
+            break
+          case 'Stopping':
+            state = this.$t('state.stopping')
+            break
+          case 'Suspended':
+            state = this.$t('state.suspended')
+            break
+          case 'Pending':
+            state = this.$t('state.pending')
+            break
+          case 'Migrating':
+            state = this.$t('state.migrating')
+            break
+          case 'Expunging':
+            state = this.$t('state.expunging')
+            break
+          case 'Error':
+            state = this.$t('state.error')
+            break
+        }
+        return state.charAt(0).toUpperCase() + state.slice(1)

Review comment:
       In non-English languages, this might cause an issue? (many languages don't have notion of upper vs lower case)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack-primate] blueorangutan commented on pull request #493: Internationalize state output

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #493:
URL: https://github.com/apache/cloudstack-primate/pull/493#issuecomment-653915037


   @nvazquez a Jenkins job has been kicked to build primate packages. I'll keep you posted as I make progress.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack-primate] blueorangutan commented on pull request #493: Internationalize state output

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #493:
URL: https://github.com/apache/cloudstack-primate/pull/493#issuecomment-653915969


   Packaging result: :heavy_check_mark:centos :heavy_check_mark:debian :heavy_check_mark:archive.
   QA: http://primate-qa.cloudstack.cloud:8080/client/pr/493 (JID-2217)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack-primate] nvazquez commented on pull request #493: Internationalize state output

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #493:
URL: https://github.com/apache/cloudstack-primate/pull/493#issuecomment-653914970


   @blueorangutan package


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack-primate] rhtyd merged pull request #493: Internationalize state output

Posted by GitBox <gi...@apache.org>.
rhtyd merged pull request #493:
URL: https://github.com/apache/cloudstack-primate/pull/493


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack-primate] nvazquez commented on a change in pull request #493: Internationalize state output

Posted by GitBox <gi...@apache.org>.
nvazquez commented on a change in pull request #493:
URL: https://github.com/apache/cloudstack-primate/pull/493#discussion_r449901687



##########
File path: src/components/widgets/Status.vue
##########
@@ -38,7 +38,37 @@ export default {
   methods: {
     getText () {
       if (this.displayText && this.text) {
-        return this.text.charAt(0).toUpperCase() + this.text.slice(1)
+        var state = this.text
+        switch (state) {
+          case 'Running':
+            state = this.$t('state.running')
+            break
+          case 'Stopped':
+            state = this.$t('state.stopped')
+            break
+          case 'Starting':
+            state = this.$t('state.starting')
+            break
+          case 'Stopping':
+            state = this.$t('state.stopping')
+            break
+          case 'Suspended':
+            state = this.$t('state.suspended')
+            break
+          case 'Pending':
+            state = this.$t('state.pending')
+            break
+          case 'Migrating':
+            state = this.$t('state.migrating')
+            break
+          case 'Expunging':
+            state = this.$t('state.expunging')
+            break
+          case 'Error':
+            state = this.$t('state.error')
+            break
+        }
+        return state.charAt(0).toUpperCase() + state.slice(1)

Review comment:
       Have tested every language manually on Chrome and Firefox and found no issues.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org