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

Fixed grammatically incorrect message while accessing pages without permission #10735

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

pranav-027
Copy link
Member

@pranav-027 pranav-027 commented Jan 29, 2025

Fixes: #10409

image

@@ -2879,3 +2879,5 @@ en:
missing_scrambles_for_multi_error: "[%{round_id}] While you may have multiple groups in 3x3x3 Multi-Blind, at least one of the groups must contain scrambles for all attempts."
multiple_fmc_groups_warning: "[%{round_id}] There are multiple groups of FMC used. If one group of FMC was used, please use the Scrambles Matcher to uncheck the unused scrambles. Otherwise, please include a comment to WRT explaining why multiple groups of FMC were used."
wrong_number_of_scramble_sets_error: "[%{round_id}] This round has a different number of scramble sets than specified on the Manage Events tab. Please adjust the number of scramble sets in the Manage Events tab to the number of sets that were used."
application:
Copy link
Member

Choose a reason for hiding this comment

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

You already have the common and homepage keys. There is also errors.messages. Feel free to use either of those, no need to introduce a new "application" key.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@pranav-027 pranav-027 requested a review from gregorbg January 31, 2025 09:28
@@ -94,7 +94,12 @@ def doorkeeper_unauthorized_render_options(error: nil)
def redirect_to_root_unless_user(action, *)
redirecting = !current_user&.send(action, *)
if redirecting
flash[:danger] = "You are not allowed to #{action.to_s.sub(/^can_/, '').chomp('?').humanize.downcase}"
flash[:danger] = case action
Copy link
Member

Choose a reason for hiding this comment

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

If the case statement only has one actual case (disregarding the else as a fallback) then why not use if?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops. I have changed it to if now

@gregorbg gregorbg merged commit 64d379f into thewca:main Feb 3, 2025
2 checks passed
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.

Grammatically incorrect error message
2 participants