mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-04 02:33:14 +01:00
Fix for bug 2136
Don't translate doubles in Scripting messages. For valid JSON we need to retain the dot as decimal separator.
This commit is contained in:
@@ -32,6 +32,9 @@ capture the more lengthy output from some commands.
|
|||||||
#include "../widgets/AudacityMessageBox.h"
|
#include "../widgets/AudacityMessageBox.h"
|
||||||
#include "../widgets/wxPanelWrapper.h"
|
#include "../widgets/wxPanelWrapper.h"
|
||||||
|
|
||||||
|
#include <locale>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
void CommandMessageTarget::StartArray()
|
void CommandMessageTarget::StartArray()
|
||||||
{
|
{
|
||||||
wxString Padding;
|
wxString Padding;
|
||||||
@@ -78,11 +81,18 @@ void CommandMessageTarget::AddBool(const bool value, const wxString &name){
|
|||||||
Update( wxString::Format( "%s\"%s\":\"%s\"", (mCounts.back()>0)?", ":"", name,value?"true":"false"));
|
Update( wxString::Format( "%s\"%s\":\"%s\"", (mCounts.back()>0)?", ":"", name,value?"true":"false"));
|
||||||
mCounts.back() += 1;
|
mCounts.back() += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandMessageTarget::AddItem(const double value, const wxString &name){
|
void CommandMessageTarget::AddItem(const double value, const wxString &name){
|
||||||
|
std::stringstream str;
|
||||||
|
std::locale nolocale("");
|
||||||
|
str.imbue(nolocale);
|
||||||
|
|
||||||
if( name.empty() )
|
if( name.empty() )
|
||||||
Update( wxString::Format( "%s%g", (mCounts.back()>0)?", ":"", value));
|
str << ((mCounts.back()>0)? ", " : "") << value;
|
||||||
else
|
else
|
||||||
Update( wxString::Format( "%s\"%s\":%g", (mCounts.back()>0)?", ":"", name,value));
|
str << ((mCounts.back()>0)? ", " : "") << "\"" << name << "\"" << ":" << value;
|
||||||
|
|
||||||
|
Update( str.str() );
|
||||||
mCounts.back() += 1;
|
mCounts.back() += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user