New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TweakMode replaces dots with commas #2799

Closed
SableRaf opened this Issue Aug 16, 2014 · 7 comments

Comments

Projects
None yet
4 participants
@SableRaf

SableRaf commented Aug 16, 2014

After using tweak mode, a line like

float f = 0.5;

becomes

float f = 0,5;

I'm using OSX 10.9.2 in French so this might be a problem with internationalization. However, I changed the number separator in the preferences to "." then restarted Processing and the issue was still there.

note: A friend reported the same issue in Windows 7 in German. Another using Ubuntu in English didn't have the issue.

@aengelke

This comment has been minimized.

Show comment
Hide comment
@aengelke

aengelke Aug 16, 2014

Contributor

A possible source of the issue: pdex/src/galsasson/mode/tweak/Handle.java:156

/cc @galsasson

Contributor

aengelke commented Aug 16, 2014

A possible source of the issue: pdex/src/galsasson/mode/tweak/Handle.java:156

/cc @galsasson

@galsasson

This comment has been minimized.

Show comment
Hide comment
@galsasson

galsasson Aug 20, 2014

Contributor

Hi @SableRaf, I tried to reproduce the issue by setting my mac localization to French, but everything is fine on my end.
There was a bug in an earlier version of TweakMode that caused this issue but was fixed since.
Just to make sure. Are you using TweakMode as a separate mode (the old way), or did you download and compile the current head of Processing?
@aengelke, this is exactly the place that it was fixed in, always using Locale.US for string formatting. Do you see something else wrong with this code?

Thanks!

Contributor

galsasson commented Aug 20, 2014

Hi @SableRaf, I tried to reproduce the issue by setting my mac localization to French, but everything is fine on my end.
There was a bug in an earlier version of TweakMode that caused this issue but was fixed since.
Just to make sure. Are you using TweakMode as a separate mode (the old way), or did you download and compile the current head of Processing?
@aengelke, this is exactly the place that it was fixed in, always using Locale.US for string formatting. Do you see something else wrong with this code?

Thanks!

@SableRaf

This comment has been minimized.

Show comment
Hide comment
@SableRaf

SableRaf Aug 21, 2014

Hello galsasson,

I'm using 3.0a2, not the compiled head.

I suppose you're referring to the following commit (from November 2013), is that right? galsasson/TweakMode@97427d9

SableRaf commented Aug 21, 2014

Hello galsasson,

I'm using 3.0a2, not the compiled head.

I suppose you're referring to the following commit (from November 2013), is that right? galsasson/TweakMode@97427d9

@aengelke

This comment has been minimized.

Show comment
Hide comment
@aengelke

aengelke Aug 21, 2014

Contributor

@galsasson Actually, it doesn't happen to me. Another thing: == is used to compare strings.

Contributor

aengelke commented Aug 21, 2014

@galsasson Actually, it doesn't happen to me. Another thing: == is used to compare strings.

@galsasson

This comment has been minimized.

Show comment
Hide comment
@galsasson

galsasson Aug 21, 2014

Contributor

Yes @SableRaf this is the commit. One option is that you don't have this exact locale in your system so it defaults back to French. There might be other ways of forcing the number format so I'll check that.
Thanks for the feedback.

Thanks, @aengelke, I'll fix that.

Contributor

galsasson commented Aug 21, 2014

Yes @SableRaf this is the commit. One option is that you don't have this exact locale in your system so it defaults back to French. There might be other ways of forcing the number format so I'll check that.
Thanks for the feedback.

Thanks, @aengelke, I'll fix that.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Nov 19, 2014

Member

@galsasson any news here?

Member

benfry commented Nov 19, 2014

@galsasson any news here?

benfry added a commit that referenced this issue Apr 1, 2015

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Apr 1, 2015

Member

Replaced the string compares.

The Locale.US issue should have fixed this problem in the current source, because that Locale is always present: http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#getAvailableLocales()

Member

benfry commented Apr 1, 2015

Replaced the string compares.

The Locale.US issue should have fixed this problem in the current source, because that Locale is always present: http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#getAvailableLocales()

@benfry benfry closed this Apr 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment