From ca3f1cab9d1b3c4f6934c92ed4a99ffabd13c128 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 24 Jul 2024 09:08:39 +0200 Subject: [PATCH] Upgrade ICU4X to different branch --- .../lib/src/bindings/Bcp47ToIanaMapper.g.dart | 1 + .../lib/src/bindings/CalendarError.g.dart | 1 - .../src/bindings/CollatorResolvedOptions.g.dart | 1 - pkgs/intl4x/lib/src/bindings/DataError.g.dart | 1 - .../src/bindings/FixedDecimalLimitError.g.dart | 1 - .../src/bindings/FixedDecimalParseError.g.dart | 1 - .../FixedDecimalRoundingIncrement.g.dart | 1 - .../bindings/FixedDecimalRoundingMode.g.dart | 1 - .../lib/src/bindings/IanaToBcp47Mapper.g.dart | 1 + .../lib/src/bindings/LocaleParseError.g.dart | 1 - .../src/bindings/ResolvedCollatorOptions.g.dart | 1 + .../lib/src/bindings/RoundingIncrement.g.dart | 1 + .../src/bindings/TimeZoneInvalidIdError.g.dart | 1 - .../bindings/TimeZoneInvalidOffsetError.g.dart | 1 - .../src/datetime_format/datetime_format_4x.dart | 2 +- pkgs/intl4x/lib/src/locale/locale_4x.dart | 4 ++-- .../lib/src/number_format/number_format_4x.dart | 17 ++++++----------- submodules/icu4x | 2 +- 18 files changed, 14 insertions(+), 25 deletions(-) create mode 120000 pkgs/intl4x/lib/src/bindings/Bcp47ToIanaMapper.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/CalendarError.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/CollatorResolvedOptions.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/DataError.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/FixedDecimalLimitError.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/FixedDecimalParseError.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/FixedDecimalRoundingIncrement.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/FixedDecimalRoundingMode.g.dart create mode 120000 pkgs/intl4x/lib/src/bindings/IanaToBcp47Mapper.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/LocaleParseError.g.dart create mode 120000 pkgs/intl4x/lib/src/bindings/ResolvedCollatorOptions.g.dart create mode 120000 pkgs/intl4x/lib/src/bindings/RoundingIncrement.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/TimeZoneInvalidIdError.g.dart delete mode 120000 pkgs/intl4x/lib/src/bindings/TimeZoneInvalidOffsetError.g.dart diff --git a/pkgs/intl4x/lib/src/bindings/Bcp47ToIanaMapper.g.dart b/pkgs/intl4x/lib/src/bindings/Bcp47ToIanaMapper.g.dart new file mode 120000 index 00000000..5c63dc36 --- /dev/null +++ b/pkgs/intl4x/lib/src/bindings/Bcp47ToIanaMapper.g.dart @@ -0,0 +1 @@ +../../../../../submodules/icu4x/ffi/capi/bindings/dart/Bcp47ToIanaMapper.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/CalendarError.g.dart b/pkgs/intl4x/lib/src/bindings/CalendarError.g.dart deleted file mode 120000 index ebc65fa3..00000000 --- a/pkgs/intl4x/lib/src/bindings/CalendarError.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/CalendarError.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/CollatorResolvedOptions.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorResolvedOptions.g.dart deleted file mode 120000 index 5cb11aa8..00000000 --- a/pkgs/intl4x/lib/src/bindings/CollatorResolvedOptions.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/CollatorResolvedOptions.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/DataError.g.dart b/pkgs/intl4x/lib/src/bindings/DataError.g.dart deleted file mode 120000 index 49d6e44f..00000000 --- a/pkgs/intl4x/lib/src/bindings/DataError.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/DataError.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimalLimitError.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimalLimitError.g.dart deleted file mode 120000 index 907ae320..00000000 --- a/pkgs/intl4x/lib/src/bindings/FixedDecimalLimitError.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/FixedDecimalLimitError.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimalParseError.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimalParseError.g.dart deleted file mode 120000 index f33e521f..00000000 --- a/pkgs/intl4x/lib/src/bindings/FixedDecimalParseError.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/FixedDecimalParseError.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimalRoundingIncrement.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimalRoundingIncrement.g.dart deleted file mode 120000 index a5f1ee12..00000000 --- a/pkgs/intl4x/lib/src/bindings/FixedDecimalRoundingIncrement.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/FixedDecimalRoundingIncrement.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimalRoundingMode.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimalRoundingMode.g.dart deleted file mode 120000 index 4542407c..00000000 --- a/pkgs/intl4x/lib/src/bindings/FixedDecimalRoundingMode.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/FixedDecimalRoundingMode.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/IanaToBcp47Mapper.g.dart b/pkgs/intl4x/lib/src/bindings/IanaToBcp47Mapper.g.dart new file mode 120000 index 00000000..f1d318f7 --- /dev/null +++ b/pkgs/intl4x/lib/src/bindings/IanaToBcp47Mapper.g.dart @@ -0,0 +1 @@ +../../../../../submodules/icu4x/ffi/capi/bindings/dart/IanaToBcp47Mapper.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/LocaleParseError.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleParseError.g.dart deleted file mode 120000 index e9f5ea74..00000000 --- a/pkgs/intl4x/lib/src/bindings/LocaleParseError.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/LocaleParseError.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/ResolvedCollatorOptions.g.dart b/pkgs/intl4x/lib/src/bindings/ResolvedCollatorOptions.g.dart new file mode 120000 index 00000000..214e3f44 --- /dev/null +++ b/pkgs/intl4x/lib/src/bindings/ResolvedCollatorOptions.g.dart @@ -0,0 +1 @@ +../../../../../submodules/icu4x/ffi/capi/bindings/dart/ResolvedCollatorOptions.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/RoundingIncrement.g.dart b/pkgs/intl4x/lib/src/bindings/RoundingIncrement.g.dart new file mode 120000 index 00000000..eefaf89d --- /dev/null +++ b/pkgs/intl4x/lib/src/bindings/RoundingIncrement.g.dart @@ -0,0 +1 @@ +../../../../../submodules/icu4x/ffi/capi/bindings/dart/RoundingIncrement.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidIdError.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidIdError.g.dart deleted file mode 120000 index f94a8581..00000000 --- a/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidIdError.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/TimeZoneInvalidIdError.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidOffsetError.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidOffsetError.g.dart deleted file mode 120000 index a19615ff..00000000 --- a/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidOffsetError.g.dart +++ /dev/null @@ -1 +0,0 @@ -../../../../../submodules/icu4x/ffi/capi/bindings/dart/TimeZoneInvalidOffsetError.g.dart \ No newline at end of file diff --git a/pkgs/intl4x/lib/src/datetime_format/datetime_format_4x.dart b/pkgs/intl4x/lib/src/datetime_format/datetime_format_4x.dart index f0ffd88b..a42b7fce 100644 --- a/pkgs/intl4x/lib/src/datetime_format/datetime_format_4x.dart +++ b/pkgs/intl4x/lib/src/datetime_format/datetime_format_4x.dart @@ -100,7 +100,7 @@ class DateTimeFormat4X extends DateTimeFormatImpl { icu.Calendar.forKind(_data, calendarKind), ); if (_zonedDateTimeFormatter != null) { - final ianaToBcp47Mapper = icu.TimeZoneIdMapper(_data); + final ianaToBcp47Mapper = icu.IanaToBcp47Mapper(_data); final timeZone = icu.CustomTimeZone.empty() ..trySetIanaTimeZoneId(ianaToBcp47Mapper, options.timeZone!); return _zonedDateTimeFormatter.formatDatetimeWithCustomTimeZone( diff --git a/pkgs/intl4x/lib/src/locale/locale_4x.dart b/pkgs/intl4x/lib/src/locale/locale_4x.dart index 6df01c3c..f496b2a2 100644 --- a/pkgs/intl4x/lib/src/locale/locale_4x.dart +++ b/pkgs/intl4x/lib/src/locale/locale_4x.dart @@ -9,8 +9,8 @@ import 'locale.dart'; extension Locale4X on Locale { icu.Locale to4X() { final icu4xLocale = icu.Locale.und()..language = language; - if (region != null) icu4xLocale.setRegion(region!); - if (script != null) icu4xLocale.setScript(script!); + if (region != null) icu4xLocale.region = region!; + if (script != null) icu4xLocale.script = script!; return icu4xLocale; } } diff --git a/pkgs/intl4x/lib/src/number_format/number_format_4x.dart b/pkgs/intl4x/lib/src/number_format/number_format_4x.dart index a9dcea47..b9c4a1a0 100644 --- a/pkgs/intl4x/lib/src/number_format/number_format_4x.dart +++ b/pkgs/intl4x/lib/src/number_format/number_format_4x.dart @@ -36,7 +36,7 @@ class NumberFormat4X extends NumberFormatImpl { final icu.FixedDecimal fixedDecimal; fixedDecimal = switch (number) { final int i => icu.FixedDecimal.fromInt(i), - final double d => icu.FixedDecimal.fromDoubleWithFloatingPrecision(d), + final double d => icu.FixedDecimal.fromDoubleWithDoublePrecision(d), final String s => icu.FixedDecimal.fromString(s), Object() => icu.FixedDecimal.fromString(number.toString()), }; @@ -103,16 +103,11 @@ class NumberFormat4X extends NumberFormatImpl { RoundingMode.floor => fixedDecimal.floor, RoundingMode.expand => fixedDecimal.expand, RoundingMode.trunc => fixedDecimal.trunc, - RoundingMode.halfCeil => (int position) => fixedDecimal.roundWithMode( - position, icu.FixedDecimalRoundingMode.halfCeil), - RoundingMode.halfFloor => (int position) => fixedDecimal.roundWithMode( - position, icu.FixedDecimalRoundingMode.halfFloor), - RoundingMode.halfExpand => (int position) => fixedDecimal.roundWithMode( - position, icu.FixedDecimalRoundingMode.halfExpand), - RoundingMode.halfTrunc => (int position) => fixedDecimal.roundWithMode( - position, icu.FixedDecimalRoundingMode.halfTrunc), - RoundingMode.halfEven => (int position) => fixedDecimal.roundWithMode( - position, icu.FixedDecimalRoundingMode.halfEven), + RoundingMode.halfCeil => fixedDecimal.halfCeil, + RoundingMode.halfFloor => fixedDecimal.halfFloor, + RoundingMode.halfExpand => fixedDecimal.halfExpand, + RoundingMode.halfTrunc => fixedDecimal.halfTrunc, + RoundingMode.halfEven => fixedDecimal.halfEven, }; roundingFunction(maxSignificantPosition); } diff --git a/submodules/icu4x b/submodules/icu4x index 1544cbe0..fb38fc8d 160000 --- a/submodules/icu4x +++ b/submodules/icu4x @@ -1 +1 @@ -Subproject commit 1544cbe0b47843c5d14675c7a972834dfde46f66 +Subproject commit fb38fc8d01a5c181de6eca523dedf28bc74fd1e9