Flow.Launcher
Flow.Launcher copied to clipboard
BUG: Calculator does not use system locale for decimal separator
Checks
- [X] I have checked that this issue has not already been reported.
Problem Description
For the calculator I use the setting for "Decimal Separator" to be "Use system locale". In my Windows settings this is set to ",". However, the calculator uses "." as decimal separator. Only when explicitly setting to "Comma (,)" it uses a ",". Normally I could work around it. But it gets really annoying when trying to copy the result to Excel, which then thinks it got provided with a date rather than a number.
To Reproduce
- Check that Calculator plugin settings are set to "Use system locale"
- In Windows settings the decimal separator should be set to ","
- Try to do calculations in flow launcher with decimal numbers. Only numbers entered with "." are recognized and results are presented with "." rather than ",".
Screenshots
No response
Flow Launcher Version
1.13.0
Windows Build Number
10.0.19045.2486
Error Log
No response
Hi
I have tested this feature and can confirm that it is working correctly. Please restart the FL using Restart Flow Launcher
command after you set the comma(,) as the Decimal symbol in Windows settings.
That is weird. My setting in Windows has always been set to comma. It was working until a recent update of Flow Launcher. And then it stopped working. So I restarted flow launcher quite often already (system restarts as well as restarts for plugin installation)
I did a new test:
- set Windows settings to
dot (.)
- restart flow launcher --> still accepting dot as decimal separator
- set Windows settings back to
comma (,)
- restart flow launcher --> still only accepting dot as decimal separator
- double checking that in the calculator settings
system locale
is chosen
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Hi, I would like to check how the status of this issue is? Is there anything I could test to help solve it? Best regards,
Please update to the latest version and check if this issue remains after restarting Flow. I cannot reproduce this issue.
I checked the updates and I am at the newest version. And the issue still remains. It is actually the same on two machines of mine. So I am really wondering, what the difference between my setup and yours is.
I will try something else, once I have more time again: I will look into the code myself. Could you point me to the section of code, which reads the system locale setting and which sets the symbol used within flow launcher depending on the setting chosen (in the plugin settings as well as the system settings)? Thank you very much.
Check the folder Plugins and inside it you can see a folder called flow.plugin.calculator and Main.cs inside that.
Plugins/Flow.Launcher.Plugin.Calculator/Main.cs
BTW have you tried resetting the settings of calculator plugin by deleting its settings.json?
Plugins/Flow.Launcher.Plugin.Calculator/Main.cs
BTW have you tried resetting the settings of calculator plugin by deleting its settings.json?
I deleted the calculator settings.json and also the calculator section in the global settings.json. Each separately with a restart of flow launcher. No change.
I noticed though that the plugins directory is named caculator
instead of calculator
, but this most probably just a typo and not related to the issue.
Check the folder Plugins and inside it you can see a folder called flow.plugin.calculator and Main.cs inside that.
Hmmm....C#. This will require a bit more time to set this up.
I think I figured it out. Luckily without having to compile the plugin or even the whole flow launcher. Just a little bit more than a c#-helloworld and reading about DefaultThreadCurrentCulture (https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.defaultthreadcurrentculture?view=net-7.0) brought me on the right track.
Here you set the DefaultThreadCurrentCulture depending on the language setting of flow.launcher, which happens for me to be English. Thus here it is not using my normal German setting with ,
, but the English setting with .
.
I verified this. When changing my flow launcher language in the settings to German and setting in the Calculator plugin to use system locale
(or its German version then), the calculator actually uses the ,
.
So the question is, whether the DefaultThreadCurrentCulture has certain advantages, when it is set to the language specified in flow launcher. Probably to ensure everything in English in all queries. But the system local settings should probably be checked against my standard system cutlure setting. Well at least that's what I would expect from the setting use system locale
.
I noticed though that the plugins directory is named caculator instead of calculator, but this most probably just a typo and not related to the issue.
yeah likely a typo and not related....maybe we shall fix it
So the question is, whether the DefaultThreadCurrentCulture has certain advantages, when it is set to the language specified in flow launcher. Probably to ensure everything in English in all queries. But the system local settings should probably be checked against my standard system cutlure setting. Well at least that's what I would expect from the setting use system locale.
@VictoriousRaptor I notice the change is from your pr. Any particular reason for that?
Although I think majorly this is a decision problem. We want plugins to align the language set by flow rather than the system language (there seems to be one api for getting the system culture), which has been discussed before when porting the windows setting plugin. @onesounds what do you think?
@taooceros I'll ask the question again to make sure I understand it correctly. So the "use system locale" setting in the calculator follows the language setting in flow, not windows?
If my understanding is correct,
- I had always assumed this settings followed those of the Windows system. Based on the name of the menu, this is how it should work, and from a UX perspective, this is the most normal behavior.
- If it's a simple task, Let's change it to behave like 1.
- If it's tricky to implement, I think we could remove that setting or just rename it to something like "Use Flow's language locale setting"... But for things like the decimal separator, it's a pain to set, and I think it's common practice to follow the system setting for this value.
and by default, Flow's plugins language should follow the settings in Flow itself, not the Windows system (except for things like calculators and window settings). This is because the system language may not be the user's primary language.
Has raptor changed anything recently? I don't see any issues on my end,
So the "use system locale" setting in the calculator follows the language setting in flow, not windows?
Seems like so
If it's tricky to implement, I think we could remove that setting or just rename it to something like "Use Flow's language locale setting"... But for things like the decimal separator, it's a pain to set, and I think it's common practice to follow the system setting for this value.
I agree, but I think it is not so hard? This seems to be the correct api to use. https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.installeduiculture?view=net-7.0
Has raptor changed anything recently? I don't see any issues on my end,
No I think the behavior after and before his change is identical
I noticed though that the plugins directory is named caculator instead of calculator, but this most probably just a typo and not related to the issue.
yeah likely a typo and not related....maybe we shall fix it
So the question is, whether the DefaultThreadCurrentCulture has certain advantages, when it is set to the language specified in flow launcher. Probably to ensure everything in English in all queries. But the system local settings should probably be checked against my standard system cutlure setting. Well at least that's what I would expect from the setting use system locale.
@VictoriousRaptor I notice the change is from your pr. Any particular reason for that?
It was to set flow's culture info to user specified language.
No I think the behavior after and before his change is identical
I am not 100% sure about this. At some point the behavior changed, but I cannot exactly recall when. I never had issues with this topic until some point.
Anyway, I lik the thinking of @onesounds. I would expect the calculator to use my windows settings, so it works correctly out of the box, without the necessity to fiddle with some settings.
Furthermore, I do not like the choice to use the language setting of FlowLauncher to select a locale/culture. This comma/dot-issue is one story. But associated with this is also currency, if it was used by some plugin. You only have the ability to select English as language, which does not separate for american english with USD or australian english with AUD or guys like myself, which choose English for other reasons (maybe FlowLauncher is not translated to their language) with some complete different setup.
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.
What is going to happen to this issue? Thinking about it again it seems that the calculator issue is only a symptom of something bigger. Would the choice regarding the locale get an own issue?
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stale for 7 days with no activity. If you feel this issue still needs attention please feel free to reopen.
Thank you very much, @jjw24 @VictoriousRaptor . Now it's waiting time for the official update :-)