Writing a fully translated app can become tedious. Is there a way to set a default translation scope for the current context ?
Example : I am writing inside a partial _deadlines.html.erb in the show.html.erb action of my ProjectsController
Now because I am trying to be a good programmer, I am scoping all my translations. I would like to produce the following tree
projects:
deadlines:
now: "Hurry the deadline is today !"
....
How can I make it less tedious than writing each time the full scope ?
projects/show.html.erb
...
<%= render 'projects/deadlines', project: @project %>
...
projects/_deadlines.html.erb called from show.html.erb
<p>Deadline : <%= t(:now, scope: [:projects, :deadlines]) %></p>
Is there a way to set a default scope for the current context (here the whole _deadlines.html.erb file) ?
EDIT
Some people suggested to use Rails Lazy lookup, but this does not produce the scoping I'm looking for. In my case, I want to skip the action
default scope (show, index, etc...) and add a scope for the current partial I am rendering (in my case _deadlines.html.erb)
Rails lazy lookup :
t('.now')
<=> t(:now, scope: [:projects, :show]
But I wanted :
t('.now')
<=> t(:now, scope: [:projects, :deadlines]