And again, why isn’t it already there in the first place? Together with the locales and default locale? For example, in Laravel it is set in config/app.php file, namely locale, default_locale, fallback_locale and faker_locale. I mean at least the locale could be put in config/config.exs somewhere by default ;(
As it is now, it seems half baked meaning you got gettext but you are missing locales and local is hardcoded in the root template file.
I followed it and the URL part doesn’t work with LiveView. I see the English version all the time. I thought it is working when I tried /nl first time and it showed the NL content, however then I manually tried /en and English showed. Then I tried again /nl but English was shown there:
scope "/:locale", MyWeb do
pipe_through :browser
live "/", HomeLive
end
/ doesn’t work anymore, although it should work as the default language . /nl and /en work but only English is shown.
so:
http://localhost:4000/ <-- this should show the default language but doesn't
http://localhost:4000/en <-- this works
http://localhost:4000/nl <-- this works but showed the NL content correctly only first time, after refresh English
Do you think the changes to make Phoenix Localized Routes compatible with Phoenix 1.7 are too complex and time consuming or you will figure it out in a couple of weeks?
Localized Routes can already be used with Phoenix 1.7 when using the former default method of using the route helpers. It only lacks support at this moment for the new verified routes.
As changing helpers to verified routes might be just as much work as changing verified routes to localized verified routes, I’d say: use the Phoenix route helpers as we all have done in the previous decade.