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

Warning about Deprecated Gettext Backend Definition in New Phoenix App #5936

Closed
itzmidinesh opened this issue Sep 23, 2024 · 2 comments
Closed

Comments

@itzmidinesh
Copy link

Environment

  • Elixir version (elixir -v): 1.17.2
  • Phoenix version (mix deps): 1.7.14
  • Operating system: Windows 11

Actual behavior

I recently created a new Phoenix app using mix phx.new my_app and encountered the following warning when running it:

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, instead of importing your backend, call this in your module:

    use Gettext, backend: MyApp.Gettext

image

Expected behavior

This warning appears in lib/my_app_web/gettext.ex:23, indicating that the way of defining the Gettext backend is outdated.

It would be helpful for the generated code to be updated to reflect the new approach to defining Gettext backends. This could prevent confusion for new users encountering this deprecation warning.

Thank you for your attention!

@SteffenDE
Copy link
Contributor

Hi!

This was already fixed in #5902, it’s just not released yet.

@itzmidinesh
Copy link
Author

Thank you! I looked for related issues but overlooked this one. I appreciate your time on this and I apologize for the oversight.

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

2 participants