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.

I set up a basic mix project to test it out:

PS: it works fine in a Phoenix project, so I am suspecting some black magic going on…?

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.

1 Like

That is working, thank you.

It’s a bit different from GitHub - elixir-gettext/gettext: Internationalization and localization support for Elixir. though.

Could the README be improved maybe?

You could propose they clarify the instructions. You are not the first on (neither was I) who tripped over this :slight_smile:

Merge .pot into all locales
mix gettext.merge priv/gettext

It never mentions when or where ‘all locales’ are defined.

2 Likes

Ah, mix gettext.extract works on main and v0.18.2, not working on v0.19.1
interesting