Move width over to relativetime marker attributes by Manishearth · Pull Request #8572 · unicode-org/icu4x · GitHub
Skip to content

Move width over to relativetime marker attributes - #8572

Open
Manishearth wants to merge 3 commits into
unicode-org:mainfrom
Manishearth:relativetime-marker-attributes
Open

Manishearth wants to merge 3 commits into
unicode-org:mainfrom
Manishearth:relativetime-marker-attributes

Conversation

@Manishearth

Copy link
Copy Markdown
Member

Part of #802

I'm not sure of this, @sffc @robertbastian thoughts?

I think units being markers makes a lot of sense. Widths could be markers but I'm not convinced they need to be. Apparently there's a lot of overlap between widths, which means that having them be attributes reduces overall data size.

Changelog: N/A

We should make one big relativetime changelog entry

@Manishearth
Manishearth requested review from a team, pdogr, robertbastian and sffc as code owners October 8, 2026 00:38
@Manishearth Manishearth added the discuss-priority Discuss at the next ICU4X meeting label Oct 8, 2026
@Manishearth

Copy link
Copy Markdown
Member Author

@Manishearth
Manishearth force-pushed the relativetime-marker-attributes branch from 626f859 to 5c77bec Compare October 8, 2026 21:18

@robertbastian robertbastian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's significant deduplication, we should use marker attributes. This is also the reason we're using attributes for width in list formatter. It looks like this is the case here:

datetime/relative/day/v1, af/L, 197B, 105B, 2a58f0784bcc7728
datetime/relative/day/v1, af/N, -> af/L
datetime/relative/day/v1, af/S, -> af/L

icu_provider::data_marker!(
/// `DatetimeRelativeSecondLongV1`
DatetimeRelativeSecondLongV1,
/// `DatetimeRelativeSecondV1`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: document the marker attributes architecture on each marker

@sffc

sffc commented Oct 9, 2026

Copy link
Copy Markdown
Member

we should deal with widths how DisplayNames deals with widths. Short -> Medium, Long -> Medium, and Medium has everything, and Short and Long are both sparse.

@Manishearth

Copy link
Copy Markdown
Member Author

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discuss-priority Discuss at the next ICU4X meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants