Skip to content

Cldr Routes version 0.6.0

Compare
Choose a tag to compare
@kipcole9 kipcole9 released this 24 Jul 02:25
· 54 commits to main since this release

Enhancements

  • Adds MyApp.Router.LocalizedHelpers.<helper>_links functions to the generated LocalizedHelpers module. These _links functions are 1:1 correspondents to the _path and _url helpers. The _link helpers generate link headers that help identify the other language versions of a page. They are used like this:
iex> alias MyApp.Router.LocalizedHelpers, as: Routes
iex> Routes.user_links(conn, :show, 1) |> Routes.hreflang_links()
{
 :safe,
 [
   ["<link href=", "\"http://localhost/users_de/1\"", "; rel=alternate; hreflang=", "\"de\"", " />"],
   "\n",
   ["<link href=", "\"http://localhost/users/1\"", "; rel=alternate; hreflang=", "\"en\"", " />"],
   "\n",
   ["<link href=", "\"http://localhost/users_fr/1\"", "; rel=alternate; hreflang=", "\"fr\"", " />"]
  ]
}