1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-25 08:58:06 +02:00

Force use of "period" as decimal and nothing as thousands separator

Since we don't actually change the locale when we change languages,
we can't use whatever is defined in the locale for the decimal and
thousands separator.

This is because standard library functions are used to format and
parse numbers and since these library functions use whatever is
set for the current locale, we can use comma for the fraction
separator or the period for the thousands separator.
This commit is contained in:
Leland Lucius 2015-05-16 00:21:12 -05:00
parent 73d2681759
commit f76746b399

View File

@ -120,7 +120,7 @@ private:
wxChar NumberFormatter::GetDecimalSeparator()
{
#if wxUSE_INTL
#if defined(WE_DO_NOT_CHANGE_THE_LOCALE_SO_PERIOD_IS_ALWAYS_THE_SEPERATOR) //wxUSE_INTL
// Notice that while using static variable here is not MT-safe, the worst
// that can happen is that we redo the initialization if we're called
// concurrently from more than one thread so it's not a real problem.
@ -158,7 +158,7 @@ wxChar NumberFormatter::GetDecimalSeparator()
bool NumberFormatter::GetThousandsSeparatorIfUsed(wxChar *sep)
{
#if wxUSE_INTL
#if defined(WE_DO_NOT_CHANGE_THE_LOCALE_SO_NO_SEPERATOR) //wxUSE_INTL
static wxChar s_thousandsSeparator = 0;
static LocaleId s_localeUsedForInit;