diff --git a/src/Experimental.h b/src/Experimental.h index 395a4782c..c64d748a0 100644 --- a/src/Experimental.h +++ b/src/Experimental.h @@ -46,6 +46,10 @@ // JKC (effect by Norm C, 02 Oct 2013) #define EXPERIMENTAL_SCIENCE_FILTERS +// JKC an experiement to work around bug 2709 +// disabled. +//define EXPERIMENTAL_CEE_NUMBERS_OPTION + // LLL, 01 Oct 2013: // NEW key assignment view for preferences #define EXPERIMENTAL_KEY_VIEW diff --git a/src/Internat.cpp b/src/Internat.cpp index a0332f39f..fdc250f0d 100644 --- a/src/Internat.cpp +++ b/src/Internat.cpp @@ -124,6 +124,13 @@ void Internat::Init() } } +void Internat::SetCeeNumberFormat() +{ + wxSetlocale( LC_NUMERIC, "C" ); + mDecimalSeparator = '.'; +} + + wxChar Internat::GetDecimalSeparator() { return mDecimalSeparator; diff --git a/src/Internat.h b/src/Internat.h index 140cc1cd1..208dccdbf 100644 --- a/src/Internat.h +++ b/src/Internat.h @@ -116,6 +116,7 @@ public: * Normally, this is a decimal point ('.'), but e.g. Germany uses a * comma (',').*/ static wxChar GetDecimalSeparator(); + static void SetCeeNumberFormat(); /** \brief Convert a string to a number. * diff --git a/src/prefs/GUIPrefs.cpp b/src/prefs/GUIPrefs.cpp index e14dc60c9..adc5a34a4 100644 --- a/src/prefs/GUIPrefs.cpp +++ b/src/prefs/GUIPrefs.cpp @@ -209,6 +209,11 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S) S.TieCheckBox(XXO("Use mostly Left-to-Right layouts in RTL languages"), {"/GUI/RtlWorkaround", true}); +#endif +#ifdef EXPERIMENTAL_CEE_NUMBERS_OPTION + S.TieCheckBox(XXO("Never use comma as decimal point"), + {wxT("/Locale/CeeNumberFormat"), + false}); #endif } S.EndStatic(); @@ -317,6 +322,13 @@ wxString GUIPrefs::SetLang( const wxString & lang ) Internat::Init(); +#ifdef EXPERIMENTAL_CEE_NUMBERS_OPTION + bool forceCeeNumbers; + gPrefs->Read(wxT("/Locale/CeeNumberFormat"), &forceCeeNumbers, false); + if( forceCeeNumbers ) + Internat::SetCeeNumberFormat(); +#endif + // Unused strings that we want to be translated, even though // we're not using them yet... using future1 = decltype( XO("Master Gain Control") );