[chronojump] Export session now uses latin or English correctly



commit bd06b12d17508c220460bec3df81e6201c5c1b40
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 15 13:29:15 2017 +0200

    Export session now uses latin or English correctly

 src/constants.cs     |   12 ++++++++++--
 src/exportSession.cs |    6 ++++--
 src/gui/encoder.cs   |    6 +++---
 3 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/constants.cs b/src/constants.cs
index 8aca135..7cc4443 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -239,8 +239,16 @@ public class Constants
        public static string TakeOffWeightName = "TakeOffWeight"; //translate (take off?)
 
 
-       public static string SpreadsheetString = "\n\n" + Catalog.GetString("When import from your 
spreadsheet (OpenOffice, R, MS Excel, ...)\nremember the separator character is semicolon <b>;</b>, or comma 
<b>,</b>.") + 
-                       "\n\n" + Catalog.GetString("This can be changed on preferences.");
+       public static string GetSpreadsheetString(string CSVExportDecimalSeparator)
+       {
+               string sep = ";";
+               if(CSVExportDecimalSeparator != "COMMA")
+                       sep = ",";
+
+               return "\n\n" + Catalog.GetString("When import from your spreadsheet (LibreOffice, R, MS 
Excel, ...)") + "\n" +
+                       Catalog.GetString("Remember the separator character is:") + " <b>" + sep + "</b>" + 
"\n\n" +
+                       Catalog.GetString("This can be changed at preferences.");
+       }
 
 /*     OLD, check this
        public static string PotencyLewisCMJFormula = Catalog.GetString("Peak Power")+ " CMJ (Lewis) " +
diff --git a/src/exportSession.cs b/src/exportSession.cs
index ec76603..c40d3e4 100644
--- a/src/exportSession.cs
+++ b/src/exportSession.cs
@@ -931,7 +931,7 @@ public class ExportSessionCSV : ExportSession
                this.mySession = mySession;
                this.preferences = preferences;
        
-               spreadsheetString = Constants.SpreadsheetString;
+               spreadsheetString = Constants.GetSpreadsheetString(preferences.CSVExportDecimalSeparator);
 
                checkFile("CSV");
        }
@@ -942,8 +942,10 @@ public class ExportSessionCSV : ExportSession
                        //correctly separate the rows with no problems with decimals
                        //delete the ';'
                        exportData[i] = exportData[i].ToString().Replace(";", " ");
-                       
+
                        bool latin = true;
+                       if(preferences.CSVExportDecimalSeparator != "COMMA")
+                               latin = false;
 
                        if(latin) {
                                //put ';' as separator
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index a8ff4fa..3e80344 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -1882,7 +1882,7 @@ public partial class ChronoJumpWindow
                                                        exportFileName);
                                        if(checkFileOp == Constants.EncoderCheckFileOp.CAPTURE_EXPORT_ALL ||
                                                        checkFileOp == 
Constants.EncoderCheckFileOp.ANALYZE_SAVE_AB)
-                                               myString += Constants.SpreadsheetString;
+                                               myString += 
Constants.GetSpreadsheetString(preferences.CSVExportDecimalSeparator);
                                        new DialogMessage(Constants.MessageTypes.INFO, myString);
                                }
                        } catch {
@@ -1909,7 +1909,7 @@ public partial class ChronoJumpWindow
                on_button_encoder_export_all_curves_file_selected (exportFileName);
 
                string myString = string.Format(Catalog.GetString("Saved to {0}"), 
-                               exportFileName) + Constants.SpreadsheetString;
+                               exportFileName) + 
Constants.GetSpreadsheetString(preferences.CSVExportDecimalSeparator);
                new DialogMessage(Constants.MessageTypes.INFO, myString);
        }
        private void on_overwrite_file_encoder_save_image_accepted(object o, EventArgs args)
@@ -1924,7 +1924,7 @@ public partial class ChronoJumpWindow
                on_button_encoder_save_AB_file_selected (exportFileName);
 
                string myString = string.Format(Catalog.GetString("Saved to {0}"), 
-                               exportFileName) + Constants.SpreadsheetString;
+                               exportFileName) + 
Constants.GetSpreadsheetString(preferences.CSVExportDecimalSeparator);
                new DialogMessage(Constants.MessageTypes.INFO, myString);
        }
        private void on_overwrite_file_encoder_save_table_accepted(object o, EventArgs args)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]