Let offers
be a folder in app/views
. The locale is:
en:
offers:
index:
...
new:
...
i.e. I follow the Rails convention so that I can use t('.something')
in views.
The problem is that I store global translations like this:
en:
a_global_key: A Global Translation
So when I want to translate offers
I would like to add:
en:
offers: Offers
But this generates a collision with the previously defined view namespace.
I know I can avoid this by simply using a namespace like global
for global translations. Then I would always have to write t(global.a_global_key)
instead of the more concise t('a_global_key)
.
Is there a Rails way to structure locales that prevents collision between global translations and view namespaces?
It would be great to be able to write something like the following invalid YAML:
en:
offers: Offers
index:
...
new:
...