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

Gettext v0.26 breaks compilation #759

Open
Hermanverschooten opened this issue Aug 20, 2024 · 2 comments
Open

Gettext v0.26 breaks compilation #759

Hermanverschooten opened this issue Aug 20, 2024 · 2 comments

Comments

@Hermanverschooten
Copy link

Steps to reproduce

Upgrade gettext to latest version (0.26)

Description of issue

==> timex
Compiling 62 files (.ex)
warning: defining a Gettext backend by calling

    use Gettext, otp_app: ..., ...

is deprecated. To define a backend, call:

    use Gettext.Backend, otp_app: :my_app

Then, to use the backend, call this in your module:

    use Gettext, backend: MyApp.Gettext

     error: undefined function dngettext/4 (there is no such import)
     │
 255 │   dngettext("units", "%{count} nanosecond", "%{count} nanoseconds", 0)
     │   ^
     │
     └─ lib/l10n/translator.ex:255:3: Timex.Translator (module)

@Sancxo
Copy link

Sancxo commented Aug 20, 2024

We had the same issue this morning : one of my co-worker updated to Gettext 0.26 and had the following error message when compiling.

     error: undefined function dngettext/4 (there is no such import)255dngettext("units", "%{count} nanosecond", "%{count} nanoseconds", 0)^
     │
     └─ lib/l10n/translator.ex:255:3: Timex.Translator (module)


== Compilation error in file lib/l10n/translator.ex ==
** (CompileError) lib/l10n/translator.ex: cannot compile module Timex.Translator (errors have been logged)

could not compile dependency :timex, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile timex --force", update it with "mix deps.update timex" or clean it with "mix deps.clean timex"

Gettext 0.25 works well with Timex, but 0.26 brings changes in how to call Gettext Backends indeed, which breaks Gettext function calls inside /lib/l10n/translator.ex .

@axelson
Copy link
Contributor

axelson commented Aug 20, 2024

Ah, I think 0.26.1 (released a few minutes ago) fixes this part of the backwards compatibility. Timex now compiles for me.

https://github.com/elixir-gettext/gettext/blob/main/CHANGELOG.md#v0261

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

3 participants