[gnome-calculator] Add additional temperature unit shortcuts (bgo#775300)
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Add additional temperature unit shortcuts (bgo#775300)
- Date: Tue, 29 Nov 2016 11:39:00 +0000 (UTC)
commit 7d0d5c92be180c99fefc6b87fe2b7dbbe200c86a
Author: Robert Roth <robert roth off gmail com>
Date: Tue Nov 29 13:38:40 2016 +0200
Add additional temperature unit shortcuts (bgo#775300)
lib/unit.vala | 8 ++++----
tests/test-equation.vala | 5 +++--
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/lib/unit.vala b/lib/unit.vala
index 7b6f5b6..c475269 100644
--- a/lib/unit.vala
+++ b/lib/unit.vala
@@ -79,10 +79,10 @@ public class UnitManager : Object
duration_category.add_unit (new Unit ("second", _("Seconds"), dpgettext2 (null, "unit-format", "%s
s"), "x", "x", dpgettext2 (null, "unit-symbols", "second,seconds,s")));
duration_category.add_unit (new Unit ("millisecond", _("Milliseconds"), dpgettext2 (null,
"unit-format", "%s ms"), "0.001x", "1000x", dpgettext2 (null, "unit-symbols",
"millisecond,milliseconds,ms")));
duration_category.add_unit (new Unit ("microsecond", _("Microseconds"), dpgettext2 (null,
"unit-format", "%s μs"), "0.000001x", "1000000x", dpgettext2 (null, "unit-symbols",
"microsecond,microseconds,us,μs")));
- temperature_category.add_unit (new Unit ("degree-celcius", _("Celsius"), dpgettext2 (null,
"unit-format", "%s ˚C"), "x+273.15", "x-273.15", dpgettext2 (null, "unit-symbols", "degC,˚C")));
- temperature_category.add_unit (new Unit ("degree-farenheit", _("Fahrenheit"), dpgettext2 (null,
"unit-format", "%s ˚F"), "(x+459.67)*5/9", "x*9/5-459.67", dpgettext2 (null, "unit-symbols", "degF,˚F")));
- temperature_category.add_unit (new Unit ("degree-kelvin", _("Kelvin"), dpgettext2 (null,
"unit-format", "%s K"), "x", "x", dpgettext2 (null, "unit-symbols", "K")));
- temperature_category.add_unit (new Unit ("degree-rankine", _("Rankine"), dpgettext2 (null,
"unit-format", "%s ˚R"), "x*5/9", "x*9/5", dpgettext2 (null, "unit-symbols", "degR,˚R,˚Ra")));
+ temperature_category.add_unit (new Unit ("degree-celcius", _("Celsius"), dpgettext2 (null,
"unit-format", "%s ˚C"), "x+273.15", "x-273.15", dpgettext2 (null, "unit-symbols",
"degC,˚C,C,c,Celsius,celsius")));
+ temperature_category.add_unit (new Unit ("degree-farenheit", _("Fahrenheit"), dpgettext2 (null,
"unit-format", "%s ˚F"), "(x+459.67)*5/9", "x*9/5-459.67", dpgettext2 (null, "unit-symbols",
"degF,˚F,F,f,Fahrenheit,fahrenheit")));
+ temperature_category.add_unit (new Unit ("degree-kelvin", _("Kelvin"), dpgettext2 (null,
"unit-format", "%s K"), "x", "x", dpgettext2 (null, "unit-symbols", "k,K,Kelvin,kelvin")));
+ temperature_category.add_unit (new Unit ("degree-rankine", _("Rankine"), dpgettext2 (null,
"unit-format", "%s ˚R"), "x*5/9", "x*9/5", dpgettext2 (null, "unit-symbols",
"degR,˚R,˚Ra,r,R,Rankine,rankine")));
/* We use IEC prefix for digital storage units. i.e. 1 kB = 1 KiloByte = 1000 bytes, and 1 KiB = 1
kibiByte = 1024 bytes */
digitalstorage_category.add_unit (new Unit ("bit", _("Bits"), dpgettext2 (null, "unit-format", "%s
b"), "x/8", "8x", dpgettext2 (null, "unit-symbols", "bit,bits,b")));
digitalstorage_category.add_unit (new Unit ("byte", _("Bytes"), dpgettext2 (null, "unit-format", "%s
B"), "x", "x", dpgettext2 (null, "unit-symbols", "byte,bytes,B")));
diff --git a/tests/test-equation.vala b/tests/test-equation.vala
index d7e48ab..10e2a46 100644
--- a/tests/test-equation.vala
+++ b/tests/test-equation.vala
@@ -152,11 +152,12 @@ private void test_conversions ()
/* Temperature */
//test ("100˚C in ˚F", "", 0);
- //test ("0˚C in ˚F", "32", 0);
- //test ("0˚K in ˚C", "−273.15", 0);
+ //test ("0 ˚C in ˚F", "32", 0);
+ //test ("0 ˚K in ˚C", "−273.15", 0);
test ("100degC in degF", "212", 0);
test ("0degC in degF", "32", 0);
test ("0 K in degC", "−273.15", 0);
+ test ("0 k in c", "−273.15", 0);
/* Digital Storage */
test ("1000 bits in bytes", "125", 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]