BartOtten

BartOtten

Phoenix Localized Routes - Localized/multilingual routes in Phoenix

Phoenix Localized Routes is dead. Long live Routex!

Phoenix Localized Routes did pave the way for some routing libs but that was possibly it’s only award. As it was the first of it’s kind the design very much left much to be desired. It’s successor, Routex, is in every aspect a better lib.

  • better design
  • better code
  • better documentation
  • better performance

https://github.com/BartOtten/routex


What was Phoenix Localized Routes?

Localize your Phoenix website with multilingual URLs and custom template assigns; enhancing user engagement and content relevance.

                    ⇒ /products/:id/edit                  @loc.locale = "en_US"
/products/:id/edit  ⇒ /nederland/producten/:id/bewerken   @loc.locale = "nl_NL"
                    ⇒ /espana/producto/:id/editar         @loc.locale = "es_ES"

Top Features and Benefits

Simple when possible, powerful where needed.

Usage Summary

  • Add a configuration file describing which alternate routes to generate.
  • Replace less than 10 lines of code in your existing Phoenix application.
  • Optionally:
    • Run mix gettext.extract --merge
    • Translate the URL parts like any other translatable text.
  • Run mix phx.routes to verify the result.

You can now visit the localized URLs. Links and redirects in your application will automatically keep the visitors in their current (localized) scope.

Example App

Documentation

HexDocs (stable) and GitHub Pages (development).

Requirements and Installation

See the Usage Guide for the requirements and installation instructions.

Additional Resources

How it Works: High-level overview of Phoenix Localized Routes’ main features.
Usage guide: usage.html | hexdocs
Example app: Example repo | Github and Live at | Fly.io

Source: phoenix_localized_routes | GitHub
Package: phoenix_localized_routes | hex

Most Liked

kip

kip

ex_cldr Core Team

Sure have! @BartOtten is doing an awesome job.

BartOtten

BartOtten

I would not dare to publish a localization lib without @kip’s blessing :wink: Therefor I asked him personally to have a look at the lib when it was pre-0.1.0. Dare to say we both share a vision.

As a result CLDR Routes and Phoenix Localized Routes have influenced each other for the better. Both coming from another direction and with other features, but both targeting improvement in localization of Phoenix apps.

Soon will pick up the conversation and check which area would add the greatest improvement to accomplish that shared vision.

kip

kip

ex_cldr Core Team

I’ll be publishing my first livebook on this topic in the next week or so based upon my ElixirConf EU talk, and I have a few more in planning to follow that. I’ll post an announcement in the ex_cldr thread soon.

Where Next?

Popular in Announcing Top

mathieuprog
Hello :waving_hand: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First a...
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
brainlid
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir a...
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
michalmuskala
Another small library today. PersistentEts Hex: persistent_ets | Hex GitHub: GitHub - michalmuskala/persistent_ets · GitHub Ets table ...
New
archan937
It is a well-know topic within the Elixir community: “To mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New

Other popular topics Top

New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43487 311
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement