Live data from Hacker News

Show HN: I coded my own JSON translation tool to easily localize my side project

quicklang.app

1–10 of 36 posts

Show HN: I coded my own JSON translation tool to easily localize my side project

#1
Hi HN, I’m Joan, the developer of Quicklang. I made this app to easily translate and keep in sync all my localization JSON files for my side projects. While searching online for a similar tool, I only found enterprise solutions that do not allow direct editing of JSON files.

I used to use ChatGPT to translate the JSON translation file changes before coding Quicklang. However, I realized that ChatGPT only allows you to input short content for translation into another language (even if you provide a .json file), and each time I had to request translations for one language at a time. So, I decided to build an app that only sends the changes I’ve made to the OpenAI API and easily translates them into all the target languages for my side projects.

Technical details: I used Next.js to build the front end and backend, and I use a custom VPS (EC2 instance) on AWS to handle the translation process. This is because the translation can take several minutes, and Vercel Functions time out after 10 seconds by default (up to 60 seconds on the Hobby plan). Finally, I save the translation files in an S3 bucket.

What’s next? I want to add cool features like change history, the capability to add context to the OpenAI API to make translations as accurate as possible, and maybe allow developers to interact with the API in order to use the tool.

Let me know your thoughts and feedback. It’s been a blast working on this so far, and I think it’s just neat :)

Show HN: I coded my own JSON translation tool to easily localize my side project
quicklang.app

Re: Show HN: I coded my own JSON translation tool to easily localize my side project

#5
post #3

There's a much easier way to translate json cat english.json | sed 's/"\([^"]*\)"/«\1»/g' > french.json

Hey!

Good approach, but I want to translate the strings on the JSON file from some source language (spanish for me) into any destination language.

So the JSON may be:

{ "hello": "Hola" }

If the destination language is "English" the result must be:

{ "hello": "Hello" }

Re: Show HN: I coded my own JSON translation tool to easily localize my side project

#6
Interesting! How about using Deepl as a translation backend? I got some good results for translation strings with {{placeholders}} that needed to be ignored in the translations. Its api also has some neat features like formality, glossaries and context(experimental).

Ps. I'm working on a similar opensource tool to speed up the i18n process ( https://codeberg.org/garage44/expressio)

Re: Show HN: I coded my own JSON translation tool to easily localize my side project

#7
post #4

Honestly, I don't see the reason to pay $10/month just to translate a json file.Or is this just another OpenAI API caller startup? "In any case, we must use LLM?"

Hey!

Thank you for your feedback! Quicklang is designed as a tool to synchronize and manage your JSON translation files centrally. For me, it’s good to have quick access for localizing my side projects efficiently and maintaining a changelog, among other features.

While there are several enterprise options available such as DeepL or Lokalise, they don’t quite fit my specific use case. ;)

Re: Show HN: I coded my own JSON translation tool to easily localize my side project

#8
post #6

Interesting! How about using Deepl as a translation backend? I got some good results for translation strings with {{placeholders}} that needed to be ignored in the translations. Its api also has some neat features like formality, glossaries and context(experimental). Ps. I'm working on a similar opensource tool to speed up the i18n process ( https://codeberg.org/garage44/expressio )

Hey!

I use DeepL for real-time translation in my side project. The reason I’m not utilizing the DeepL API on my backend and instead opting for the OpenAI API is twofold:

1. OpenAI is more cost-effective compared to DeepL API. 2. I was already using ChatGPT to translate my JSON files, so there’s no change in translation quality for me.

The primary issue I wanted to resolve is easily keeping all my destination language JSON files in sync.

Cheers!

Re: Show HN: I coded my own JSON translation tool to easily localize my side project

#9
post #6

Interesting! How about using Deepl as a translation backend? I got some good results for translation strings with {{placeholders}} that needed to be ignored in the translations. Its api also has some neat features like formality, glossaries and context(experimental). Ps. I'm working on a similar opensource tool to speed up the i18n process ( https://codeberg.org/garage44/expressio )

Hey! I use DeepL for real-time translation in my side project. The reason I’m not utilizing the DeepL API on my backend and instead opting for the OpenAI API is twofold: 1. OpenAI is more cost-effective compared to DeepL API. 2. I was already using ChatGPT to translate my JSON files, so there’s no change in translation quality for me. The primary issue I wanted to resolve is easily keeping all my destination language…

Cool, nice product. Interesting to see that you've managed to get translations working on top of chatGPT, even for languages like Arabic! I decided not to support target language edits, because I felt it would make it much more difficult to keep languages in sync, when the source string is not always leading. How do you deal with this properly? Would love to have an automatic workflow that updates the json source file, as i18n tags are being added/removed from frontend files. For versioning; maybe just take advantage of the project's (git) versioning?

Re: Show HN: I coded my own JSON translation tool to easily localize my side project

#10
have you thought about automatically generating json language files from pure html? Say I have an app that does not yet use a language file but just code like

Hello World

And on-the-fly translation? Say I have a backend that returns english language but I need it to translate it to another language on the fly? It could check whether the translation is available and otherwise generate it and store it. The original text key could be a hash of the text and you probably need in-memory key lookup for those hashes.

Post reply on HN