Bug: Coherence only works on gettext `0.13.1`
StephanMeijer opened this issue · 2 comments
== Compilation error in file lib/coherence_demo_web/coherence_messages.ex ==
** (ArgumentError) *gettext macros expect translation keys (msgid and msgid_plural) and
domains to expand to strings at compile-time, but the given msgid
doesn't.
Dynamic translations should be avoided as they limit gettext's
ability to extract translations from your source code. If you are
sure you need dynamic lookup, you can use the functions in the Gettext
module:
string = "hello world"
Gettext.gettext(CoherenceDemoWeb.Gettext, string)
(gettext) lib/gettext/compiler.ex:231: Gettext.Compiler.expand_to_binary/4
expanding macro: CoherenceDemoWeb.Gettext.dgettext_noop/2
lib/coherence_demo_web/coherence_messages.ex:75: CoherenceDemoWeb.Coherence.Messages.you_are_using_an_invalid_security_token/0
expanding macro: CoherenceDemoWeb.Gettext.dgettext/2
lib/coherence_demo_web/coherence_messages.ex:75: CoherenceDemoWeb.Coherence.Messages.you_are_using_an_invalid_security_token/0
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
This has been corrected (99d6250) but not yet released.
You could view the commit and make the changes yourself (there are not too many) or you could change your dependency in mix.exs
from {:coherence, "~> 0.5"}
to {:coherence, git: "git://github.com/smpallen99/coherence.git"}
and follow the readme instructions for upgrading (basically running mix coh.install --reinstall
).
Of course, you would get all other changes made since version 0.5 and would be using a version that is not necessarily stable.
Alternatively, you can change your dependency for Gettext in mix.exs
to {:gettext, "~> 0.13.1"}
ensuring that a higher version is not used. Phoenix currently includes this dependency as {:gettext, "~> 0.11"}
i.e. no patch specified.
Thanks for your answer!