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

Chore: add test for locales - to find problematic keys #752

Merged
merged 7 commits into from
Dec 8, 2024

Conversation

benkoshy
Copy link
Collaborator

@benkoshy benkoshy commented Dec 4, 2024

Why this PR?

  • When users make submissions for locales, they often cut and paste from other locales, and incorrectly apply the rules.
  • It is currently quite cumbersome to manually check whether the rules have been currectly applied. I would prefer if there was a test to help aid in the discovery of discrepancies.

For example, I might declare that the Klingon language has the e.g. :east_slavic pluralization rule, but I might incorrectly label as per : other pluralization rule: e.g.

# :east_slavic pluralization (see https://github.com/ddnexus/pagy/blob/master/gem/lib/pagy/i18n.rb)
klingon:
  pagy:
    aria_label:
      nav: 
        wrong_key: "this key applies to another locale"
        wrong_key_2:  "this key applies to another locale"

# all of the above is a cut-and-paste from another locale
# it does not apply here

Right now you have to manually check. But these test will help capture such discrepancies, and tell you what should be applied instead.

ISSUES with the PR

  • ta.yml and swa.yml are excluded from the checks
  • it will not check if the .yml keys have been misapplied to the wrong label. in other words, manual checking is still required.

Why this PR?

* When users make submissions for locales, they often cut and paste
  from other locales, and incorrectly apply the rules.
* It is currently quite cumbersome to manually check whether the rules
  have been currectly applied. I would prefer if there was a
  test to help aid in the discovery of discrepancies.

For example, I might declare that the Klingon language has the
e.g. :east_slavic pluralization rule, but I might incorrectly
label the yml file to the : other pluralization rule.

These test will help capture such discrepancies.
@benkoshy benkoshy marked this pull request as draft December 4, 2024 10:19
@benkoshy benkoshy marked this pull request as ready for review December 4, 2024 10:29
@benkoshy benkoshy force-pushed the add-tests-to-check-locales-keys branch from 7b26eea to 628251e Compare December 4, 2024 22:06
@ddnexus ddnexus changed the base branch from master to dev December 8, 2024 11:12
@ddnexus ddnexus merged commit 5df4074 into dev Dec 8, 2024
8 checks passed
@benkoshy benkoshy deleted the add-tests-to-check-locales-keys branch December 8, 2024 21:09
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