Skip to content

Commit

Permalink
(PUP-7310) Fix interpolation in externalized strings in graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Magisus committed Apr 4, 2017
1 parent 451510b commit c938030
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/puppet/graph/simple_graph.rb
Expand Up @@ -61,7 +61,7 @@ def matching_edges(event, base = nil)
source = base || event.resource

unless vertex?(source)
Puppet.warning _("Got an event from invalid vertex #{source.ref}")
Puppet.warning _("Got an event from invalid vertex %{source}") % { source: source.ref }
return []
end
# Get all of the edges that this vertex should forward events
Expand Down Expand Up @@ -146,7 +146,7 @@ def tarjan(root, s)
frame[:step] = :children

else
fail _("#{frame[:step]} is an unknown step")
fail "#{frame[:step]} is an unknown step"
end
end
end
Expand Down Expand Up @@ -193,6 +193,7 @@ def find_cycles_in_graph
# through the graph first, which are more likely to be interesting to the
# user. I think; it would be interesting to verify that. --daniel 2011-01-23
def paths_in_cycle(cycle, max_paths = 1)
#TRANSLATORS "negative or zero" refers to the count of paths
raise ArgumentError, _("negative or zero max_paths") if max_paths < 1

# Calculate our filtered outbound vertex lists...
Expand Down Expand Up @@ -225,17 +226,18 @@ def report_cycles_in_graph
return if n == 0
s = n == 1 ? '' : 's'

message = _("Found #{n} dependency cycle#{s}:\n")
message = n_("Found %{num} dependency cycle:\n", "Found %{num} dependency cycles:\n", n) % { num: n }
cycles.each do |cycle|
paths = paths_in_cycle(cycle)
message += paths.map{ |path| '(' + path.join(" => ") + ')'}.join("\n") + "\n"
end

if Puppet[:graph] then
filename = write_cycles_to_graph(cycles)
message += _("Cycle graph written to #{filename}.")
message += _("Cycle graph written to %{filename}.") % { filename: filename }
else
message += _("Try the '--graph' option and opening the ")
#TRANSLATORS OmniGraffle and GraphViz and program names and should not be translated
message += _("resulting '.dot' file in OmniGraffle or GraphViz")
end

Expand Down

0 comments on commit c938030

Please sign in to comment.