mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-03 22:19:07 +02:00
Add C number format option (disabled)
The option to force decimal point in numbers and not use comma is an experiment to work around bug 2709 It's disabled, because wxWidgets checks for a mismatch between locale and number format, and disallows it. To get it working correctly might require patching wxWidgets. This change does get the option string into our source code so that translators can translate it.
This commit is contained in:
parent
5495f7ca17
commit
1f1f1d43f6
@ -46,6 +46,10 @@
|
|||||||
// JKC (effect by Norm C, 02 Oct 2013)
|
// JKC (effect by Norm C, 02 Oct 2013)
|
||||||
#define EXPERIMENTAL_SCIENCE_FILTERS
|
#define EXPERIMENTAL_SCIENCE_FILTERS
|
||||||
|
|
||||||
|
// JKC an experiement to work around bug 2709
|
||||||
|
// disabled.
|
||||||
|
//define EXPERIMENTAL_CEE_NUMBERS_OPTION
|
||||||
|
|
||||||
// LLL, 01 Oct 2013:
|
// LLL, 01 Oct 2013:
|
||||||
// NEW key assignment view for preferences
|
// NEW key assignment view for preferences
|
||||||
#define EXPERIMENTAL_KEY_VIEW
|
#define EXPERIMENTAL_KEY_VIEW
|
||||||
|
@ -124,6 +124,13 @@ void Internat::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Internat::SetCeeNumberFormat()
|
||||||
|
{
|
||||||
|
wxSetlocale( LC_NUMERIC, "C" );
|
||||||
|
mDecimalSeparator = '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
wxChar Internat::GetDecimalSeparator()
|
wxChar Internat::GetDecimalSeparator()
|
||||||
{
|
{
|
||||||
return mDecimalSeparator;
|
return mDecimalSeparator;
|
||||||
|
@ -116,6 +116,7 @@ public:
|
|||||||
* Normally, this is a decimal point ('.'), but e.g. Germany uses a
|
* Normally, this is a decimal point ('.'), but e.g. Germany uses a
|
||||||
* comma (',').*/
|
* comma (',').*/
|
||||||
static wxChar GetDecimalSeparator();
|
static wxChar GetDecimalSeparator();
|
||||||
|
static void SetCeeNumberFormat();
|
||||||
|
|
||||||
/** \brief Convert a string to a number.
|
/** \brief Convert a string to a number.
|
||||||
*
|
*
|
||||||
|
@ -209,6 +209,11 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
S.TieCheckBox(XXO("Use mostly Left-to-Right layouts in RTL languages"),
|
S.TieCheckBox(XXO("Use mostly Left-to-Right layouts in RTL languages"),
|
||||||
{"/GUI/RtlWorkaround",
|
{"/GUI/RtlWorkaround",
|
||||||
true});
|
true});
|
||||||
|
#endif
|
||||||
|
#ifdef EXPERIMENTAL_CEE_NUMBERS_OPTION
|
||||||
|
S.TieCheckBox(XXO("Never use comma as decimal point"),
|
||||||
|
{wxT("/Locale/CeeNumberFormat"),
|
||||||
|
false});
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
S.EndStatic();
|
S.EndStatic();
|
||||||
@ -317,6 +322,13 @@ wxString GUIPrefs::SetLang( const wxString & lang )
|
|||||||
|
|
||||||
Internat::Init();
|
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
|
// Unused strings that we want to be translated, even though
|
||||||
// we're not using them yet...
|
// we're not using them yet...
|
||||||
using future1 = decltype( XO("Master Gain Control") );
|
using future1 = decltype( XO("Master Gain Control") );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user