Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all compilation failing with gettext error #337

Closed
lambdadog opened this issue Apr 9, 2018 · 7 comments
Closed

all compilation failing with gettext error #337

lambdadog opened this issue Apr 9, 2018 · 7 comments

Comments

@lambdadog
Copy link

I'm fairly new to the elixir/phoenix ecosystem so I'm fairly stumped by this. I can only imagine there's something I'm missing since no one else has mentioned this, but I can't figure out what it'd be

Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [kernel-poll:false]

Elixir 1.6.4 (compiled with OTP 20)
== Compilation error in file lib/fontina_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(FontinaWeb.Gettext, string)

    (gettext) lib/gettext/compiler.ex:231: Gettext.Compiler.expand_to_binary/4
    expanding macro: FontinaWeb.Gettext.dgettext_noop/2
    lib/fontina_web/coherence_messages.ex:75: FontinaWeb.Coherence.Messages.you_are_using_an_invalid_security_token/0
    expanding macro: FontinaWeb.Gettext.dgettext/2
    lib/fontina_web/coherence_messages.ex:75: FontinaWeb.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
@lambdadog
Copy link
Author

I sorta figured this was just because I didn't have the translations out in a file yet but gettext.extract is erroring out with this too, so I don't even know how to get to the point where I would edit them?

@lambdadog
Copy link
Author

It looks like smpallen99/ex_admin#425 is talking about the same issue. For now I'll just downgrade, but keep the issue open.

@lambdadog
Copy link
Author

Ah, got it. it was the string concatenation on you_are_using_an_invalid_security_token

Removing it solved the issue. I'll write up a pull request I suppose.

@lambdadog
Copy link
Author

Closing. Looks like it's already fixed on master, just not on hex.

@isAlmogK
Copy link

I'm running into the same issue, I just installed coherence so is this fixed yet?

@lambdadog
Copy link
Author

It's fixed in master, but that hasn't made it to hex yet. You can get the hex version to compile locally by going into your project and getting rid of the string concatenation in coherence_messages.ex for you_are_using_an_invalid_security_token (just combine the two strings into one)

@isAlmogK
Copy link

@beta-phenylethylamine thanks solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants