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

Deprecated use of Gettext in phx.new #5944

Closed
leifmetcalf opened this issue Oct 3, 2024 · 1 comment
Closed

Deprecated use of Gettext in phx.new #5944

leifmetcalf opened this issue Oct 3, 2024 · 1 comment

Comments

@leifmetcalf
Copy link
Contributor

leifmetcalf commented Oct 3, 2024

Environment

  • Elixir version (elixir -v): 1.17.3
  • Phoenix version (mix deps): 1.7.14
  • Operating system: Ubuntu 24.04

Actual behavior

$ mix phx.new munch_phoenix
* creating munch_phoenix/lib/munch_phoenix/application.ex
* creating munch_phoenix/lib/munch_phoenix.ex
...

Fetch and install dependencies? [Yn] 
* running mix deps.get
* running mix assets.setup
* running mix deps.compile

We are almost there! The following steps are missing:

    $ cd munch_phoenix

Then configure your database in config/dev.exs and run:

    $ mix ecto.create

Start your Phoenix app with:

    $ mix phx.server

You can also run your app inside IEx (Interactive Elixir) as:

    $ iex -S mix phx.server

$ cd ../munch_phoenix/
$ mix ecto.create
Compiling 15 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, instead of importing your backend, call this in your module:

    use Gettext, backend: MyApp.Gettext

  lib/munch_phoenix_web/gettext.ex:23: MunchPhoenixWeb.Gettext (module)

Generated munch_phoenix app
The database for MunchPhoenix.Repo has been created

Expected behaviour

I've just started learning Elixir and Phoenix so I not confident making the change they suggest in the phx.new template, but I guess

    use Gettext, otp_app: ...

should be replaced by

    use Gettext.Backend, otp_app: :my_app

in gettext.ex

@leifmetcalf
Copy link
Contributor Author

My bad, this was fixed in #5902.

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

1 participant