Skip to content

Output parent locales once#91

Merged
Korri merged 4 commits intoruby-i18n:masterfrom
movermeyer:mo.output_parent_locales_once
Nov 26, 2021
Merged

Output parent locales once#91
Korri merged 4 commits intoruby-i18n:masterfrom
movermeyer:mo.output_parent_locales_once

Conversation

@movermeyer
Copy link
Copy Markdown
Collaborator

@movermeyer movermeyer commented Nov 23, 2021

What are you trying to accomplish?

Fixes #90

What approach did you choose and why?

  • Sorted the list of shared components
  • Added the ParentLocales to the list of shared locales
  • Brought back ParentLocales in Cldr::Export::Data#components (effectively reverting Fix parent locales #40)

When ParentLocales was added, it was added as a locale-based component, but didn't have the same signature of locale-based components (since of course it is a shared component), so it caused an error. This was fixed in IMO the wrong way in #40, by excluding the component from being exported unless explicitly requested.

This brings back the component, and now that it is properly marked as a shared component, it no longer has that error.

What should reviewers focus on?

🤷

The impact of these changes

  • ParentLocales is once again exported by default (users of ruby-cldr no longer have to run thor cldr:export and thor cldr:export --components=parentLocales, but instead just the former)
  • parent_locales.yml is output in data/ and not under each locale directory.
  • Less files, less bytes:
Before (with explicit --components=parentLocales) After Ratio
# of .yml files 6476 5723 0.88
Total bytes 30753892 (29.3 MiB) 28984221 (27.6 MiB) 0.94

Testing

thor cldr:export

See that data/parent_locales.yml exists and contains the same data.

@movermeyer movermeyer force-pushed the mo.output_parent_locales_once branch from 117c7a6 to c7b54c2 Compare November 23, 2021 14:47
@movermeyer movermeyer marked this pull request as ready for review November 23, 2021 14:47
Copy link
Copy Markdown
Collaborator

@trishrempel trishrempel left a comment

Choose a reason for hiding this comment

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

👍🏻

Copy link
Copy Markdown
Collaborator

@cejaekl cejaekl left a comment

Choose a reason for hiding this comment

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

FWIW, this looks good to me.

@Korri Korri merged commit fd76b66 into ruby-i18n:master Nov 26, 2021
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.

Only output a single copy of parent_locales.yml

4 participants