szsoppa
Kanta - the ultimate solution to translations in Elixir & Phoenix web apps
Hey guys!
I’m happy to announce that our amazing team at Curiosum developed a very cool open-source library called Kanta. If you struggle with translations, it can help you a lot.
Kanta’s goal is to reduce the following pains:
- Necessity to use external tools to translate .po files.
- Having to describe the process of translating these files to non-tech people.
- Having to send the .po files and receive translated versions from non-tech people.
- Troubles with spotting not translated keys.
- Having to deploy the new version of the app whenever a new translation is introduced.
All of that, packed within a friendly UI, and the best thing - to make it work, you don’t have to change anything in your code since it integrates with gettext. The installation is very simple, and for a start, we provide additional plugins:
- DeepL, if you’d like to translate the keys automatically
- PO Writer, if you’d like to export translations into .po files
Links:
- Announcement blog post: Introducing Kanta - the ultimate solution to translations in Elixir web apps | Curiosum
- Kanta repository: GitHub - curiosum-dev/kanta: User-friendly translations manager for Elixir/Phoenix projects.
- DeepL plugin: GitHub - curiosum-dev/kanta_deep_l_plugin: DeepL integration for Kanta
- Po Writer plugin: GitHub - curiosum-dev/kanta_po_writer_plugin: PoWriter plugin for Kanta
Most Liked
szsoppa
Hey, thanks for the question.
Think of Kanta as an additional layer on top of Gettext. The process is as following:
- To understand the entire process, first I need to point out that you don’t have to change anything regarding
gettext- just like you used to callgettextfunctions within your codebase, you still do. The first assumption of Kanta, when we started to develop it was the ability to integrate with currentgettextcalls within the app. The only thing to make this work is this line: GitHub - curiosum-dev/kanta: User-friendly translations manager for Elixir/Phoenix projects.. - Kanta takes the translations you currently have in app and populates them into DB. That’s why you need to run these migrations: GitHub - curiosum-dev/kanta: User-friendly translations manager for Elixir/Phoenix projects..
- New translation keys that appear in the timeline after point 2, will be added to DB as well.
- Translations that you already have (both in DB, as well as .po files), can be overridden in Kanta UI at any point.
- Kanta allows you to use a caching mechanism so that it doesn’t fetch the translations from DB every time it calls gettext. That’s solely for the performance reasons.
So, to summarize, Kanta at this stage of its development, is an extension to gettext. You still use gettext in your codebase, but now, you can also edit translations via UI without the need to release a new app version. It’s quite a popular scenario that applications are translated not by developers, but rather by non-tech people, and it’s especially useful for them (but not only).
szsoppa
Looks good, didn’t know this lib before. There is, though, one significant difference here - we wanted a tied to gettext solution that would be very easy to add to existing projects, which we believe is the case for a majority of Elixir & Phoenix apps.
Our goal here is to provide a solution specifically for our beloved tech stack rather than creating a general-purpose tool ![]()
szsoppa
Hey, thanks for your kind words!
About the frontend integration - we’ll need an API for that and a middleware that maps translations to a format acceptable by the library on the JS side. It’s doable and in our current roadmap ![]()
outlog
this looks amazing, will give it a spin for translating a react native app
edit: looks like this is on the roadmap - could be great to have!







