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
- URL format is customizable (no mandatory website.com/[locale]/page)
- URLs can match the language of content; enhancing user engagement and content relevance.
- Less than 10 lines of code to change in existing applications.
- Includes helper functions to generate links to other locales.
- Supports custom assigns per scope/locale.
- No run-time performance penalty!
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
Phoenixapplication. - Optionally:
- Run
mix gettext.extract --merge - Translate the URL parts like any other translatable text.
- Run
- Run
mix phx.routesto 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
Sure have! @BartOtten is doing an awesome job.
BartOtten
I would not dare to publish a localization lib without @kip’s blessing
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
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.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










