Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making IterableResourceProvider return Locales instead of ResourceOptions #2175

Closed

Conversation

robertbastian
Copy link
Member

Implementors usually have Locales and should just be able to return those without depending on the representation inside DataRequest. This allows us to make ResourceOptions private (see discussion in #1995).

@robertbastian robertbastian requested review from sffc, Manishearth and a team as code owners July 13, 2022 10:49
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Two high-level issues


/// A [`DynProvider`] that can iterate over all supported [`ResourceOptions`] for a certain key.
/// A [`DynProvider`] that can iterate over all supported [`Locale`]s for a certain key.
Copy link
Member

Choose a reason for hiding this comment

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

Issue: I am not aligned on the motivation for this change (trying to remove ResourceOptions from public APIs).

key: ResourceKey,
) -> Result<Vec<ResourceOptions>, DataError>;
/// Given a [`ResourceKey`], returns a list of [`Locale`]s.
fn supported_locales_for_key(&self, key: ResourceKey) -> Result<Vec<Locale>, DataError>;
Copy link
Member

Choose a reason for hiding this comment

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

Issue: We may want to use the name supported_locales_for_key for the actual supported-locales logic proposed in #58 (comment) in the post-1.x timeframe. I would like this trait to remain datagen-specific for the time being.

The other issue here is that I think we may want to retire this mechanism in the data exporter entirely, and instead use a declarative list of locales combined with locale fallback. At least when reading CLDR data, we only need to load the list of CLDR locales one time, and then use the same list for all of the data keys. See #834 for further discussion.

@Manishearth Manishearth removed their request for review July 13, 2022 16:39
@robertbastian robertbastian deleted the supported_locales branch July 18, 2022 17:07
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.

2 participants