Less than 20% of the world speak English.

Yet, the current landscape of programming and software development is largely centered around the English language. I'm not just talking about programming constructs like "for", "if", and "else", but rather, the large body of documentation for many third-party libraries that are written solely in English. Only few large companies have the resources to translate their documentation into different languages, which leaves thousands of other libraries (many built by individuals or small groups) inaccessible to non-native English speakers.

Imagine if you were a newcomer to programming and saw that the documentation for a library you want to use is in a language you don't understand. It might just turn you away.

BabelFish (inspired by the multilingual fish from the Hitchhiker's Guide to the Galaxy) aims to tackle this problem, making software development more inclusive and accessible to everyone.

What it does

BabelFish analyzes source files for documentation comments, detects their language, and automatically translates them into the user's native language if it is in a different language.

How I built it

I used Typescript, the VSCode CodeLens API, as well as Azure's Cognitive Services API for the language detection and translation

Accomplishments I'm proud of

I was really happy when I managed to develop a method of parsing the comments in JS files and determining the appropriate lines to translate

What I learned

I didn't have any knowledge of the VSCode API or Azure Cognitive Services before beginning this hackathon so it was quite challenging to pick them up while developing the extension at the same time. However, having now gained a much deeper understanding of these 2 topics, it's exciting that I've managed to develop an extension for the text editor that I use everyday!

What's next for VS BabelFish

  • There are still some small issues with the extension that I will fix (e.g. it shouldn't translate argument names after @params in the comments)
  • Currently, the extension only supports Javascript files. I would like to expand it to support multiple additional languages.
  • I would also like to investigate how to improve the aesthetics and ease of use of the extension as I understand that the screen may get cluttered with translations when there many comments in a single file.

Built With

Share this project: