Skip to content

Introduce dedicated LanguageIdentifierDisplayNameOptions struct#8135

Merged
sffc merged 1 commit into
unicode-org:mainfrom
sffc:sffc/displaynames-options-bag
Jun 25, 2026
Merged

Introduce dedicated LanguageIdentifierDisplayNameOptions struct#8135
sffc merged 1 commit into
unicode-org:mainfrom
sffc:sffc/displaynames-options-bag

Conversation

@sffc

@sffc sffc commented Jun 25, 2026

Copy link
Copy Markdown
Member

This pull request is part of the implementation for the main locale display names tracking issue: #7825.

This pull request introduces a dedicated options bag LanguageIdentifierDisplayNameOptions specifically for the single formatter LanguageIdentifierDisplayNameOwned (and its borrowed version).

Previously, the single formatter reused the general DisplayNamesOptions bag, which contains options like style that are only supported by the multi-formatters (since single formatters are currently hardcoded to the Medium width data markers).

By introducing a dedicated options bag, we:

  1. Cleanly separate the options supported by the single formatter (currently only language_display / dialect resolution).
  2. Prevent confusion regarding unsupported options like style.
  3. Lay the foundation for adding fallback options specifically to the single formatter in a subsequent step.

All docstring examples, constructors, and integration tests have been updated to use the new options bag.

🤖 This pull request was created by an AI agent working with @sffc.

Changelog

icu_experimental: Introduce dedicated LanguageIdentifierDisplayNameOptions struct

  • New types: LanguageIdentifierDisplayNameOptions

…ions struct

- Add `LanguageIdentifierDisplayNameOptions` with only the `language_display` option to `options.rs`.
- Re-export it in `displaynames/mod.rs`.
- Refactor `LanguageIdentifierDisplayNameOwned` to use `LanguageIdentifierDisplayNameOptions` instead of `DisplayNamesOptions`.
- Update docstring examples and integration tests in `tests.rs` to use the new options struct.
- Update `single/README.md` design documentation and add an open question about moving dialect names to a separate data marker.

Co-authored-by: Gemini <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@sffc sffc force-pushed the sffc/displaynames-options-bag branch from 9305df1 to 4898099 Compare June 25, 2026 00:18
@sffc sffc marked this pull request as ready for review June 25, 2026 00:25
@sffc sffc requested review from a team and snktd as code owners June 25, 2026 00:25
@sffc sffc requested review from Manishearth and robertbastian and removed request for snktd June 25, 2026 00:25
@sffc sffc merged commit 1569b93 into unicode-org:main Jun 25, 2026
35 of 36 checks passed
@sffc sffc deleted the sffc/displaynames-options-bag branch June 25, 2026 06:02
@robertbastian

Copy link
Copy Markdown
Member

I pity the person who will have to consolidate all those AI-generated changelog entries. Is it necessary to list the fields of new types? And the methods it listed as new are not new.

@Manishearth

Copy link
Copy Markdown
Member

When we discussed the changelog rules we explicitly agreed to not include methods, fields, etc on new types, and that exception is in our policy.

I edited the changelog entry.

I did find that the PR body in #8132 had a much less "density of usefulness" than I typically get from sffc PRs. It still had everything I wanted so I didn't complain.

@sffc

sffc commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

The agent wrote both the PR description and the changelog entry. I could have slimmed down the PR description but figured it wasn't a good use of my time (perhaps for a similar reason as @robertbastian sometimes doesn't include enough detail in the PR description). I probably should have slimmed down the changelog entry.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants