Skip to content

Fix some numeric settings not working correct in some languages when attempting to set negative value#37667

Merged
peppy merged 2 commits intoppy:masterfrom
bdach:localisation-is-fun
May 8, 2026
Merged

Fix some numeric settings not working correct in some languages when attempting to set negative value#37667
peppy merged 2 commits intoppy:masterfrom
bdach:localisation-is-fun

Conversation

@bdach
Copy link
Copy Markdown
Collaborator

@bdach bdach commented May 7, 2026

Closes #37553.

You can probably tell by the title that this is going to be a good one.

As previously mentioned in #35395, framework-side TextBox uses a bunch of NumberFormat properties from CurrentCulture to contextually allow decimal points or minus signs in a textbox.

In some languages, namely (of the ones we support): Finnish, Croatian, Lithuanian, Norsk, Slovenian, and Swedish, NumberFormat.NegativeSign is not U+002D HYPHEN MINUS, but instead U+2212 MINUS SIGN. Therefore, in FormSliderBar, when ToStandardFormattedString() is attempted to be used to set the textbox value, the hardcoded U+002D HYPHEN MINUS is rejected on cultures that expect U+2212 MINUS SIGN, and thus due to a feedback loop, all negative values are no longer settable.

This applies the obvious fix of applying NumberFormat.NegativeSign.

bdach added 2 commits May 7, 2026 14:19
…attempting to set negative value

Closes ppy#37553.

You can probably tell by the title that this is going to be a good one.

As previously mentioned in ppy#35395,
framework-side `TextBox` uses a bunch of `NumberFormat` properties from
`CurrentCulture` to contextually allow decimal points or minus signs in
a textbox.

In some languages, namely (of the ones we support): Finnish, Croatian,
Lithuanian, Norsk, Slovenian, and Swedish, `NumberFormat.NegativeSign`
is not U+002D HYPHEN MINUS, but instead U+2212 MINUS SIGN. Therefore, in
`FormSliderBar`, when `ToStandardFormattedString()` is attempted to be
used to set the textbox value, the hardcoded U+002D HYPHEN MINUS is
rejected on cultures that expect U+2212 MINUS SIGN, and thus due to a
feedback loop, all negative values are no longer settable.

This applies the obvious fix of applying `NumberFormat.NegativeSign`.
@bdach bdach self-assigned this May 7, 2026
@bdach bdach added area:settings area:localisation Deals with localisation and regional display issues. quick fix Tasks which were taken on because they take no time to fix labels May 7, 2026
@bdach bdach moved this from Inbox to Pending Review in osu! team task tracker May 7, 2026
@peppy peppy self-requested a review May 8, 2026 06:45
@peppy peppy merged commit 7f5f368 into ppy:master May 8, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Review to Done in osu! team task tracker May 8, 2026
@bdach bdach deleted the localisation-is-fun branch May 8, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:localisation Deals with localisation and regional display issues. area:settings quick fix Tasks which were taken on because they take no time to fix size/S

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Cannot choose negative global offset

2 participants