Skip to content

Conversation

younies
Copy link
Member

@younies younies commented Aug 17, 2025

Summary

This PR implements an end-to-end “categorized units” formatter that slices units data into Core, Extended, and Outlier tiers, and wires that slicing through data loading, markers, and formatter construction. It also introduces unit preferences plumbing.

FOLLOW-UP ISSUE #6900

What’s included

  • New preferences module in cldr_serde/units to handle unit preference data.
  • Test data: unitPreferenceData.json added to exercise preference-aware paths.
  • Data files: New/updated JSON for multiple length, mass, and volume units across languages; removal of some obsolete files to streamline the dataset.
  • Categorized display names: New modules and updates to support Core/Extended/Outlier display-name data.
  • SourceDataProvider: Extended to surface unit preference data and categorized unit blobs in tests.
  • Formatter refactor: CategorizedFormatter now supports separate data markers for Core, Extended, and Outlier; added constructors to opt into Extended and Outlier.
  • Traits: MeasureUnitCategory extended to define additional data markers per category.
  • Tests: Updated/added to validate construction and formatting across locales

- Introduced `preferences` module in `cldr_serde/units` for handling unit preferences.
- Added `unitPreferenceData.json` file to the test data, containing structured unit preference information.
- Updated relevant modules to include the new `preferences` module and its functionality.
- Enhanced `SourceDataProvider` to include unit preference data in the test setup.
Copy link

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

- Introduced various new JSON files for unit lengths (e.g., centimeter, foot, mile) across multiple languages.
- Added new modules for categorized display names and updated existing modules to include these new data structures.
- Enhanced the `SourceDataProvider` to support the new unit length data and ensure proper integration with existing functionality.
@younies younies changed the title Add unit preference data support Implement Categorized DisplayName units Based on Unit preferences Aug 18, 2025
younies added 11 commits August 18, 2025 16:27
- Introduced new JSON files for various units of length and mass (e.g., long-meter, short-kilogram) across multiple languages.
- Removed outdated JSON files for certain units (e.g., long-foot, narrow-pound) to streamline the dataset.
- Updated related modules to ensure compatibility with the new data structures and maintain functionality.
- Introduced new JSON files for volume units (e.g., core, extended, outlier) across multiple languages.
- Updated the `categorized_display_name` module to include new volume unit display names.
- Enhanced the `SourceDataProvider` to support the new volume unit data and ensure proper integration with existing functionality.
…unit markers

- Updated the `CategorizedFormatter` to utilize separate data markers for core, extended, and outlier units.
- Introduced new methods for creating formatters with extended and outlier data.
- Enhanced the `MeasureUnitCategory` trait to define additional data markers for each unit category.
- Updated tests to validate the new formatter functionality across different locales and unit types.
@younies younies changed the title Implement Categorized DisplayName units Based on Unit preferences End to End Categorized Units Formatter Based on (Core, Extended, Outlier) Aug 20, 2025
@younies younies changed the title End to End Categorized Units Formatter Based on (Core, Extended, Outlier) End to End Categorized Units Formatter with sliced data into (Core, Extended, Outlier) Aug 26, 2025
@younies younies changed the title End to End Categorized Units Formatter with sliced data into (Core, Extended, Outlier) End-to-End Categorized Units Formatter with sliced data (Core / Extended / Outlier) Aug 26, 2025
@younies younies marked this pull request as ready for review August 26, 2025 14:54
@younies younies requested review from Manishearth, sffc, robertbastian and a team as code owners August 26, 2025 14:54
@younies younies closed this Aug 26, 2025
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.

1 participant