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

Fixes #36590 - fix ACS error message for duplicate words #10647

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

lfu
Copy link
Member

@lfu lfu commented Jul 13, 2023

What are the changes introduced in this pull request?

Considerations taken when implementing this change?

What are the testing steps for this pull request?

  1. Add new simplified ACS
  2. Have an active product that does not have a file repository and try to add it to a new ACS (i.e. RHEL)

@theforeman-bot
Copy link

Issues: #36590

@@ -7,7 +7,7 @@ def validate_each(record, attribute, value)
product = ::Katello::Product.find(value)
content_type = record.alternate_content_source.content_type
if product.repositories.with_type(content_type).has_url.empty?
record.errors[attribute] << N_("The product %{name} has no %{type} repositories with upstream URLs to add to the alternate content source.") % { name: product.name, type: content_type }
record.errors.add(attribute, N_("%{name} has no %{type} repositories with upstream URLs to add to the alternate content source.") % { name: product.name, type: content_type })
Copy link
Member Author

Choose a reason for hiding this comment

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

Do you think this should be N_ or _?

Copy link
Member

Choose a reason for hiding this comment

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

Not entirely sure, but documentation suggests N_ for dynamic translations..
https://github.com/grosser/gettext_i18n_rails#unfound-translations-with-rake-gettextfind

Copy link
Member Author

Choose a reason for hiding this comment

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

Just tested it out.

With N_
Screenshot at 2023-07-13 17-11-28

With _
Screenshot at 2023-07-13 17-14-12

@lfu lfu force-pushed the acs_errors_product_msg_36590 branch from 74aea7a to f92d07b Compare July 13, 2023 21:23
Copy link
Member

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

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

Ack. Can see updated error message:

Before change:
Screenshot from 2023-07-14 16-40-52

After change:
Screenshot from 2023-07-14 16-38-08

@lfu lfu merged commit 91a48ec into Katello:master Jul 17, 2023
5 checks passed
@lfu lfu deleted the acs_errors_product_msg_36590 branch November 16, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants