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: Kanta Translation Solution for Elixir and Phoenix Apps | Curiosum
  2. Kanta repository: GitHub - curiosum-dev/kanta: User-friendly translations manager for Elixir/Phoenix projects. · GitHub
  3. DeepL plugin: GitHub - curiosum-dev/kanta_deep_l_plugin: DeepL integration for Kanta · GitHub
  4. Po Writer plugin: GitHub - curiosum-dev/kanta_po_writer_plugin: PoWriter plugin for Kanta · GitHub

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. · GitHub.
  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. · GitHub.
  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:

Last Post!

RalfKin

RalfKin

I’ve used DeepL with gettext strings before, and I totally get what you’re asking. Unfortunately, it doesn’t automatically translate every string into all languages with a single click—at least not in the way you’re hoping. You would typically need to set up each language translation separately.

That said, I found that using a good software localization services helped speed things up, as they can integrate with your system and automate the process for multiple languages. It’s especially useful if you’re dealing with a lot of languages like you are.

I used a similar setup for a project where we had multiple languages to manage, and having that extra help really made a difference.

Where Next?

Popular in Announcing Top

Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
kelvinst
Hey everyone! Well, we made this lib a while ago and now we decided to finally go out and public with it! It’s a tool for creating and m...
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
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36654 110
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44532 311
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement