Ruby/Rails i18n does not (per 2025-07-07) respect the HTML-safety of interpolated values, so you need to do this:
I18n.t("foo.bar", link: link_to("Help", help_path)).html_safe
Even though link_to
returns a html_safe?
string, it will be escaped unless we flag the entire string as safe.
Flagging the whole string is at best inelegant, but also opens up for XSS injection attacks.
Less likely, a translator will inject evil HTML into the translation strings themselves. (But they should not be able to, however unlikely.)