This should be a constant.  eg: `_(TaskMigrationError) % {name: name}` in the code that currently calls it.  Though, given the length putting newlines into it (eg: multi-line message) and just putting it inline might be nicer.  eg:

<pre>
raise TaskNotFoundError, _(<<-EOT) % {name: name}
Task %{name} appears to be in a legacy format:
We found a '%{name}.yaml' file, but modern tasks are in folders named '%{name}.task'
containing file 'metadata.yaml'.  For more detail see migration documentation online at
http://links.puppetlabs.com/razor-migration-task-revamp
EOT
</pre>

(I also expanded the text a tiny bit in the message, which I think makes it read more nicely.)