Skip to content

Commit

Permalink
(PUP-7042) Mark strings in graph
Browse files Browse the repository at this point in the history
This commit marks user-facing error and info strings in
`lib/puppet/graph/*` for translation.
  • Loading branch information
Magisus committed Jan 31, 2017
1 parent 19de9a5 commit e9359de
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 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.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,7 +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)
raise ArgumentError, "negative or zero max_paths" if max_paths < 1
raise ArgumentError, _("negative or zero max_paths") if max_paths < 1

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

message = "Found #{n} dependency cycle#{s}:\n"
message = _("Found #{n} dependency cycle#{s}:\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}.")
else
message += "Try the '--graph' option and opening the "
message += "resulting '.dot' file in OmniGraffle or GraphViz"
message += _("Try the '--graph' option and opening the ")
message += _("resulting '.dot' file in OmniGraffle or GraphViz")
end

raise Puppet::Error, message
Expand Down

0 comments on commit e9359de

Please sign in to comment.