Looking at: Gettext_sigils - a sigil for using gettext with less boilerplate and better readability
(which is a really nice piece of work) made me come back and examine the way I am handling language switches right now.
Aiming for a good user experience, I switched from push_navigate to push_patch.
While this is good enough and works well with push_navigate:
def render(assigns) do
~H"""
<div>
{gettext("Works without an explicit @locale")}
</div>
"""
end
Using push_patch I had to reference @locale explicitly to get a proper DOM render
(well knowing that this is not a supported keyword but this way it looks more obvious to me):
def render(assigns) do
~H"""
<div>
{gettext("Needs an explicit @locale", locale: @locale)}
</div>
"""
end
Is there a way to handle this better nowadays?
And of course I’d prefer to be able to use the new gettext sigil ~t together with push_patch






















