szsoppa

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:

  1. Necessity to use external tools to translate .po files.
  2. Having to describe the process of translating these files to non-tech people.
  3. Having to send the .po files and receive translated versions from non-tech people.
  4. Troubles with spotting not translated keys.
  5. 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:

  1. Announcement blog post: Introducing Kanta - the ultimate solution to translations in Elixir web apps | Curiosum
  2. Kanta repository: GitHub - curiosum-dev/kanta: User-friendly translations manager for Elixir/Phoenix projects.
  3. DeepL plugin: GitHub - curiosum-dev/kanta_deep_l_plugin: DeepL integration for Kanta
  4. Po Writer plugin: GitHub - curiosum-dev/kanta_po_writer_plugin: PoWriter plugin for Kanta

Most Liked

szsoppa

szsoppa

Hey, thanks for the question.

Think of Kanta as an additional layer on top of Gettext. The process is as following:

  1. 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 call gettext functions within your codebase, you still do. The first assumption of Kanta, when we started to develop it was the ability to integrate with current gettext calls 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..
  2. 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..
  3. New translation keys that appear in the timeline after point 2, will be added to DB as well.
  4. Translations that you already have (both in DB, as well as .po files), can be overridden in Kanta UI at any point.
  5. 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

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 :slight_smile:

szsoppa

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 :slight_smile:

outlog

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!

hauleth

hauleth

Have you looked at Accent from Mirego? It seems to fill similar role, but with target for broader set of export formats (and automation between developers and translation tool).

Where Next?

Popular in Libraries Top

hpopp
After just over two years in development, this latest version of Pigeon is what I finally consider done in regards to my original vision ...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
riverrun
I’ve just released version 3 of Comeonin, a password hashing library. The following small changes have been made: changes to the NIF c...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
New
vic
Expat is a tiny experiment I did for extracting patterns and being able to reuse them (compose and share patterns between elixir librarie...
New
mattludwigs
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a me...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Sub Categories:

We're in Beta

About us Mission Statement