From 324203b552c10f5db18dffda647a6e9ecc4d709f Mon Sep 17 00:00:00 2001
From: bprovot <bertrand.provot@insa-rennes.fr>
Date: Thu, 21 Jun 2018 17:51:34 +0200
Subject: [PATCH] translation log part2 (DCT, transforms)

---
 app/Algorithms/DCT.cpp        |  7 ++++---
 app/Operations/Transforms.cpp |  3 ++-
 app/imageinsa_en.ts           | 32 ++++++++++++++++++++++++++++++++
 app/imageinsa_fr.ts           | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/app/Algorithms/DCT.cpp b/app/Algorithms/DCT.cpp
index 1fcafeb..ba9e8f2 100644
--- a/app/Algorithms/DCT.cpp
+++ b/app/Algorithms/DCT.cpp
@@ -19,6 +19,7 @@
 
 #include <cstdio>
 #include "DCT.h"
+#include "../Tools.h"
 #include <Converter.h>
 
 using namespace std;
@@ -187,7 +188,7 @@ string tronc(Image_t<double>*img, int limit)
         }
     }
     debit = debit * 8. / 256.;
-    sprintf(buffer, "\nLe debit vaut : %5.2f\n\n", debit);
+    sprintf(buffer, QString(qApp->translate("Operations", "\nLe debit vaut : %5.2f\n\n")).toUtf8(), debit);
     return buffer;
 }
 
@@ -205,7 +206,7 @@ string reduce(Image_t<double>* img, int nBitInit, double slope)
     double debit = 0;
 
     char buffer[100];
-    string cs = "\n---------Matrice d'allocation de bits---------\n\n";
+    string cs = QString(qApp->translate("Operations","\n---------Matrice d'allocation de bits---------\n\n")).toStdString();
 
     for(unsigned int i = 0; i <16; ++i) {
         for(unsigned int j = 0; j <16; ++j) {
@@ -227,7 +228,7 @@ string reduce(Image_t<double>* img, int nBitInit, double slope)
         cs = cs + "\n";
     }
     debit /= (16 * 16);
-    sprintf(buffer, "\nLe debit vaut : %5.2f\n\n",debit);
+    sprintf(buffer, QString(qApp->translate("Operations","\nLe debit vaut : %5.2f\n\n")).toUtf8(),debit);
     cs = cs + buffer;
 
 
diff --git a/app/Operations/Transforms.cpp b/app/Operations/Transforms.cpp
index 61a5811..8f05cad 100644
--- a/app/Operations/Transforms.cpp
+++ b/app/Operations/Transforms.cpp
@@ -17,6 +17,7 @@
  * along with ImageINSA.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "../Tools.h"
 #include "Transforms.h"
 #include <GrayscaleImage.h>
 #include <cstring>
@@ -464,7 +465,7 @@ string hadamard_haar_88( const Image *im, Image_t<double> **resImg, Image **invI
 *---------------------------------------------------------------------*/
 
     char buffer[100];
-    returnval = "\n\nmatrice de transformation utilisee : \n";
+    returnval = QString(qApp->translate("Operations","\n\nmatrice de transformation utilisee : \n")).toStdString();
 
     for(int i=0 ; i<idt ; i++)
     {
diff --git a/app/imageinsa_en.ts b/app/imageinsa_en.ts
index a07a675..54ebf1e 100644
--- a/app/imageinsa_en.ts
+++ b/app/imageinsa_en.ts
@@ -1446,6 +1446,38 @@ Channel %d :
         <source>L&apos;entropie de l&apos;etage %d est %1f
 </source>
         <translation>The stage %d entropy is %1f
+</translation>
+    </message>
+    <message>
+        <location filename="Operations/Transforms.cpp" line="468"/>
+        <source>
+
+matrice de transformation utilisee : 
+</source>
+        <translation>
+
+Used transformation matrix : 
+</translation>
+    </message>
+    <message>
+        <location filename="Algorithms/DCT.cpp" line="191"/>
+        <location filename="Algorithms/DCT.cpp" line="231"/>
+        <source>
+Le debit vaut : %5.2f
+
+</source>
+        <translation>The flow is : %5.2f
+</translation>
+    </message>
+    <message>
+        <location filename="Algorithms/DCT.cpp" line="209"/>
+        <source>
+---------Matrice d&apos;allocation de bits---------
+
+</source>
+        <translation>
+---------Bits allocation matrix---------
+
 </translation>
     </message>
     <message>
diff --git a/app/imageinsa_fr.ts b/app/imageinsa_fr.ts
index ae4ecc8..23ddda8 100644
--- a/app/imageinsa_fr.ts
+++ b/app/imageinsa_fr.ts
@@ -1434,6 +1434,39 @@ Canal %d :
         <source>L&apos;entropie de l&apos;etage %d est %1f
 </source>
         <translation>L&apos;entropie de l&apos;étage %d est %1f
+</translation>
+    </message>
+    <message>
+        <location filename="Operations/Transforms.cpp" line="468"/>
+        <source>
+
+matrice de transformation utilisee : 
+</source>
+        <translation>
+
+Matrice de transformation utilisée : 
+</translation>
+    </message>
+    <message>
+        <location filename="Algorithms/DCT.cpp" line="191"/>
+        <location filename="Algorithms/DCT.cpp" line="231"/>
+        <source>
+Le debit vaut : %5.2f
+
+</source>
+        <translation>
+Le débit vaut : %5.2f
+</translation>
+    </message>
+    <message>
+        <location filename="Algorithms/DCT.cpp" line="209"/>
+        <source>
+---------Matrice d&apos;allocation de bits---------
+
+</source>
+        <translation>
+---------Matrice d&apos;allocation de bits---------
+
 </translation>
     </message>
     <message>
-- 
GitLab