Gettext translations are not extracted when using a dynamic backend

noops = 
    for d <- ["default", "domain1", "domain2"] do
      quote do
        Gettext.Macros.dgettext_noop_with_backend(DemoWeb.Gettext, unquote(d), unquote(message))
      end
    end 

quote do
  unquote(noops)
  Gettext.dgettext(DemoWeb.Gettext, unquote(domain), unquote(message))
end

I’d always suggest writing the code you want to generate first, then try to write the macro that is meant to generate that code.

2 Likes