Skip to content

Luxembourgish, Dzongkha: use :year, :month and :day in date.order - #1187

Open
ChandraChaan wants to merge 1 commit into
svenfuchs:masterfrom
ChandraChaan:fix/date-order-pr
Open

ChandraChaan wants to merge 1 commit into
svenfuchs:masterfrom
ChandraChaan:fix/date-order-pr

Conversation

@ChandraChaan

Copy link
Copy Markdown

In lb.yml and dz.yml, date.order holds translated words instead of the keys Rails expects:

# lb.yml
order:
- :Joer
- :Mount
- :Dag

Rails' translated_date_order (actionview/lib/action_view/helpers/date_helper.rb) raises "<locale>.date.order only accepts :year, :month and :day" for anything else, so date_select and datetime_select fail for these two locales.

This replaces the values with :year, :month, :day in the order the existing translations had them (year, month, day, as in en.yml). I did not change the order itself; if Luxembourgish should be day, month, year, that is a separate decision. I also added a line to the Unreleased section of CHANGELOG.md.

I added a spec in spec/other/locale_files_spec.rb that checks date.order, when present, is a permutation of year, month and day in every rails/locale/*.yml.

I couldn't run Ruby locally, so I ran the suite on a fork:

  • Spec only, without the fix: CI fails on every Ruby from 3.2 to head with expected ["dz.yml", "lb.yml"].empty? to return true, got false at locale_files_spec.rb:22.
  • Spec with the fix: CI passes on all six jobs (2272 examples, 0 failures, 1 pending; the pending example is the existing "Fix missing pluralizations" one).

The commit in this PR is the squashed form of the fix branch (identical tree).

@ChandraChaan

Copy link
Copy Markdown
Author

Thanks for the approval, @sunny! The CI workflow on this PR is still waiting for a maintainer to approve the run. Could you approve it, and merge if it passes? Thanks!

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