View Source Fermo.I18n behaviour (Fermo v0.17.1)

Link to this section Summary

Callbacks

Cross references all config pages, finding those with the same :id but with different locales.

Link to this section Callbacks

@callback load() :: {:ok}
@callback load(String.t()) :: {:ok}
Link to this callback

optionally_build_path_map(map)

View Source
@callback optionally_build_path_map(map()) :: map()

Cross references all config pages, finding those with the same :id but with different locales.

Each page with an :id and :locale in its parameters has a :localized_paths Map added indicating which locale has which path.

E.g.

%{

 path: "/",
 template: "home.html.slim",
 localized_paths: %{
   en: "/",
   it: "/it/"
 },
 params: %{
   id: "home_page",
   locale: :en
 }

}

In templates, this data is available via context.page.localized_paths.

Link to this section Functions

Link to this function

load(path \\ "priv/locales/**/*.yml")

View Source
Link to this function

optionally_build_path_map(config)

View Source