DEV Community

Lucas Parzych
Lucas Parzych

Posted on

Automatic translations on Every Pull Request

Alright, so there's a TON of open source libraries that we can use to internationalize our web apps. e.g. i18next, next-translate, @angular/translate, vue-i18n, just to name a few.

They all work pretty similarly actually. For the most part, they require you to store a set of locale files along side your code. e.g.

.
├── fr
│   ├── common.json
│   └── home.json
├── en
│   ├── common.json
│   └── home.json
└── es
    ├── common.json
    └── home.json
Enter fullscreen mode Exit fullscreen mode

From there, they provide utility functions you can use within your code to lookup the translated string in the appropriate language given a path.

There's lots and lots of tricky parts to getting this right (e.g. singular vs plural, dynamic variables, etc) and the libraries (in my opinion) do a great job at handling this stuff.

What they don't help with, is actually translating the strings and managing the files as you develop. I don't speak french but it doesn't really work to ask my translators to log into a Github account and edit the files in my pull request branch before I merge it.

I've been asking around how people handle this and the solutions seem to be mostly along the lines of "we copy paste between an excel sheet and emails and just try to remember" or "we've written some custom scripts to help with some of this process"

There are lots and lots of translation management solutions out there, e.g. www.lokalise.com, www.phrase.com, www.localizejs.com

Typically with these solutions you wouldn't use the open source translation software and you'd instead use the custom SDK shipped by the provider. They basically try to do everything under the sun. They provide a web interface for the translators to log into. They provide a CLI to pull/push translations between the code and the server hosted by the provider (or they don't utilize locale files at all). The solutions also tend to be very very expensive.

I don't want to pay extra for a bunch of features I don't really need when the open source solutions already get me 80% there.

I really just want something to do a few things for me really well:

  • I want something that fills in my missing translations when I add new ones, automatically (using DeepL or Google Translate)

  • I want it to be highly configurable so that I can set up whatever workflow makes sense for my project

  • But, I don't want to spend any more time than I absolutely have to going back and forth with translators. I want the tool to raise pull requests automatically and when the code changes I want it to update the text that my translator sees too (2 way sync)

So, I started building this product myself! It's not ready yet, but I've got a landing page. www.git-translate.io

What do you guys think?

Top comments (0)