MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
437 stars 51 forks source link

[Problem/Bug]: Webview2 Print dialog is not in the OS language, but always stuck in English. #4326

Open applefanbois opened 7 months ago

applefanbois commented 7 months ago

What happened?

People with French Windows 10 & Windows 11 when they print from the Webview2, the language displayed in the print dialog is always in English instead of French (the Windows OS Language).

I read everywhere that Webview2 does not respect local settings of the OS.

The problem appear when you either print with right click print or the javascript window.print()

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

1.4.231115000

Framework

WinUI3/WinAppSDK

Operating System

Windows 11

OS Version

10 and 11

Repro steps

right click print javascript window.print()

Repros in Edge Browser

No

Regression

No, this never worked

Last working version (if regression)

No response

applefanbois commented 7 months ago

//c# webView.Language = "fr-CA"; //before set, the value is "en-CA"

//In the inspector and console of the WebView2, type this javascript navigator.language

will print out "en-CA"

So it is proven now that WebView2 do not care for the Regional Settings, even changing them does nothing.

applefanbois commented 6 months ago

I just found out that my users are complaining that their context menu (when they do a right lick in the webview2) that the language is always English on a French/Canadian Windows 11.

monica-ch commented 4 months ago

@applefanbois Does the print dialog language matches with the Edge browser print dialog?

For context menu issue, looks like a bug in WebView2. Please open another issue with repro steps for us to look into it.

applefanbois commented 4 months ago

It visually match the one from the chromium-Edge browser but not the language.

applefanbois commented 3 months ago

Found a way to make it work, but once chosen, it cannot be changed again unless you start over the app.

String cultureName = System.Globalization.CultureInfo.CurrentCulture.Name; // "en-US" or "fr-CA" String sParam = "--lang=" + cultureName; // "--lang=fr-CA" or "--lang=en-CA"
Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", sParam); webView2.EnsureCoreWebView2Async()

It is a total disgrace that Microsoft have not fixed the problem 4 years later. The webview2 should use the OS language settings by default for the context menu and print dialog and it is not.

Windows had a 64% of desktop market share in USA last month. Now, a month later with their new Win 11 update that key log everything you do and record your screen (while Win 11 still has no screen recorder for the user), it has lower to 62% and will get much lower.

Steve Balmer loved developers and Windows was the best platform for developers, now that Balmer is gone, Microsoft clearly hate developers and don't listen to them ultimately giving a terrible experience for its users. Remember that our app is also on iOS, macOS, chromeOS and Android. When customer complains, I tell them to get the better version on the other platform because MS has abandoned Windows.