added kilowatthour to energy units (#1944)

* added kilowatthour to energy units

* fixed false change

* Update src/Calculator/Resources/en-US/Resources.resw

Co-authored-by: Adam Sasine <adam.sasine@gmail.com>

* fix: translations, description

* fix: empty line

---------

Co-authored-by: Adam Sasine <adam.sasine@gmail.com>
This commit is contained in:
Flippchen 2023-05-17 10:49:15 +02:00 committed by GitHub
parent 14f35d19f7
commit 264174669d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 1 deletions

View file

@ -164,7 +164,8 @@ namespace CalculatorApp
Data_Zetabits = UnitStart + 163,
Data_Zetabytes = UnitStart + 164,
Area_Pyeong = UnitStart + 165,
UnitEnd = Area_Pyeong
Energy_Kilowatthour = UnitStart + 166,
UnitEnd = Energy_Kilowatthour
};
}
}

View file

@ -358,6 +358,13 @@ void UnitConverterDataLoader::GetUnits(_In_ unordered_map<ViewMode, vector<Order
true,
false,
false });
energyUnits.push_back(OrderedUnit{ UnitConverterUnits::Energy_Kilowatthour,
GetLocalizedStringName(L"UnitName_Kilowatthour"),
GetLocalizedStringName(L"UnitAbbreviation_Kilowatthour"),
166,
true,
false,
false });
energyUnits.push_back(OrderedUnit{ UnitConverterUnits::Energy_Kilocalorie,
GetLocalizedStringName(L"UnitName_Kilocalorie"),
GetLocalizedStringName(L"UnitAbbreviation_Kilocalorie"),
@ -830,6 +837,7 @@ void UnitConverterDataLoader::GetConversionData(_In_ unordered_map<ViewMode, uno
{ ViewMode::Energy, UnitConverterUnits::Energy_Kilocalorie, 4184 },
{ ViewMode::Energy, UnitConverterUnits::Energy_BritishThermalUnit, 1055.056 },
{ ViewMode::Energy, UnitConverterUnits::Energy_Kilojoule, 1000 },
{ ViewMode::Energy, UnitConverterUnits::Energy_Kilowatthour, 3600000 },
{ ViewMode::Energy, UnitConverterUnits::Energy_ElectronVolt, 0.0000000000000000001602176565 },
{ ViewMode::Energy, UnitConverterUnits::Energy_Joule, 1 },
{ ViewMode::Energy, UnitConverterUnits::Energy_FootPound, 1.3558179483314 },

View file

@ -1772,6 +1772,10 @@
<data name="UnitAbbreviation_Joule" xml:space="preserve">
<value>J</value>
<comment>An abbreviation for a measurement unit of energy</comment>
</data>
<data name="UnitAbbreviation_Kilowatthour" xml:space="preserve">
<value>kWh</value>
<comment>An abbreviation for a measurement unit of electricity consumption</comment>
</data>
<data name="UnitAbbreviation_Kelvin" xml:space="preserve">
<value>K</value>
@ -2136,6 +2140,10 @@
<data name="UnitName_Joule" xml:space="preserve">
<value>Joules</value>
<comment>A measurement unit for energy. (Please choose the most appropriate plural form to fit any number between 0 and 999,999,999,999,999)</comment>
</data>
<data name="UnitName_Kilowatthour" xml:space="preserve">
<value>Kilowatt-hours</value>
<comment>A measurement unit for electricity consumption. (Please choose the most appropriate plural form to fit any number between 0 and 999,999,999,999,999)</comment>
</data>
<data name="UnitName_Kelvin" xml:space="preserve">
<value>Kelvin</value>

View file

@ -588,4 +588,7 @@
<data name="Nanometers-Microns-3" xml:space="preserve">
<value>0.003</value>
</data>
<data name="Joules-Kilowatthour" xml:space="preserve">
<value>3600000</value>
</data>
</root>