[Kimchi-devel] [PATCH 2/3] Fix WOK UI error messages

Ramon Medeiros ramonn at linux.vnet.ibm.com
Tue Nov 24 20:11:09 UTC 2015


Remove unused messages and correct prefix (change from KCH to WOK)

Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
---
 ui/js/src/wok.confirm.js       |   4 +-
 ui/js/src/wok.grid.js          |  10 +--
 ui/js/src/wok.line-chart.js    |   2 +-
 ui/js/src/wok.list.js          |  10 +--
 ui/js/src/wok.main.js          |   2 +-
 ui/js/widgets/filter-select.js |   4 +-
 ui/pages/i18n.json.tmpl        | 168 +++--------------------------------------
 7 files changed, 25 insertions(+), 175 deletions(-)

diff --git a/ui/js/src/wok.confirm.js b/ui/js/src/wok.confirm.js
index 63f01c4..3e7ce54 100644
--- a/ui/js/src/wok.confirm.js
+++ b/ui/js/src/wok.confirm.js
@@ -56,8 +56,8 @@ wok.confirm = function(settings, confirmCallback, cancelCallback) {
                     settings.content,
                 '</div>',
                 '<div class="modal-footer">',
-                    '<button id="button-confirm" class="btn btn-default">' + (settings.confirm || i18n['KCHAPI6004M']) + '</button>',
-                    '<button id="button-cancel" class="btn btn-default">' + (settings.cancel || i18n['KCHAPI6003M']) + '</button>',
+                    '<button id="button-confirm" class="btn btn-default">' + (settings.confirm || i18n['WOKAPI6004M']) + '</button>',
+                    '<button id="button-cancel" class="btn btn-default">' + (settings.cancel || i18n['WOKAPI6003M']) + '</button>',
                 '</div>',
             '</div>',
         '</div>'
diff --git a/ui/js/src/wok.grid.js b/ui/js/src/wok.grid.js
index 5913a7f..48bdfad 100644
--- a/ui/js/src/wok.grid.js
+++ b/ui/js/src/wok.grid.js
@@ -192,10 +192,10 @@ wok.widget.Grid.prototype = (function() {
         var rowSelection = this['opts']['rowSelection'] || 'single';
         var domNode = $(wok.substitute(htmlStr, {
             id: gridID,
-            loading: i18n['KCHGRD6001M'],
-            message: i18n['KCHGRD6002M'],
-            buttonLabel: i18n['KCHGRD6003M'],
-            detailedLabel: i18n['KCHGRD6004']
+            loading: i18n['WOKGRD6001M'],
+            message: i18n['WOKGRD6002M'],
+            buttonLabel: i18n['WOKGRD6003M'],
+            detailedLabel: i18n['WOKGRD6004M']
         })).appendTo(container);
         this.domNode = domNode;
 
@@ -311,4 +311,4 @@ wok.widget.Grid.prototype = (function() {
         //destroy: destroy,
         showMessage: showMessage
     };
-})();
\ No newline at end of file
+})();
diff --git a/ui/js/src/wok.line-chart.js b/ui/js/src/wok.line-chart.js
index 3eb3494..d6fca9c 100644
--- a/ui/js/src/wok.line-chart.js
+++ b/ui/js/src/wok.line-chart.js
@@ -104,7 +104,7 @@ wok.widget.LineChart = function(params) {
         ];
 
 
-        var maxValueLabel = i18n['KCHHOST6001M'] + ' ' +
+        var maxValueLabel = i18n['WOKHOST6001M'] + ' ' +
             (type === 'value'
                 ? wok.formatMeasurement(maxValue, formatSettings)
                 : '100%');
diff --git a/ui/js/src/wok.list.js b/ui/js/src/wok.list.js
index 21aa9fd..a7c43d6 100644
--- a/ui/js/src/wok.list.js
+++ b/ui/js/src/wok.list.js
@@ -237,10 +237,10 @@ wok.widget.List.prototype = (function() {
         var rowSelection = this.opts.rowSelection || 'single';
         var domNode = $(wok.substitute(htmlStr, {
             id: gridID,
-            loading: i18n.KCHGRD6001M,
-            message: i18n.KCHGRD6002M,
-            buttonLabel: i18n.KCHGRD6003M,
-            detailedLabel: i18n.KCHGRD6004
+            loading: i18n.WOKGRD6001M,
+            message: i18n.WOKGRD6002M,
+            buttonLabel: i18n.WOKGRD6003M,
+            detailedLabel: i18n.WOKGRD6004M
         })).appendTo(container);
         this.domNode = domNode;
 
@@ -299,4 +299,4 @@ wok.widget.List.prototype = (function() {
         reload: reload,
         showMessage: showMessage
     };
-})();
\ No newline at end of file
+})();
diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js
index 1330ac1..c0d5872 100644
--- a/ui/js/src/wok.main.js
+++ b/ui/js/src/wok.main.js
@@ -316,7 +316,7 @@ wok.main = function() {
                 return;
             }
             else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !wok.isLoggingOut && errorMsg == "") {
-               errorMsg = i18n['KCHAPI6007E'].replace("%1", jqXHR.state());
+               errorMsg = i18n['WOKAPI6007E'].replace("%1", jqXHR.state());
                wok.message.error(errorMsg);
             }
             if(ajaxSettings['originalError']) {
diff --git a/ui/js/widgets/filter-select.js b/ui/js/widgets/filter-select.js
index 8e78fc1..d884962 100644
--- a/ui/js/widgets/filter-select.js
+++ b/ui/js/widgets/filter-select.js
@@ -54,7 +54,7 @@
                     that.listControl.html('');
                     var items = that._dataList(options);
                     if (items.length === 0) {
-                        that.listControl.html(i18n['KCHAPI6005E']);
+                        that.listControl.html(i18n['WOKAPI6005E']);
                     } else {
                         $.each(items, function(index, item) {
                             that.listControl.append(item);
@@ -74,7 +74,7 @@
                     });
                     if (that.listControl.html() === '') {
                         that.target.addClass("invalid-field");
-                        that.listControl.html(i18n['KCHAPI6005E']);
+                        that.listControl.html(i18n['WOKAPI6005E']);
                     } else {
                         that.target.removeClass("invalid-field");
                     }
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index 8753a6e..7188a98 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -24,166 +24,16 @@
 #silent _ = t.gettext
 #silent _t = t.gettext
 {
-    "KCHAUTH6001E": "$_("The username or password you entered is incorrect. Please try again.")",
-    "KCHAUTH6002E": "$_("This field is required.")",
+    "WOKAPI6005E": "$_("No such data available.")",
+    "WOKAPI6007E": "$_("Can not contact the host system. Verify the host system is up and that you have network connectivity to it. HTTP request response %1. ")",
 
-    "KCHAUTH6001M": "$_("Log in")",
-    "KCHAUTH6002M": "$_("Logging in...")",
+    "WOKAPI6003M": "$_("Cancel")",
+    "WOKAPI6004M": "$_("Confirm")",
 
-    "Host": "$_("Host")",
-    "Guests": "$_("Guests")",
-    "Templates": "$_("Templates")",
-    "Storage": "$_("Storage")",
-    "Network": "$_("Network")",
+    "WOKGRD6001M": "$_("Loading...")",
+    "WOKGRD6002M": "$_("An error occurred while retrieving system information.")",
+    "WOKGRD6003M": "$_("Retry")",
+    "WOKGRD6004M": "$_("Detailed message:")",
 
-    "KCHAPI6002E": "$_("Failed to get application configuration")",
-    "KCHAPI6003E": "$_("This is not a valid Linux path")",
-    "KCHAPI6004E": "$_("This is not a valid URL.")",
-    "KCHAPI6005E": "$_("No such data available.")",
-    "KCHAPI6007E": "$_("Can not contact the host system. Verify the host system is up and that you have network connectivity to it. HTTP request response %1. ")",
-    "KCHAPI6008E": "$_("Unable to read file.")",
-    "KCHAPI6009E": "$_("Error while uploading file.")",
-
-    "KCHAPI6001M": "$_("Delete Confirmation")",
-    "KCHAPI6002M": "$_("OK")",
-    "KCHAPI6003M": "$_("Cancel")",
-    "KCHAPI6004M": "$_("Confirm")",
-    "KCHAPI6005M": "$_("Create")",
-    "KCHAPI6006M": "$_("Warning")",
-    "KCHAPI6007M": "$_("Save")",
-    "KCHAPI6008M": "$_("Creating...")",
-    "KCHAPI6009M": "$_("Cloning...")",
-
-    "KCHGRD6001M": "$_("Loading...")",
-    "KCHGRD6002M": "$_("An error occurred while retrieving system information.")",
-    "KCHGRD6003M": "$_("Retry")",
-    "KCHGRD6004M": "$_("Detailed message:")",
-
-    "KCHTMPL6001W": "$_("No ISO found")",
-
-    "KCHTMPL6002E": "$_("This is not a valid ISO file.")",
-
-    "KCHTMPL6002M": "$_("This may take a long time. Do you want to continue?")",
-    "KCHTMPL6003M": "$_("This will permanently delete the template. Would you like to continue?")",
-
-    "KCHHOST6001E": "$_("Unable to shut down system as there are some virtual machines running!")",
-
-    "KCHHOST6001M": "$_("Max:")",
-    "KCHHOST6002M": "$_("Utilization")",
-    "KCHHOST6003M": "$_("Available")",
-    "KCHHOST6004M": "$_("Read Rate")",
-    "KCHHOST6005M": "$_("Write Rate")",
-    "KCHHOST6006M": "$_("Received")",
-    "KCHHOST6007M": "$_("Sent")",
-    "KCHHOST6008M": "$_("Shutting down or restarting host will cause unsaved work lost. Continue to shut down/restarting?")",
-
-
-    "KCHREPO6001M": "$_("Confirm")",
-    "KCHREPO6002M": "$_("Repository will be removed permanently and can't be recovered. Do you want to continue?")",
-    "KCHREPO6003M": "$_("Repositories")",
-    "KCHREPO6004M": "$_("ID")",
-    "KCHREPO6005M": "$_("Name")",
-    "KCHREPO6006M": "$_("Base URL")",
-    "KCHREPO6007M": "$_("Is Mirror")",
-    "KCHREPO6008M": "$_("URL Args")",
-    "KCHREPO6009M": "$_("Enabled")",
-    "KCHREPO6010M": "$_("GPG Check")",
-    "KCHREPO6011M": "$_("GPG Key")",
-    "KCHREPO6012M": "$_("Add")",
-    "KCHREPO6013M": "$_("Edit")",
-    "KCHREPO6014M": "$_("Remove")",
-    "KCHREPO6016M": "$_("Enable")",
-    "KCHREPO6017M": "$_("Disable")",
-
-
-    "KCHUPD6001M": "$_("Software Updates")",
-    "KCHUPD6002M": "$_("Package Name")",
-    "KCHUPD6003M": "$_("Version")",
-    "KCHUPD6004M": "$_("Architecture")",
-    "KCHUPD6005M": "$_("Repository")",
-    "KCHUPD6006M": "$_("Update All")",
-    "KCHUPD6007M": "$_("Updating...")",
-    "KCHUPD6008M": "$_("Failed to retrieve packages update information.")",
-    "KCHUPD6009M": "$_("Failed to update package(s).")",
-
-
-    "KCHDR6001M": "$_("Debug report will be removed permanently and can't be recovered. Do you want to continue?")",
-    "KCHDR6002M": "$_("Debug Reports")",
-    "KCHDR6003M": "$_("Name")",
-    "KCHDR6005M": "$_("Generated Time")",
-    "KCHDR6006M": "$_("Generate")",
-    "KCHDR6007M": "$_("Generating...")",
-    "KCHDR6008M": "$_("Rename")",
-    "KCHDR6009M": "$_("Remove")",
-    "KCHDR6010M": "$_("Download")",
-    "KCHDR6011M": "$_("Report name should contain only letters, digits, underscore ('_') and/or hyphen ('-').")",
-    "KCHDR6012M": "$_("Pending...")",
-    "KCHDR6013M": "$_("Report name is the same as the original one.")",
-
-    "KCHVM6001M": "$_("This will delete the virtual machine and its virtual disks. This operation cannot be undone. Would you like to continue?")",
-    "KCHVM6002M": "$_("Power off Confirmation")",
-    "KCHVM6003M": "$_("This action may produce undesirable results, "
-                      "for example unflushed disk cache in the guest. "
-                      "Would you like to continue?")",
-    "KCHVM6004M": "$_("Reset Confirmation")",
-    "KCHVM6005M": "$_("There is a risk of data loss caused by reset without"
-                      " the guest OS shutdown. Would you like to continue?")",
-    "KCHVM6006M": "$_("Shut Down Confirmation")",
-    "KCHVM6007M": "$_("Note the guest OS may ignore this request. Would you like to continue?")",
-    "KCHVM6008M": "$_("Virtual Machine delete Confirmation")",
-    "KCHVM6009M": "$_("This virtual machine is not persistent. Power Off will delete it. Continue?")",
-    "KCHVM6010M": "$_("When the target guest has SCSI or iSCSI volumes, they will be cloned on default storage pool. The same will happen when the target pool does not have enough space to clone the volumes. Do you want to continue?")",
-
-    "KCHVMCD6001M": "$_("This CDROM will be detached permanently and you can re-attach it. Continue to detach it?")",
-    "KCHVMCD6002M": "$_("Attach")",
-    "KCHVMCD6003M": "$_("Attaching...")",
-    "KCHVMCD6004M": "$_("Replace")",
-    "KCHVMCD6005M": "$_("Replacing...")",
-    "KCHVMCD6006M": "$_("Successfully attached!")",
-    "KCHVMCD6007M": "$_("Successfully replaced!")",
-    "KCHVMCD6008M": "$_("Successfully detached!")",
-    "KCHVMCD6009M": "$_("This disk will be detached permanently and you can re-attach it. Continue to detach it?")",
-
-    "KCHVMED6001M": "$_("interface:")",
-    "KCHVMED6002M": "$_("address:")",
-    "KCHVMED6003M": "$_("link_type:")",
-    "KCHVMED6004M": "$_("block:")",
-    "KCHVMED6005M": "$_("drive_type:")",
-    "KCHVMED6006M": "$_("model:")",
-    "KCHVMED6007M": "$_("Affected devices:")",
-
-    "KCHNET6001E": "$_("The VLAN id must be between 1 and 4094.")",
-
-    "KCHNET6001M": "$_("unavailable")",
-    "KCHNET6002M": "$_("This action will interrupt network connectivity for any virtual machine that depend on this network.")",
-    "KCHNET6003M": "$_("Create a network")",
-    "KCHNET6004M": "$_("This network is not persistent. Instead of stop, this action will permanently delete it. Would you like to continue?")",
-    "KCHNET6001W": "$_("The bridged VLAN tag may not work well with NetworkManager enabled. You should consider disabling it.")",
-
-    "KCHPOOL6001M": "$_("This will permanently delete the storage pool. Would you like to continue?")",
-    "KCHPOOL6002M": "$_("This storage pool is empty.")",
-    "KCHPOOL6003M": "$_("It will format your disk and you will loose any data in there, are you sure to continue? ")",
-    "KCHPOOL6004M": "$_("SCSI Fibre Channel")",
-    "KCHPOOL6005M": "$_("No SCSI adapters found.")",
-    "KCHPOOL6006M": "$_("Loading iSCSI targets...")",
-    "KCHPOOL6007M": "$_("No iSCSI found. Please input one.")",
-    "KCHPOOL6008M": "$_("Failed to load iSCSI targets.")",
-
-    "KCHPOOL6001E": "$_("The storage pool name can not be blank.")",
-    "KCHPOOL6002E": "$_("The storage pool path can not be blank.")",
-    "KCHPOOL6003E": "$_("NFS server mount path can not be blank.")",
-    "KCHPOOL6005E": "$_("Invalid NFS mount path.")",
-    "KCHPOOL6006E": "$_("No logical device selected.")",
-    "KCHPOOL6007E": "$_("The iSCSI target can not be blank.")",
-    "KCHPOOL6008E": "$_("Server name can not be blank.")",
-    "KCHPOOL6009E": "$_("This is not a valid Server Name or IP. Please, modify it.")",
-    "KCHPOOL6010M": "$_("Looking for available partitions ...")",
-    "KCHPOOL6011M": "$_("No available partitions found.")",
-    "KCHPOOL6012M": "$_("This storage pool is not persistent. Instead of deactivate, this action will permanently delete it. Would you like to continue?")",
-    "KCHPOOL6013M": "$_("Unable to retrieve partitions information.")",
-    "KCHPOOL6014M": "$_("In progress...")",
-    "KCHPOOL6015M": "$_("Failed!")",
-
-    "KCHVMSTOR0001E": "$_("CDROM path needs to be a valid local/remote path and cannot be blank.")",
-    "KCHVMSTOR0002E": "$_("Disk pool or volume cannot be blank.")"
+    "WOKHOST6001M": "$_("Max:")"
 }
-- 
2.1.0




More information about the Kimchi-devel mailing list