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

Improve failure message for unused allowed untranslated keys test #10574

Conversation

mitchellhenke
Copy link
Contributor

@mitchellhenke mitchellhenke commented May 8, 2024

🛠 Summary of changes

This PR makes a small proposed change to the error message around unused allowed untranslated keys from #10508 to give clearer instructions on the source of the failure and how to resolve it.

Old message:

     Failure/Error:
       expect(unused_allowed_untranslated_keys).to(
         be_empty,
         "unused allowed untranslated i18n keys: #{unused_allowed_untranslated_keys}",
       )

       unused allowed untranslated i18n keys: [{:key=>"titles.piv_cac_setup.upsell", :locales=>[:fr]}, {:key=>"titles.piv_cac_setup.upsell", :locales=>[:es]}]

Proposed message:

     Failure/Error:
           expect(unused_allowed_untranslated_keys).to(
             be_empty,
             <<~EOS,
               ALLOWED_UNTRANSLATED_KEYS contains unused allowed untranslated i18n keys.
               The following keys can be removed from ALLOWED_UNTRANSLATED_KEYS:
               #{unused_allowed_untranslated_keys.pretty_inspect}
             EOS
           )

       ALLOWED_UNTRANSLATED_KEYS contains unused allowed untranslated i18n keys.
       The following keys can be removed from ALLOWED_UNTRANSLATED_KEYS:
       [{:key=>"titles.piv_cac_setup.upsell", :locales=>[:fr]},
        {:key=>"titles.piv_cac_setup.upsell", :locales=>[:es]}]

changelog: Internal, Tests, Improve test message for unused allowed untranslated keys
@mitchellhenke mitchellhenke requested review from KeithNava and a team May 8, 2024 19:09
mitchellhenke and others added 2 commits May 8, 2024 14:21
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/more-helpful-i18n-unused-exception-error-message branch from 1d42fe8 to cf1c5c9 Compare May 8, 2024 19:31
Copy link
Contributor

@KeithNava KeithNava left a comment

Choose a reason for hiding this comment

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

🔥

@mitchellhenke mitchellhenke merged commit 050cca7 into main May 8, 2024
2 checks passed
@mitchellhenke mitchellhenke deleted the mitchellhenke/more-helpful-i18n-unused-exception-error-message branch May 8, 2024 20:11
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.

3 participants