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

Implement Extended Currency DataModel #4706

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

younies
Copy link
Member

@younies younies commented Mar 19, 2024

No description provided.

@younies younies requested a review from a team as a code owner March 19, 2024 10:57
@younies younies marked this pull request as draft March 19, 2024 10:59
Comment on lines 41 to 45
/// A mapping from each currency's ISO code to its associated formatting patterns.
// Using CurrencyPatternConfig until implementing AsULE for ExtendedCurrencyPatternConfig.
// use short for long right now.
#[cfg_attr(feature = "serde", serde(borrow))]
pub patterns_config: ZeroMap<'data, Count, CurrencyPatternConfig>,
Copy link
Member

@sffc sffc Mar 27, 2024

Choose a reason for hiding this comment

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

Suggestion: I think in general the best way to store things that vary by plural form is to pull out the other variant and store all the others in the map. Something more like

/// For plural form 'other'
pub pattern_config_other: CurrencyPatternConfig,
/// For all other plural forms and explicit forms
pub pattern_config_plurals: ZeroMap<'data, Count, CurrencyPatternConfig>,

This is good because

  1. The fallback to other is infallible
  2. In locales that don't use plurals (like CJK), the ZeroMap becomes empty, which is nice

Copy link
Member Author

Choose a reason for hiding this comment

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

great idea, we treated it as default pattern.

@younies younies changed the title Implement Extended Currency Data for Currency Formatter Implement Extended Currency Mar 28, 2024
@younies younies changed the title Implement Extended Currency Implement Extended Currency DataModel Mar 28, 2024
// }
// }

impl IterableDataProviderInternal<CurrencyExtendedDataV1Marker> for crate::DatagenProvider {
Copy link
Member Author

Choose a reason for hiding this comment

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

needs to generate the data locale with auxiliary key.

Copy link
Member Author

Choose a reason for hiding this comment

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

fn neo_time_skeleton_supported_locales(&self) -> Result<HashSet<DataLocale>, DataError> {

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.

None yet

2 participants