mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PTRun][Unit]Support for plural units and improve alternative spellings (#19961)
* Upgrade UnitsNet package to a version that supports plural * Add support for plurals Fix metre conversion Add and update unit tests
This commit is contained in:
@@ -169,19 +169,12 @@ namespace Community.PowerToys.Run.Plugin.UnitConverter
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts spelling "metre" to "meter"
|
||||
/// Converts spelling "metre" to "meter", also for centimetre and other variants
|
||||
/// </summary>
|
||||
public static void MetreToMeter(ref string[] split)
|
||||
{
|
||||
if (split[1].ToLowerInvariant() == "metre")
|
||||
{
|
||||
split[1] = "meter";
|
||||
}
|
||||
|
||||
if (split[3].ToLowerInvariant() == "metre")
|
||||
{
|
||||
split[3] = "meter";
|
||||
}
|
||||
split[1] = split[1].Replace("metre", "meter", System.StringComparison.CurrentCultureIgnoreCase);
|
||||
split[3] = split[3].Replace("metre", "meter", System.StringComparison.CurrentCultureIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user