microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
108.37k stars 6.4k forks source link

PowerToys Run - Unit converter - Can´t use abbreviations #21472

Open DaniDerBaer opened 1 year ago

DaniDerBaer commented 1 year ago

Microsoft PowerToys version

0.63.0

Installation method

GitHub, PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

When I type something like "10kph in mph" the unit converter plugin doesn´t recognise it. It also doesn´t change anything if I use the direct activation command. 2022-10-26_17h50_36

Instead I need to type "10 kilometerperhour in mileperhour" to get a result. 2022-10-26_17h50_56

This isn´t the case for all units e.g. "10ft in m" works fine. 2022-10-26_17h51_55

✔️ Expected Behavior

Recognise an input if abbreviations are used and convert it correctly.

❌ Actual Behavior

Only recognises an input if no abbreviations are used.

Other Software

No response

crutkas commented 1 year ago

It can, like you can do 10m to in and will work, looks like this conversion needs some TLC overrides

Tantalus13A98B5F commented 1 year ago

You can try 10 km/h in mph, as the abbreviations are defined at https://github.com/angularsen/UnitsNet/blob/7519a2152b9389e6cf93aefe8a77fc9d80963149/UnitsNet/GeneratedCode/Quantities/Speed.g.cs#L469-L528

GhostVaibhav commented 2 months ago

Hi @jaimecbernardo and @ethanfangg, what does this issue need? Should we close it? Should I open a PR with the extra abbreviations for kph and mph? How should we proceed further?

jaimecbernardo commented 1 month ago

Hi @jaimecbernardo and @ethanfangg, what does this issue need? Should we close it? Should I open a PR with the extra abbreviations for kph and mph? How should we proceed further?

Hi @GhostVaibhav , I assume this hasn't been tested in a while. If it's still not working, I guess a PR that fixes it would be welcome. Thank you!

GhostVaibhav commented 1 month ago

@jaimecbernardo, I have tested it yesterday. It works with kp/h but not with kph. Also, if we decide to move forward with this, can you add the External Dependency label, since it's an issue at the UnitsNet end.

jaimecbernardo commented 1 month ago

@GhostVaibhav , there is something that we can do on our side as well, we are converting some units before sending them to UnitsNet: https://github.com/microsoft/PowerToys/blob/3b7adbe6acc381d11d8e17866da4b79444679c08/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/InputInterpreter.cs

GhostVaibhav commented 1 month ago

@jaimecbernardo Oh, my bad. It went under my radar. Maybe, I can fix it then. Could you assign it to me?

jaimecbernardo commented 1 month ago

Just did. Thanks a lot for picking this up 😄

Jay-o-Way commented 1 month ago

A few quick thoughts

GhostVaibhav commented 1 month ago

Hi @Jay-o-Way A few quick answers -