Coding in Spanish is hard. Specifically, Carol had to work in Spanish while contributing to One Laptop per Child, but non-English speakers have this barrier every day. Around the world, many international collaborators work on open and closed source projects but in many cases, this language barrier can pose an additional obstacle to contributing for such projects, especially since English is the only widely supported language for programming. Thus, we aimed to solve this by allowing collaborators to easily translate source code files into their desired language locally, while maintaining the ability to commit in the original language of the project.

What it does

Polycode is a developer command-line tool, which is also available as an Atom plugin, that lets you translate code to your language. Currently, it supports Python and Javascript in addition to any language that Google Translate supports for translating functionality, with plans in place to support more coding languages in the future.

How I built it

  • Polycode tokenizes identifiers and objects within the source files, then it finds out which strings can be translated
  • Backend stdlib API interacts with the Translate API from the Google Cloud Platform
  • Local maps are built to ensure 1:1 translations and that translations do not change over time, resulting in breaking changes to the code

Challenges I ran into

  • Parsing source code files and finding identifiers that should be translated i.e. primarily variable and function names
  • Handling asynchronous calls to the Translate API within the API created by us in stdlib

Accomplishments that we're proud of

  • Figuring out how to create a pip package to allow for easy installation of command line tools
  • Integrating with Atom

What I learned

  • Parsing and overwriting source files is hard
  • Google Translate is weird

What's next for Polycode

  • Support more programming languages
  • Deploying for the world to use!

Built With

Share this project: