Comments (5)
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()
from gettext.
I believe this is caused by the same as #178
from gettext.
@josevalim / @whatyouhide Would you potentially be open to a new extract methodology that should resolve the umbrella issue?
- Add config value
extraction_environments
, which defaults to[:dev]
- Add config value
extraction_apps
, which defaults to the current application - The gettext macros will register a module attribute containing all translations and register an
@before_compile
, which exposes the translations with an__translations__/0
function if the current env is contained inextraction_environments
. - The
Gettext.Extractor
will read all modules translations from__translations__/0
Benefits of this approach:
mix gettext.extract
does not have to recompile since all translations are already available from the normal compilation- This approach should easily work for umbrella applications or potentially even dependencies with a few tweaks
If you're open to this approach, I do have some time to try it and see how it performs.
from gettext.
@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 mix gettext.merge
? Because if we recompile from scratch correctly we shouldn't be seeing these issues. š
from gettext.
@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:
- New Translations not added
- Old Translations not removed
- Or all good
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.
from gettext.
Related Issues (20)
- check-up-to-date fails even though files are just extracted HOT 8
- Flaky test in `gettext.extract`
- Duplicate Filename in Reference when `:write_reference_line_numbers` is set to `false`
- Gettext.PluralFormError for plural form "1" in "ja" locale HOT 9
- `gettext.merge` FunctionClauseError HOT 4
- Module is not loaded because :nofile HOT 4
- Mention file path in plural forms deprecation warning HOT 4
- Plural Forms warning occurs in newly generated language file HOT 2
- bump a new version for #359 HOT 1
- Duplicate msgid with singular and plural form HOT 5
- Running `mix gettext.extract` doesn't extract new messages with Elixir 1.15 HOT 2
- Retain custom flags during merge HOT 3
- Interpolation option set but not working HOT 4
- compile depend excoveralls - origin/httpc failed HOT 1
- Add `Gettext.example` macro HOT 6
- If changes to `.po` file are discarded (accidentally), they're not added back HOT 17
- Allow to transform messages at compile time HOT 3
- `expo.msguniq` merges translations with different plurals HOT 4
- Locale changes between static mount and liveview HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gettext.