I have a rails app the uses the standard i18n translations gem. It's a multi-tenant app and relies on parsing the current tenant from the subdomain.
en:
foo:
bar: "Welcome to %{subdomain}"
I have a few keys (e.g. subdomain
above) that I'm using very often in my translations. In my view I have to keep passing in the same key in various places
t("foo.bar", subdomain: current_subdomain)
Is there a way I can specify a default set of keys (like subdomain
) that are always passed to the translations by default so I don't have to type it out all the time?
Thanks!