Idiomatically.net – Idioms across languages

A site for exploring idioms across languages and locales

I am fascinated by idioms, their occasional obscurity and ability to capture to words no longer used in common parlance (like the word pale in beyond the pale). But more importantly, I am intrigued by their power to convey a nuance of meaning that is hard to substitute with their definition in every day speech.

idiom: noun. A speech form or an expression of a given language that is peculiar to itself grammatically or cannot be understood from the individual meanings of its elements, as in keep tabs on.

I am privilege to work with people from many different countries and I noticed that when I use an idiomatic expression (like take it with a grain of salt) I sometimes see blank stares from teammates who never heard it before. This led to me (probably annoyingly so) to ask my co-workers how to express idioms in their native language. I recorded these and searched for more online. I was fascinated by the idioms which were sometimes very similar to my own but other times totally different. I found several places online that have parts of the information I was looking for but the information is largely scattered through many message boards and sites. The best resource I found so far is wiktionary.org but I felt there was an opportunity to build something focused just on idioms and allow for deeper exploration.

As a software developer, I am always looking for ways to learn new technologies and grow. I often have trouble learning something without having a concrete thing to build so this project seemed like the perfect way to kill to birds with one stone or if you are in Bulgaria kill two rabbits with one bullet.

My goals for this project were (in this order)

  • Learn new technologies
  • Share technical learnings by writing and publishing the code on GitHub
  • Explore idioms and language further through working on the project
  • Publish a site that at least one other person will find useful 🙂

Functionality

The basic idea is to record the relationships between idioms in different languages but it turned out to be not that simple. Idioms are based on both language and locale. An idiomatic way to express something in Spanish in Mexico may not be the way you express it in Spain.

Language and confirmed countries

To handle that I ensure that each idiom entry contains both a language and one or more countries where it is spoken.

I built the site to be open so that anyone can contribute (this also makes it technically more fun since taking contributions means handling many new scenarios). I created a contribution system where any signed-in user can submit new idioms, edit existing ones, mark idioms as equivalent and add countries to an existing idiom. There is a review system where changes for untrusted users needs to be approved before becoming public.

Explore an idiom across countries on a map

For visualizing the related idioms, I built two representations: a list view and an interactive map to let you explore equivalent idioms across the world. Building this view led to an interesting design decision. Are idioms transitive?

If a certain idiom in Spanish is roughly equivalent to an idiom in English, and that idiom in English is roughly equivalent to one in German, then is it safe to assume the German idiom is equivalent to the Spanish one. The real answer is: it depends. Therefore, since I was between a rock and a hard place, I decided to make the assumption that they are transitive but build the system to remember which ones did a user directly mark as equivalent and which did the system infer via transitivity to allow changing later on. Making this assumption makes it easier to go to any given idiom and view all related ones across other countries and languages — which is the whole purpose.

Search or filter by language

The main page of the site features a sorted list of the English idioms ordered by how many equivalent idioms they have. You can perform a basic search across these or filter to different languages.

Technologies

Often when I start a side project, I say to myself “This is a great chance to learn new technologies” and proceed to try all new technologies, programming languages, frameworks and tools. I get so overwhelmed that I give up and never touch the thing again. (I have many half-started GitHub repos sitting around attesting to this.)

Maybe I should use this project to learn a Dvorak keyboard layout while coding in VIM for the first time and using Haskell?- Me

The fact is, a side project is something you do â€¦ on the side. I spend limited time on this any given day and will go long stretches of time away from it. I realized if I make the barrier to entry too high then I will never see it to completion and won’t actually learn since making incremental progress is too daunting.

This time I approached it in a more metered way (you could say I was once bitten, twice shy). I made a list of technologies I wanted to learn deeper and underpinned those with ones I knew well. I used Typescript and React as my known technologies but then explored

Even as I hit issues I was always able to make progress and never felt too overwhelmed since I was grounded in things I knew while I explored the technologies I was learning.

For example, at the beginning I was struggling to get GraphQL query type generation with TypeScript to work well. But I was able to take breaks from this and work on other parts until I was finally able to get it to work. (I plan to write more in the future on experiences with GraphQL as part of this project).

I learned the hard way that the diversity of the Node.js package ecosystem is a blessing and a curse. There are many libraries to solve any one problem, but when choosing one you need to carefully consider multiple factors:

  • the overall quality of the package
  • how well it combines with the other packages in the project
  • does it have have published and up-to-date TypeScript typings

In addition, I explored different Azure hosting options and services. After some exploration I settled on

Overall, this works pretty well. However, it was a challenge to keep costs low. I learned early on that a simple mistake or misunderstanding of the settings can lead costs to get high quickly. Especially for CosmosDB, since with the reserved RU minimums it is hard to not to see price get high if you want more collections or additional DBs.

Using the MongoDB API on CosmosDB worked decently but the gap between the features in MongoDB and those CosmosDB supports was frustrating at times (although they are working on this). I feel I still accomplished my goal of learning the programming model of MongoDb, especially since I had to rewrite several features twice: once in my ideal way and then in a less optimal way when I learned CosmosDB didn’t support what I was trying to do.

The source code for Idiomatically is published on GitHub. I hope that this full end-to-end example of a TypeScript website written with Apollo, GraphQL, React and server side rendering(ssr) will help unblock someone else when they are building with a similar stack.

Closing Words

With this initial feature and technology set, Idiomatically.net is able to handle and grow to answer the question of “How do I express this idiom in other languages and locales?”. Of course, there is a lot more that can be done but I am satisfied with the progress of this side project and decided to publish it knowing that that it is better to have an egg today than a hen tomorrow. I am curious to see if any one else finds it valuable (or at least mildly interesting) and will contribute more idioms to expand it further.