PhoenixMultilingual.Hooks.PutGettextLocale (phoenix_multilingual v0.1.11)

Sets the Gettext locale in the LiveView socket based on the locale stored in the socket's private data.

This hook must follow the StoreView hook in the LiveView's on_mount hook list.

Example

defmodule MyAppWeb.HomeLive do
  use MyAppWeb, :live_view

  alias PhoenixMultilingual.Hooks.StoreView
  alias PhoenixMultilingual.Hooks.PutGettextLocale

  on_mount {StoreView, default_locale: "en"}
  on_mount PutGettextLocale
end

Summary

Functions

on_mount(atom, params, session, socket)