Open epinault opened 2 hours ago
looking at https://github.com/elixir-gettext/gettext/blob/main/CHANGELOG.md#v0260, seems they changed the wya it works in 0.26 but is not generated properly
looking at it , seems that we need to fix few things
in the core component module
defmodule GenericPhoenixAppWeb.CoreComponents do
@moduledoc """
Provides core UI components.
At first glance, this module may seem daunting, but its goal is to provide
core building blocks for your application, such as modals, tables, and
forms. The components consist mostly of markup and are well-documented
with doc strings and declarative assigns. You may customize and style
them in any way you want, based on your application growth and needs.
The default components use Tailwind CSS, a utility-first CSS framework.
See the [Tailwind CSS documentation](https://tailwindcss.com) to learn
how to customize them or feel free to swap in another framework altogether.
Icons are provided by [heroicons](https://heroicons.com). See `icon/1` for usage.
"""
use Phoenix.Component
##. the following line needs to go away
## import GenericPhoenixAppWeb.Gettext
## and instead do
use Gettext, backend: GenericPhoenixAppWeb.Gettext
In the app_web.ex
def controller do
quote do
use Phoenix.Controller,
formats: [:html, :json],
layouts: [html: GenericPhoenixAppWeb.Layouts]
##. the following line needs to go away
## import GenericPhoenixAppWeb.Gettext
## and instead do
use Gettext, backend: GenericPhoenixAppWeb.Gettext
import Plug.Conn
unquote(verified_routes())
end
end
Hi @epinault, this was already fixed in https://github.com/phoenixframework/phoenix/pull/5902. We just don't have a new Phoenix version released since then.
that it still broken on both version 1.7.14 abnd 1.7.15 from today
Note that this is only a deprecation warning and gettext still works and isn't "broken" out of the box. We know that the current situation isn't a satisfactory as it could be - we're working on getting the next Phoenix release out that will include those adjustments in the generators.
Environment
Actual behavior
I generated a brand new project.
Upon compile the project I get the following warning
Then I fix the warning per the suggestion
and I get now on compilation
All the gettext are missing
Expected behavior
Gettext works correctly but does not throw a deprecated warning