A browser extension to improve my Italian

I’ve been wanting to take my Italian to the next level for years. I took a year of Italian in my senior year of college and attended an Italian language meetup for a year after that, but I feel like my Italian has plateaued (or even declined) since then.

When you read about how to advance beyond the intermediate level of a language, recommendations typically include listening to songs in the target language (which I eagerly do) or reading newspapers from the target country.

However, the problem with reading Italian news online is that I usually have to look up some words, and it’s a bit of a hassle to toggle between the Italian-English dictionary and the Italian news.

The solution? A Google Chrome Italian-to-English dictionary extension, so I can consult the dictionary in the very same window I’m using to read the news!

No such extension existed in the Chrome web store, so I made my own and named it Cicero after the ancient Roman statesman known for his oratory and prose style.

I was already familiar with the basics of building Chrome extensions thanks to my silly LinkedIn da Vinci extension, but this time it would be a little more complicated, since I was calling a language API (the Glosbe API, which I also called while building an Italian dictionary iPhone app).

To call the API, I sent messages from my popup script to my background script asking for the definition of whatever word the user typed in. You can include JSON-esque data in your sendMessage request from the popup to the background script. I included the data { word: word }, referencing a variable called — you guessed it — word, which I was able to retrieve in the background script using request.word.

I needed to console.log the contents of the JSON response from the background script to parse it, so Chrome’s debugging tutorial was essential. Also, I couldn’t call the API using jQuery, but Chrome’s documentation included a handy sample script to call the API with pure JavaScript. The API call in onMessage needed to return true.

As I found while making my LinkedIn da Vinci extension, knowledge of JavaScript goes a long way when making Chrome extensions. The messaging concept in extensions should be familiar to anyone who’s dealt with web sockets or JavaScript frameworks like Angular, but it’s accessible to more elementary JavaScript users as well.

I’ve put the browser extension in the web store and have downloaded it in my own browser — now I just need to read the Italian news more often and actually use it!

Italian dictionary browser extension Cicero on Google Chrome

Of course, looking up a word once isn’t the most effective way to learn it. I really like how Chiron, a Latin & Greek browser extension made by the Paideia Institute, stores the words you look up and allows you to import them into Quizlet. I’d be interested in incorporating the same functionality into my own extension, as well as Chiron’s ability to look up a word when you simply double-click on it.

I’m excited to use my programming knowledge to improve my Italian, and I think digital humanities projects (like Paideia’s Chiron extension and my own modest Italian extension) show how programming skills can be applied to any other interest you have.