]> granicus.if.org Git - icu/commitdiff
Add unitQuantities rules and output to units.txt
authorHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Thu, 12 Mar 2020 20:24:05 +0000 (21:24 +0100)
committerHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Thu, 12 Mar 2020 20:24:05 +0000 (21:24 +0100)
icu4c/source/data/misc/units.txt
tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/LdmlConverter.java
tools/cldr/cldr-to-icu/src/main/resources/ldml2icu_supplemental.txt

index 288f9df8b3d6fa307224c69a6f6b556446550ca1..ce9843b5a0ae0a6edb937f8051075d6d80a83535 100644 (file)
@@ -1834,4 +1834,51 @@ units:table(nofallback){
             }
         }
     }
+    unitQuantities{
+        ampere{"electric-current"}
+        ampere-per-meter{"magnetic-field-strength"}
+        ampere-per-square-meter{"current-density"}
+        bit{"digital"}
+        candela{"luminous-intensity"}
+        candela-per-square-meter{"luminance"}
+        candela-square-meter-per-square-meter{"luminous-flux"}
+        cubic-meter{"volume"}
+        cubic-meter-per-kilogram{"specific-volume"}
+        cubic-meter-per-meter{"consumption"}
+        cubic-second-square-ampere-per-kilogram-square-meter{"electric-conductance"}
+        em{"typewidth"}
+        item{"substance-amount"}
+        item-per-cubic-meter{"concentration"}
+        kelvin{"temperature"}
+        kilogram{"mass"}
+        kilogram-meter-per-meter-square-second{"torque"}
+        kilogram-meter-per-square-second{"force"}
+        kilogram-per-cubic-meter{"mass-density"}
+        kilogram-per-kilogram{"mass-fraction"}
+        kilogram-per-meter-square-second{"pressure"}
+        kilogram-per-square-meter-square-second{"pressure-per-length"}
+        kilogram-per-square-second-ampere{"magnetic-induction"}
+        kilogram-square-meter-per-cubic-second{"power"}
+        kilogram-square-meter-per-cubic-second-ampere{"voltage"}
+        kilogram-square-meter-per-cubic-second-square-ampere{"electric-resistance"}
+        kilogram-square-meter-per-square-second{"energy"}
+        kilogram-square-meter-per-square-second-ampere{"magnetic-flux"}
+        kilogram-square-meter-per-square-second-square-ampere{"electric-inductance"}
+        meter{"length"}
+        meter-per-second{"speed"}
+        meter-per-square-second{"acceleration"}
+        pixel{"graphics"}
+        pixel-per-meter{"resolution"}
+        portion{"portion"}
+        pow4-second-square-ampere-per-kilogram-square-meter{"electric-capacitance"}
+        revolution{"angle"}
+        revolution-per-meter{"wave-number"}
+        revolution-per-second{"frequency"}
+        second{"duration"}
+        second-ampere{"electric-charge"}
+        square-meter{"area"}
+        square-meter-per-square-second{"dose"}
+        square-revolution{"solid-angle"}
+        year{"year-duration"}
+    }
 }
index 8f7cbfd620283e972109c74cedd6b8336bcc6cd3..48d87ad176eff629ef4b8132f91d64a8e76fd977 100644 (file)
@@ -112,6 +112,7 @@ public final class LdmlConverter {
         supplementalMatcher(
             "convertUnits",
             "unitConstants",
+            "unitQuantities",
             "unitPreferenceData");
     private static final PathMatcher CURRENCY_DATA_PATHS =
         supplementalMatcher("currencyData");
index 59dd89f5179de05eb1760e4bb2be2db165850961..35809f1a35b2d3987cb5c3210edcf7fe5b4146b2 100644 (file)
 //supplementalData/unitConstants/unitConstant[@constant="(%W)"][@value="(%A)"][@status="(%W)"]
     ; /unitConstants/$1 ; values="$2"
 
+//supplementalData/unitQuantities/unitQuantity[@baseUnit="(%W)"][@quantity="(%W)"]
+    ; /unitQuantities/$1 ; values="$2"
+
+//supplementalData/unitQuantities/unitQuantity[@baseUnit="(%W)"][@quantity="(%W)"][@status="(%W)"]
+    ; /unitQuantities/$1 ; values="$2"
+
 //supplementalData/convertUnits/convertUnit[@source="(%W)"][@baseUnit="(%W)"][@factor="(%A)"]
     ; /convertUnits/$1/target ; values=$2
     ; /convertUnits/$1/factor ; values="$3"