I believe you should use a mapping instead as in the third example here:
http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/i18n.html

Maybe `raise Invalid(node, _(u"${lang} is not a valid language", mapping={'lang': value}))`.