-
Notifications
You must be signed in to change notification settings - Fork 87
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
Duplicate references in POT files and warnings about redefining modules #373
Comments
Same issue here, now using a script like the following: #! /usr/bin/env elixir
#
# fix-gettext <dir>
#
# Will dedup each file in the given dir, recursively.
System.argv()
|> Stream.flat_map(fn path ->
if File.dir?(path) do
Path.wildcard(Path.join(path, "**"))
else
path
end
end)
|> Stream.reject(&File.dir?/1)
|> Stream.map(fn path ->
data =
path
|> File.stream!()
|> Enum.dedup()
File.write!(path, data)
IO.puts("Wrote to: #{path}")
end)
|> Stream.run() |
I believe this is caused by the same as #178 |
@josevalim / @whatyouhide Would you potentially be open to a new extract methodology that should resolve the umbrella issue?
Benefits of this approach:
If you're open to this approach, I do have some time to try it and see how it performs. |
@maennchen that's a bigger change than I'd like. I’m ok to do it if it's the only way, but I wanna try to figure out if there is a simpler way instead. Have you tried playing a bit with the recompilation that is triggered by |
@whatyouhide I played around with it for a while in this project: https://github.com/jshmrtn/hygeia/tree/main But even with a complete recompilation, I would run into multiple outcomes at random:
I used this mix tak, which made it better, but didn't resolve it completely. I haven't really been able to pinpoint the source of the issue. Everything was resolved when I merged all apps. |
Sorry, I don't have a solution either, but I also experience the flood of
Edit: I don't have an umbrella app though but I still see the same errors. |
@PJUllrich Do you by any chance have a way to reproduce this? I only experienced this issue with umbrella applications and haven't seen the problem since I stopped using those. |
When I run
mix gettext.extract --merge
on my umrella project, I get a LOT of warnings saying:
Even if I delete
_build
- I think this is also causing this issue, on all of my POT & PO files, I getWhich I assume is caused by the module being in memory twice or something, duplicating the reference.
I now just
uniq
the generated PO and POT files as a workaround, but I'd rather understand what the core issue is here.The text was updated successfully, but these errors were encountered: