DEV Community

Shiv Rai (S_RAI)
Shiv Rai (S_RAI)

Posted on

Pegasus: Your Document's Language Passport, Powered by Lingo.Dev

If I asked you "How many languages are there in the world?", what will you say? "500"? "1000"? "5000"? Still not there yet. There are 7000+ languages in the world. Yet, most of us can name around 10-20. English, being the most common, since it is used globally. However, there are people who do not speak English and there are places, where English is not the preferred language for documents. And that is totally fine. Its a wide world. People are free to speak the language they choose.

However, this creates a gap in communication. One or sometimes more than one party, has to use a translator in order to communicate. People often use tools like Google Translate in such situations. But, what about documents?
Imagine you sent a pdf or docx to someone in English. That person requested a French version. What will you do ? you copy paste your content into a translator, copy paste the response back into your docx, save it, and share it back to the person. This was a single request. For 1 language. There are more than 20 languages spoken by more than half of the worldโ€™s population. Let's assume that just half of them requested a version in their language, which means 10. Are you going to repeat the process 10 times ? That's not sensible, right ? Let's assume you are a hard-worker and did it 10 times. Hurray! But wait... you just noticed there is a small change that needs to be done. You made the change in the original document. And then you realize, you have to do the translations again for the 10 requests.

At this point you are putting in more effort for preparing document for sharing than doing something productive. But what's the solution to this problem? What if you could just make a single file, with all the translations, rendered according to user's preference? Imagine how easy it would be. Create your file, add translations, share a single file, and you are done. Sounds simple, right? Worry not, it is simple with Pegasus.

Pegasus

What is Pegasus?

Imagine an app through which you can create a single file with all the required language translations you want, share it with your team, and they can view it in their preferred language, without even needing internet. How amazing would that be? Pegasus is that app!

Doc View

How Pegasus works?

You choose your document (txt, docx, pdf), select the languages you want the translations of, add lingo dev API key, choose the output folder. And that's it. You get a .pgs file which you can share with whoever you want and they can open Pegasus, open this .pgs file, and view it in their language (without API key).

What if someone got the file but their language translation wasn't available? They can add the translations of their language within the .pgs file following the same steps to create the file. The best part, the current translations available aren't removed. New translations are added along with existing translations.

The app only requires internet connection when you need translations. Otherwise, it can be used to view files and their translations without the need of internet. Reason, the single file contains all the data required.

Language Selection

How it's made?

It's made using Electron.js + Vite + react in typescript, along with tailwindCSS and powered by Lingo.Dev
Lingo Dev's API is used for document content translation while Lingo Dev's Compiler is used to translate the UI content of Pegasus app.

GitHub Repo: https://github.com/ShivRaiGithub/pegasus

Conversion page 2

The Problem Pegasus solves

BILLIONS of digital documents require translations EVERYDAY. Business contracts, government papers, product manuals, etc are examples of some documents whose digital versions need various translations for multiple languages. Large companies usually maintain more than 5 language versions of same document. This piles up in costs, leading to thousands of dollars just to maintain few documents. These costs can be reduced multi-fold. What do you think is the market size of multilingual document translation ? More than $60B. But now,
Instead of:
policy_en.pdf
policy_fr.pdf
policy_es.pdf
policy_de.pdf
policy_hi.pdf
There can be a single:
policy.pgs

Costs reduced. Inefficiencies decreased. All through a single and simple app.

View doc in translated languages

More about Pegasus and my experience
1) At first, Pegasus worked only for txt files. I later added features for it to work with docx files as well as pdf files. There were so many issues that arose while working with docx and pdf files. The reason for that is, unlike txt files, docx and pdf files have a structure and a layout. I tried few ways to ensure that the translations follow the actual layout as much as possible. Eventually I reached a satisfiable outcome for pdfs and docs too.
2) I wanted to make PPTs work with Pegasus too, but due to the time constraint, I wasn't able to. Working with PPTs requires better ways to extract text and place them back while making sure the bg is not affected. Working with PPTs and other file formats is something that can be done in the future.
3) Working with Hindi. Hindi characters weren't visible. I had to download another npm package that can be used to display devnagari script.
4) Due to time constraints, I wasn't able to make dedicated download files (like exe for windows). But the repo is self sufficient to build and run the application. All the steps are in the readme.
5) I wanted to try something new for demo video, so I created the demo video using AI generated clips + screen recordings.
6) I have done most of the app building and testing on WSL. I did test the app on windows, but not on iOS.

Top comments (0)