[Kimchi-devel] [PATCH v3] [Kimchi 1/2] Issue #998 Not all static strings are externalized

pkulkark at linux.vnet.ibm.com pkulkark at linux.vnet.ibm.com
Fri Oct 21 05:20:29 UTC 2016


From: Pooja Kulkarni <pkulkark at linux.vnet.ibm.com>

This patch externalizes all the static
strings that were not externalized in
Kimchi

Signed-off-by: Pooja Kulkarni <pkulkark at linux.vnet.ibm.com>
---
 po/POTFILES.in                             |  1 +
 ui/js/src/kimchi.guest_storage_add.main.js | 12 ++++++------
 ui/js/src/kimchi.storagepool_add_main.js   | 12 ++++++------
 ui/pages/guest-edit.html.tmpl              | 14 +++++++-------
 ui/pages/i18n.json.tmpl                    | 18 ++++++++++++++++++
 5 files changed, 38 insertions(+), 19 deletions(-)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 92eef1e..72c59ec 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,3 +1,4 @@
 # List of source files which contain translatable strings.
 i18n.py
 ui/pages/*.tmpl
+ui/pages/tabs/*.tmpl
diff --git a/ui/js/src/kimchi.guest_storage_add.main.js b/ui/js/src/kimchi.guest_storage_add.main.js
index 9fa9175..b8e088e 100644
--- a/ui/js/src/kimchi.guest_storage_add.main.js
+++ b/ui/js/src/kimchi.guest_storage_add.main.js
@@ -48,23 +48,23 @@ kimchi.switchPage = function(fromPageId, toPageId, direction) {
 
 kimchi.guest_storage_add_main = function() {
     var types = [{
-        label: 'cdrom',
+        label: i18n.KCHVMSTOR0001M,
         value: 'cdrom',
     },
     {
-        label: 'disk',
+        label: i18n.KCHVMSTOR0002M,
         value: 'disk',
     }];
     var typesRunning = [{
-        label: 'disk',
+        label: i18n.KCHVMSTOR0002M,
         value: 'disk'
     }];
 
     var source = [{
-        label: 'Pool',
+        label: i18n.KCHVMSTOR0003M,
         value: 'pool'
     },{
-        label: 'Path',
+        label: i18n.KCHVMSTOR0004M,
         value: 'path'
     }];
 
@@ -88,7 +88,7 @@ kimchi.guest_storage_add_main = function() {
     var s390xArch = 's390x';
 
     var getFormatList = function() {
-        var format = ["qcow", "qcow2", "qed", "raw", "vmdk", "vpc"];
+        var format = [i18n['KCHVMSTOR0005M'], i18n['KCHVMSTOR0006M'], i18n['KCHVMSTOR0007M'], i18n['KCHVMSTOR0008M'], i18n['KCHVMSTOR0009M'], i18n['KCHVMSTOR0010M']];
         var selectFormatHTML = '';
         var i;
         for (i = 0; i < format.length; i++) {
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 5a020ee..99275cc 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -127,7 +127,7 @@ kimchi.initStorageAddPage = function() {
     kimchi.listHostPartitions(function(data) {
         if (data.length > 0) {
             var deviceHtml = $('#partitionTmpl').html();
-            var listHtml = '<table class="table table-hover"><thead><tr><th></th><th>Device</th><th>Path</th><th>Size (GiB)</th></tr></thead><tbody>';
+            var listHtml = '<table class="table table-hover"><thead><tr><th></th><th>'+i18n['KCHPOOL6024M']+'</th><th>'+i18n['KCHPOOL6025M']+'</th><th>'+i18n['KCHPOOL6026M']+'</th></tr></thead><tbody>';
             valid_types = ['part', 'disk', 'mpath'];
             $.each(data, function(index, value) {
                 if (valid_types.indexOf(value.type) !== -1) {
@@ -149,7 +149,7 @@ kimchi.initStorageAddPage = function() {
     kimchi.getHostVgs(function(data){
         if (data.length > 0) {
             var deviceHtml = $('#existingLvmTmpl').html();
-            var listHtml = '<table class="table table-hover"><thead><tr><th></th><th>device</th><th>size (GiB)</th><th>free size (GiB)</th></tr></thead><tbody>';
+            var listHtml = '<table class="table table-hover"><thead><tr><th></th><th>'+i18n['KCHPOOL6024M']+'</th><th>'+i18n['KCHPOOL6026M']+'</th><th>'+i18n['KCHPOOL6027M']+'</th></tr></thead><tbody>';
             $.each(data, function(index, value) {
                 value.size = (value.size / 1000000000).toFixed(2);
                 value.free = (value.free / 1000000000).toFixed(2);
@@ -190,16 +190,16 @@ kimchi.initStorageAddPage = function() {
     $('#serverComboboxId').combobox();
     $('#targetFilterSelectId').filterselect();
     var options = [ {
-        label : "DIR",
+        label : i18n.KCHPOOL6020M,
         value : "dir"
     }, {
-        label : "NFS",
+        label : i18n.KCHPOOL6021M,
         value : "netfs"
     }, {
-        label : "iSCSI",
+        label : i18n.KCHPOOL6022M,
         value : "iscsi"
     }, {
-        label : "LOGICAL",
+        label : i18n.KCHPOOL6023M,
         value : "logical"
     }, {
         label : i18n.KCHPOOL6004M,
diff --git a/ui/pages/guest-edit.html.tmpl b/ui/pages/guest-edit.html.tmpl
index 88ccb10..2ac555c 100644
--- a/ui/pages/guest-edit.html.tmpl
+++ b/ui/pages/guest-edit.html.tmpl
@@ -31,12 +31,12 @@
     <div class="modal-body">
     <span id="alert-modal-container"></span>
 <ul class="nav nav-tabs" role="tablist">
-    <li role="presentation" class="active"><a href="#form-guest-edit-general" aria-controls="form-guest-edit-general" role="tab" data-id="form-guest-edit-general" data-toggle="tab">General</a></li>
-    <li role="presentation"><a href="#form-guest-edit-storage" aria-controls="form-guest-edit-storage" role="tab" data-id="form-guest-edit-storage" data-toggle="tab">Storage</a></li>
-    <li role="presentation"><a href="#form-guest-edit-interface" aria-controls="form-guest-edit-interface" role="tab" data-id="form-guest-edit-interface" data-toggle="tab">Interface</a></li>
-    <li role="presentation"><a href="#form-guest-edit-permission" aria-controls="form-guest-edit-permission" role="tab" data-id="form-guest-edit-permission" data-toggle="tab">Permission</a></li>
-    <li role="presentation"><a href="#form-guest-edit-pci" aria-controls="form-guest-edit-pci" role="form-guest-edit-pci" data-id="form-guest-edit-pci" data-toggle="tab">Pci</a></li>
-    <li role="presentation"><a href="#form-guest-edit-snapshot" aria-controls="form-guest-edit-snapshot" role="tab" data-id="form-guest-edit-snapshot" data-toggle="tab">Snapshot</a></li>
+    <li role="presentation" class="active"><a href="#form-guest-edit-general" aria-controls="form-guest-edit-general" role="tab" data-id="form-guest-edit-general" data-toggle="tab">$_("General")</a></li>
+    <li role="presentation"><a href="#form-guest-edit-storage" aria-controls="form-guest-edit-storage" role="tab" data-id="form-guest-edit-storage" data-toggle="tab">$_("Storage")</a></li>
+    <li role="presentation"><a href="#form-guest-edit-interface" aria-controls="form-guest-edit-interface" role="tab" data-id="form-guest-edit-interface" data-toggle="tab">$_("Interface")</a></li>
+    <li role="presentation"><a href="#form-guest-edit-permission" aria-controls="form-guest-edit-permission" role="tab" data-id="form-guest-edit-permission" data-toggle="tab">$_("Permission")</a></li>
+    <li role="presentation"><a href="#form-guest-edit-pci" aria-controls="form-guest-edit-pci" role="form-guest-edit-pci" data-id="form-guest-edit-pci" data-toggle="tab">$_("Pci")</a></li>
+    <li role="presentation"><a href="#form-guest-edit-snapshot" aria-controls="form-guest-edit-snapshot" role="tab" data-id="form-guest-edit-snapshot" data-toggle="tab">$_("Snapshot")</a></li>
   </ul>
         <div class="tab-content" id="guest-edit-tabs">
             <form role="tabpanel" class="tab-pane active" id="form-guest-edit-general">
@@ -92,7 +92,7 @@
                 <div class="body"></div>
             </form>
             <form role="tabpanel" class="guest-edit-interface tab-pane" id="form-guest-edit-interface">
-                <button class="add btn btn-primary"><i class="fa fa-plus-circle"></i> Add</button>
+                <button class="add btn btn-primary"><i class="fa fa-plus-circle"></i>$_("Add")</button>
                 <div class="header">
                     <span class="cell column-network">$_("Network")</span>
                     <span class="cell column-type">$_("Type")</span>
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index ba5812f..7860419 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -113,6 +113,14 @@
     "KCHPOOL6017M": "$_("This will permanently wipe the following storage volumes: %1")",
     "KCHPOOL6018M": "$_("Wipe Confirmation")",
     "KCHPOOL6019M": "$_("Select one or more partitions to be added to the logical pool %1:")",
+    "KCHPOOL6020M": "$_("DIR")",
+    "KCHPOOL6021M": "$_("NFS")",
+    "KCHPOOL6022M": "$_("iSCSI")",
+    "KCHPOOL6023M": "$_("LOGICAL")",
+    "KCHPOOL6024M": "$_("device")",
+    "KCHPOOL6025M": "$_("path")",
+    "KCHPOOL6026M": "$_("size (GiB)")",
+    "KCHPOOL6027M": "$_("free size (GiB)")",
 
     "KCHPOOL6005E": "$_("Invalid NFS mount path.")",
     "KCHPOOL6006E": "$_("No logical device selected.")",
@@ -123,6 +131,16 @@
     "KCHVMSTOR0003E": "$_("Disk size or Format or Directory path cannot be blank and Directory path needs to be a valid local/remote path.")",
     "KCHVMSTOR0004E": "$_("Disk path needs to be a valid local/remote path and cannot be blank.")",
     "KCHVMSTOR0005E": "$_("Storage pool or Disk size or Format cannot be blank.")",
+    "KCHVMSTOR0001M": "$_("cdrom")",
+    "KCHVMSTOR0002M": "$_("disk")",
+    "KCHVMSTOR0003M": "$_("Pool")",
+    "KCHVMSTOR0004M": "$_("Path")",
+    "KCHVMSTOR0005M": "$_("qcow")",
+    "KCHVMSTOR0006M": "$_("qcow2")",
+    "KCHVMSTOR0007M": "$_("qed")",
+    "KCHVMSTOR0008M": "$_("raw")",
+    "KCHVMSTOR0009M": "$_("vmdk")",
+    "KCHVMSTOR0010M": "$_("vpc")",
 
     "KCHPEERS0001M": "$_("Peers")"
 }
-- 
2.1.0




More information about the Kimchi-devel mailing list