ca1989
Not able to extract translations with gettext
Hi all,
I am not able to extract translation strings into a pot file using the mix gettext.extract task.
The task exits without errors, but does nothing.
I am following the README at GitHub - elixir-gettext/gettext: Internationalization and localization support for Elixir. · GitHub
I set up a basic mix project to test it out:
https://github.com/carlotm/qwerty
PS: it works fine in a Phoenix project, so I am suspecting some black magic going on…?
Most Liked
BartOtten
You could propose they clarify the instructions. You are not the first on (neither was I) who tripped over this ![]()
Merge .pot into all locales
mix gettext.merge priv/gettext
It never mentions when or where ‘all locales’ are defined.
BartOtten
Did you run mix gettext.merge priv/gettext --locale {locale} to create a locales’ folder? This creates a priv/gettext/{locale} folder with the files.
Once you have done so for each locale you want to support, you can use mix gettext.extract --merge.
linusdm
If you’re on elixir 1.15 then I think you’re running into this issue: Running `mix gettext.extract` doesn't extract new messages with Elixir 1.15 · Issue #367 · elixir-gettext/gettext · GitHub
It’s fixed on the main branch, but not yet released. You can temporarily depend on the github version in your mix.exs, it my hypothesis is correct.
You don’t need to configure :priv (and :default_locale?) if they are default like that. You probably triggered a full recompilation somehow.
If you’re not on Elixir 1.15 then all the above doesn’t hold.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









