mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-22723 Integrate CLDR 46 release beta3, part 3, source files
This commit is contained in:
parent
17687bf58e
commit
de86b3269e
4 changed files with 178 additions and 73 deletions
icu4c/source/i18n
icu4j/main
common_tests/src/test/java/com/ibm/icu/dev/test/format
core/src/main/java/com/ibm/icu/util
|
@ -43,24 +43,24 @@ static const int32_t gOffsets[] = {
|
|||
17,
|
||||
27,
|
||||
31,
|
||||
332,
|
||||
343,
|
||||
360,
|
||||
364,
|
||||
373,
|
||||
376,
|
||||
380,
|
||||
388,
|
||||
410,
|
||||
414,
|
||||
429,
|
||||
430,
|
||||
436,
|
||||
447,
|
||||
452,
|
||||
456,
|
||||
458,
|
||||
492
|
||||
333,
|
||||
344,
|
||||
362,
|
||||
366,
|
||||
375,
|
||||
378,
|
||||
382,
|
||||
390,
|
||||
412,
|
||||
416,
|
||||
431,
|
||||
432,
|
||||
438,
|
||||
449,
|
||||
455,
|
||||
459,
|
||||
461,
|
||||
495
|
||||
};
|
||||
|
||||
static const int32_t kCurrencyOffset = 5;
|
||||
|
@ -423,6 +423,7 @@ static const char * const gSubTypes[] = {
|
|||
"ZRZ",
|
||||
"ZWC",
|
||||
"ZWD",
|
||||
"ZWG",
|
||||
"ZWL",
|
||||
"ZWN",
|
||||
"ZWR",
|
||||
|
@ -448,6 +449,7 @@ static const char * const gSubTypes[] = {
|
|||
"month",
|
||||
"month-person",
|
||||
"nanosecond",
|
||||
"night",
|
||||
"quarter",
|
||||
"second",
|
||||
"week",
|
||||
|
@ -544,6 +546,7 @@ static const char * const gSubTypes[] = {
|
|||
"beaufort",
|
||||
"kilometer-per-hour",
|
||||
"knot",
|
||||
"light-speed",
|
||||
"meter-per-second",
|
||||
"mile-per-hour",
|
||||
"celsius",
|
||||
|
@ -1016,54 +1019,62 @@ MeasureUnit MeasureUnit::getNanosecond() {
|
|||
return MeasureUnit(7, 10);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createQuarter(UErrorCode &status) {
|
||||
MeasureUnit *MeasureUnit::createNight(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 11, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getQuarter() {
|
||||
MeasureUnit MeasureUnit::getNight() {
|
||||
return MeasureUnit(7, 11);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) {
|
||||
MeasureUnit *MeasureUnit::createQuarter(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 12, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getSecond() {
|
||||
MeasureUnit MeasureUnit::getQuarter() {
|
||||
return MeasureUnit(7, 12);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) {
|
||||
MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 13, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getWeek() {
|
||||
MeasureUnit MeasureUnit::getSecond() {
|
||||
return MeasureUnit(7, 13);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createWeekPerson(UErrorCode &status) {
|
||||
MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 14, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getWeekPerson() {
|
||||
MeasureUnit MeasureUnit::getWeek() {
|
||||
return MeasureUnit(7, 14);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createYear(UErrorCode &status) {
|
||||
MeasureUnit *MeasureUnit::createWeekPerson(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 15, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getYear() {
|
||||
MeasureUnit MeasureUnit::getWeekPerson() {
|
||||
return MeasureUnit(7, 15);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createYearPerson(UErrorCode &status) {
|
||||
MeasureUnit *MeasureUnit::createYear(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 16, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getYearPerson() {
|
||||
MeasureUnit MeasureUnit::getYear() {
|
||||
return MeasureUnit(7, 16);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createYearPerson(UErrorCode &status) {
|
||||
return MeasureUnit::create(7, 17, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getYearPerson() {
|
||||
return MeasureUnit(7, 17);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createAmpere(UErrorCode &status) {
|
||||
return MeasureUnit::create(8, 0, status);
|
||||
}
|
||||
|
@ -1544,14 +1555,6 @@ MeasureUnit MeasureUnit::getKilogram() {
|
|||
return MeasureUnit(15, 5);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 14, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getMetricTon() {
|
||||
return MeasureUnit(15, 14);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMicrogram(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 6, status);
|
||||
}
|
||||
|
@ -1624,6 +1627,14 @@ MeasureUnit MeasureUnit::getTonne() {
|
|||
return MeasureUnit(15, 14);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) {
|
||||
return MeasureUnit::create(15, 14, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getMetricTon() {
|
||||
return MeasureUnit(15, 14);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createGigawatt(UErrorCode &status) {
|
||||
return MeasureUnit::create(17, 0, status);
|
||||
}
|
||||
|
@ -1784,22 +1795,30 @@ MeasureUnit MeasureUnit::getKnot() {
|
|||
return MeasureUnit(19, 2);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) {
|
||||
MeasureUnit *MeasureUnit::createLightSpeed(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 3, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getMeterPerSecond() {
|
||||
MeasureUnit MeasureUnit::getLightSpeed() {
|
||||
return MeasureUnit(19, 3);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) {
|
||||
MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 4, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getMilePerHour() {
|
||||
MeasureUnit MeasureUnit::getMeterPerSecond() {
|
||||
return MeasureUnit(19, 4);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) {
|
||||
return MeasureUnit::create(19, 5, status);
|
||||
}
|
||||
|
||||
MeasureUnit MeasureUnit::getMilePerHour() {
|
||||
return MeasureUnit(19, 5);
|
||||
}
|
||||
|
||||
MeasureUnit *MeasureUnit::createCelsius(UErrorCode &status) {
|
||||
return MeasureUnit::create(20, 0, status);
|
||||
}
|
||||
|
|
|
@ -1568,6 +1568,24 @@ class U_I18N_API MeasureUnit: public UObject {
|
|||
*/
|
||||
static MeasureUnit getNanosecond();
|
||||
|
||||
#ifndef U_HIDE_DRAFT_API
|
||||
/**
|
||||
* Returns by pointer, unit of duration: night.
|
||||
* Caller owns returned value and must free it.
|
||||
* Also see {@link #getNight()}.
|
||||
* @param status ICU error code.
|
||||
* @draft ICU 76
|
||||
*/
|
||||
static MeasureUnit *createNight(UErrorCode &status);
|
||||
|
||||
/**
|
||||
* Returns by value, unit of duration: night.
|
||||
* Also see {@link #createNight()}.
|
||||
* @draft ICU 76
|
||||
*/
|
||||
static MeasureUnit getNight();
|
||||
#endif /* U_HIDE_DRAFT_API */
|
||||
|
||||
/**
|
||||
* Returns by pointer, unit of duration: quarter.
|
||||
* Caller owns returned value and must free it.
|
||||
|
@ -2624,30 +2642,6 @@ class U_I18N_API MeasureUnit: public UObject {
|
|||
*/
|
||||
static MeasureUnit getKilogram();
|
||||
|
||||
/**
|
||||
* Returns by pointer, unit of mass: metric-ton
|
||||
* (renamed to tonne in CLDR 42 / ICU 72).
|
||||
* Caller owns returned value and must free it.
|
||||
* Note: In ICU 74 this will be deprecated in favor of
|
||||
* createTonne(), which is currently draft but will
|
||||
* become stable in ICU 74, and which uses the preferred naming.
|
||||
* Also see {@link #getMetricTon()} and {@link #createTonne()}.
|
||||
* @param status ICU error code.
|
||||
* @stable ICU 54
|
||||
*/
|
||||
static MeasureUnit *createMetricTon(UErrorCode &status);
|
||||
|
||||
/**
|
||||
* Returns by value, unit of mass: metric-ton
|
||||
* (renamed to tonne in CLDR 42 / ICU 72).
|
||||
* Note: In ICU 74 this will be deprecated in favor of
|
||||
* getTonne(), which is currently draft but will
|
||||
* become stable in ICU 74, and which uses the preferred naming.
|
||||
* Also see {@link #createMetricTon()} and {@link #getTonne()}.
|
||||
* @stable ICU 64
|
||||
*/
|
||||
static MeasureUnit getMetricTon();
|
||||
|
||||
/**
|
||||
* Returns by pointer, unit of mass: microgram.
|
||||
* Caller owns returned value and must free it.
|
||||
|
@ -2792,6 +2786,30 @@ class U_I18N_API MeasureUnit: public UObject {
|
|||
*/
|
||||
static MeasureUnit getTonne();
|
||||
|
||||
/**
|
||||
* Returns by pointer, unit of mass: metric-ton
|
||||
* (renamed to tonne in CLDR 42 / ICU 72).
|
||||
* Caller owns returned value and must free it.
|
||||
* Note: In ICU 74 this will be deprecated in favor of
|
||||
* createTonne(), which is currently draft but will
|
||||
* become stable in ICU 74, and which uses the preferred naming.
|
||||
* Also see {@link #getMetricTon()} and {@link #createTonne()}.
|
||||
* @param status ICU error code.
|
||||
* @stable ICU 54
|
||||
*/
|
||||
static MeasureUnit *createMetricTon(UErrorCode &status);
|
||||
|
||||
/**
|
||||
* Returns by value, unit of mass: metric-ton
|
||||
* (renamed to tonne in CLDR 42 / ICU 72).
|
||||
* Note: In ICU 74 this will be deprecated in favor of
|
||||
* getTonne(), which is currently draft but will
|
||||
* become stable in ICU 74, and which uses the preferred naming.
|
||||
* Also see {@link #createMetricTon()} and {@link #getTonne()}.
|
||||
* @stable ICU 64
|
||||
*/
|
||||
static MeasureUnit getMetricTon();
|
||||
|
||||
/**
|
||||
* Returns by pointer, unit of power: gigawatt.
|
||||
* Caller owns returned value and must free it.
|
||||
|
@ -3112,6 +3130,24 @@ class U_I18N_API MeasureUnit: public UObject {
|
|||
*/
|
||||
static MeasureUnit getKnot();
|
||||
|
||||
#ifndef U_HIDE_DRAFT_API
|
||||
/**
|
||||
* Returns by pointer, unit of speed: light-speed.
|
||||
* Caller owns returned value and must free it.
|
||||
* Also see {@link #getLightSpeed()}.
|
||||
* @param status ICU error code.
|
||||
* @draft ICU 76
|
||||
*/
|
||||
static MeasureUnit *createLightSpeed(UErrorCode &status);
|
||||
|
||||
/**
|
||||
* Returns by value, unit of speed: light-speed.
|
||||
* Also see {@link #createLightSpeed()}.
|
||||
* @draft ICU 76
|
||||
*/
|
||||
static MeasureUnit getLightSpeed();
|
||||
#endif /* U_HIDE_DRAFT_API */
|
||||
|
||||
/**
|
||||
* Returns by pointer, unit of speed: meter-per-second.
|
||||
* Caller owns returned value and must free it.
|
||||
|
|
|
@ -2901,7 +2901,6 @@ public class MeasureUnitTest extends CoreTestFmwk {
|
|||
MeasureUnit.PERMILLE,
|
||||
MeasureUnit.PART_PER_MILLION,
|
||||
MeasureUnit.PERMYRIAD,
|
||||
MeasureUnit.PORTION_PER_1E9,
|
||||
MeasureUnit.LITER_PER_100KILOMETERS,
|
||||
MeasureUnit.LITER_PER_KILOMETER,
|
||||
MeasureUnit.MILE_PER_GALLON,
|
||||
|
@ -4129,11 +4128,46 @@ public class MeasureUnitTest extends CoreTestFmwk {
|
|||
System.out.println("#endif /* U_HIDE_DRAFT_API */");
|
||||
}
|
||||
System.out.println("");
|
||||
// Hack: METRIC-TON unit changed its name from "metric-ton" to "tonne"
|
||||
// In order to preserve the existing APIs for "metric-ton" we need to
|
||||
// add those APIs manually
|
||||
if (name.equals("Tonne")) {
|
||||
addCXXHForMetricTon();
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("// End generated createXXX methods");
|
||||
}
|
||||
|
||||
// Add the headers for "metric-ton"
|
||||
// The tool won't create them any more
|
||||
private static void addCXXHForMetricTon() {
|
||||
System.out.println(" /**");
|
||||
System.out.println(" * Returns by pointer, unit of mass: metric-ton");
|
||||
System.out.println(" * (renamed to tonne in CLDR 42 / ICU 72).");
|
||||
System.out.println(" * Caller owns returned value and must free it.");
|
||||
System.out.println(" * Note: In ICU 74 this will be deprecated in favor of");
|
||||
System.out.println(" * createTonne(), which is currently draft but will");
|
||||
System.out.println(" * become stable in ICU 74, and which uses the preferred naming.");
|
||||
System.out.println(" * Also see {@link #getMetricTon()} and {@link #createTonne()}.");
|
||||
System.out.println(" * @param status ICU error code.");
|
||||
System.out.println(" * @stable ICU 54");
|
||||
System.out.println(" */");
|
||||
System.out.println(" static MeasureUnit *createMetricTon(UErrorCode &status);");
|
||||
System.out.println("");
|
||||
System.out.println(" /**");
|
||||
System.out.println(" * Returns by value, unit of mass: metric-ton");
|
||||
System.out.println(" * (renamed to tonne in CLDR 42 / ICU 72).");
|
||||
System.out.println(" * Note: In ICU 74 this will be deprecated in favor of");
|
||||
System.out.println(" * getTonne(), which is currently draft but will");
|
||||
System.out.println(" * become stable in ICU 74, and which uses the preferred naming.");
|
||||
System.out.println(" * Also see {@link #createMetricTon()} and {@link #getTonne()}.");
|
||||
System.out.println(" * @stable ICU 64");
|
||||
System.out.println(" */");
|
||||
System.out.println(" static MeasureUnit getMetricTon();");
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
private static void checkForDup(
|
||||
Map<String, MeasureUnit> seen, String name, MeasureUnit unit) {
|
||||
if (seen.containsKey(name)) {
|
||||
|
@ -4308,11 +4342,33 @@ public class MeasureUnitTest extends CoreTestFmwk {
|
|||
typeSubType.first, typeSubType.second);
|
||||
System.out.println("}");
|
||||
System.out.println();
|
||||
// Hack: METRIC-TON unit changed its name from "metric-ton" to "tonne"
|
||||
// In order to preserve the existing APIs for "metric-ton" we need to
|
||||
// add those APIs manually
|
||||
if (name.equals("Tonne")) {
|
||||
addCXXForMetricTon(typeSubType);
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("// End generated code for measunit.cpp");
|
||||
}
|
||||
|
||||
// Add the API skeletons for "metric-ton"
|
||||
// The tool won't create them any more
|
||||
private static void addCXXForMetricTon(Pair<Integer, Integer> typeSubType) {
|
||||
String name = "MetricTon";
|
||||
System.out.printf("MeasureUnit *MeasureUnit::create%s(UErrorCode &status) {\n", name);
|
||||
System.out.printf(" return MeasureUnit::create(%d, %d, status);\n",
|
||||
typeSubType.first, typeSubType.second);
|
||||
System.out.println("}");
|
||||
System.out.println();
|
||||
System.out.printf("MeasureUnit MeasureUnit::get%s() {\n", name);
|
||||
System.out.printf(" return MeasureUnit(%d, %d);\n",
|
||||
typeSubType.first, typeSubType.second);
|
||||
System.out.println("}");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
private static String toCamelCase(MeasureUnit unit) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
boolean caps = true;
|
||||
|
|
|
@ -1081,12 +1081,6 @@ public class MeasureUnit implements Serializable {
|
|||
*/
|
||||
public static final MeasureUnit PERMYRIAD = MeasureUnit.internalGetInstance("concentr", "permyriad");
|
||||
|
||||
/**
|
||||
* Constant for unit of concentr: portion-per-1e9
|
||||
* @draft ICU 76
|
||||
*/
|
||||
public static final MeasureUnit PORTION_PER_1E9 = MeasureUnit.internalGetInstance("concentr", "portion-per-1e9");
|
||||
|
||||
/**
|
||||
* Constant for unit of consumption: liter-per-100-kilometer
|
||||
* @stable ICU 56
|
||||
|
|
Loading…
Add table
Reference in a new issue