Skip to content

Commit

Permalink
Fixes #37490 - Correct translation logic in registration cmd
Browse files Browse the repository at this point in the history
It's invalid to use %s more than once in a translatable string because
it becomes ambigous. Different languages may want to change the order
of words and that's not possible with %s. They should be named.
  • Loading branch information
ekohl authored and Griffin-Sullivan committed Jun 4, 2024
1 parent b035981 commit dfbe14b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def registration_url(proxy = nil)
end

def invalid_expiration_error
raise ::Foreman::Exception.new(N_("Invalid value '%s' for jwt_expiration. The value must be between %s and %s. 0 means 'unlimited'."), registration_params['jwt_expiration'], MIN_VALUE, MAX_VALUE)
raise ::Foreman::Exception.new(N_("Invalid value '%{value}' for jwt_expiration. The value must be between %{minimum} and %{maximum}. 0 means 'unlimited'."), { value: registration_params['jwt_expiration'], minimum: MIN_VALUE, maximum: MAX_VALUE })
end

def jwt_expiration_param
Expand Down

0 comments on commit dfbe14b

Please sign in to comment.