Skip to content
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

ForegroundScale is being parsed with the culture of the machine. #96

Closed
7 of 10 tasks
ADD-David-Antolin opened this issue Mar 22, 2023 · 5 comments · Fixed by #101
Closed
7 of 10 tasks

ForegroundScale is being parsed with the culture of the machine. #96

ADD-David-Antolin opened this issue Mar 22, 2023 · 5 comments · Fixed by #101
Assignees
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@ADD-David-Antolin
Copy link

Current behavior

The value is parsed with the culture of the regional configuration of the machine.

Expected behavior

The value is parsed with invariant culture. So "0.65" is 65%.

How to reproduce it (as minimally and precisely as possible)

Assuming your regional configuration is English - United States (or another in which the symbol of the decimal separator is the dot).

  1. Create a new project with the Uno Visual Studio Extension.

  2. In base.props check UnoIcon item has ForegroundScale="0.65".

  3. Launch Windows head, the icon should be seen properly in the taskbar.

4, Change machine regional configuration to Spanish - Spain.

  1. Sign out & sign back in for changes to apply machine wide.

  2. Open the solution and rebuild the windows head.

  3. Launch Windows head, the icon in the taskbar is a blank background.

  4. In base.props change ForegroundScale value to 0,65 (with a comma).

  5. Rebuild the windows head.

  6. Launch Windows head, the icon should be seen properly in the taskbar.

Environment

Nuget Package:

Package Version(s): 1.0.2

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renders for Xamarin.Forms
  • Windows
  • Build tasks

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • 2022 (version: 17.5.2)
  • for Mac (version: )

Anything else we need to know?

I think the problem is located here. It should use the overload with IFormatProvider and pass CultureInfo.InvariantCulture.

@ADD-David-Antolin ADD-David-Antolin added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Mar 22, 2023
@pictos
Copy link
Contributor

pictos commented Mar 22, 2023

Not sure if it's a bug... Like on C# even if your language is other than English you can't specify
double x = 0.65 as double x = 0,65, right? That should propagate to MSBuild tasks as well.

@nickrandolph or @jeromelaban thoughts?

@jeromelaban
Copy link
Member

@ADD-David-Antolin thanks for the report. Could you provide a binlog of your build?

@ADD-David-Antolin
Copy link
Author

ADD-David-Antolin commented Mar 22, 2023

Not sure if it's a bug... Like on C# even if your language is other than English you can't specify double x = 0.65 as double x = 0,65, right? That should propagate to MSBuild tasks as well.

@nickrandolph or @jeromelaban thoughts?

It does not make any sense that two programmers, one in the States and one in Spain have to be continually modifying the value just because the have different regional formats in their machines. It is bad for maintainability.

I know UnoIcon is based in MauiIcon. They have done the same fix I propose in: dotnet/maui#11965

@ADD-David-Antolin
Copy link
Author

@ADD-David-Antolin thanks for the report. Could you provide a binlog of your build?

@Suriman will upload it.

@jeromelaban
Copy link
Member

jeromelaban commented Mar 22, 2023

Indeed, if the issue is fixed upstream let's replicate the same fix for sure. Thanks for the lookup @ADD-David-Antolin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants