Fix missing t method outside view_context

An alternative to #1595.

Addresses I18n related problems in https://www.openproject.org/work_packages/13560