fix mix usage for prod
This commit is contained in:
parent
9053f0840a
commit
032b9a31ca
1 changed files with 2 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ defmodule AprsmeWeb.LocaleHook do
|
|||
LiveView hook for setting locale based on Accept-Language header.
|
||||
This ensures that LiveView updates maintain the correct locale.
|
||||
"""
|
||||
import Config, only: [config_env: 0]
|
||||
import Phoenix.Component
|
||||
|
||||
# Cache supported locales at compile time
|
||||
|
|
@ -11,7 +12,7 @@ defmodule AprsmeWeb.LocaleHook do
|
|||
def on_mount(:set_locale, params, session, socket) do
|
||||
# Only set locale in production to allow seeing "xx" placeholders in dev
|
||||
locale =
|
||||
if Mix.env() == :prod do
|
||||
if config_env() == :prod do
|
||||
get_locale_from_session(session) || "en"
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue