tauri-apps / wry

Cross-platform WebView library in Rust for Tauri.
Apache License 2.0
3.32k stars 243 forks source link

Is there a way to overwrite navigator.language? #1231

Open skwee357 opened 1 month ago

skwee357 commented 1 month ago

Hey there! Thanks a lot for the amazing work on Tauri.

In desktop applications, it is common to let users choose the application locale regardless of their OS settings. I like my OS to be set to en-US, but when working with applications for data entry (read: dates, monetary values, etc), I prefer to set en-NL if possible.

In webview, navigator.language is responsible for the behavior of some of Intl object methods as well as how <input type="date"/> is rendered.

I would like to know if it's possible to overwrite the navigator.language during application startup.

Thanks a lot!