ContextTranslate

A Chrome extension that translates selected text with help from the surrounding page context, built around a bring-your-own-key privacy model.

Role: product design, extension implementation, Gemini integration
Status: Chrome extension and proof-of-work project
Read: 7 min
Privacy model: bring your own API key, no developer-side server handles translation text

What it is

ContextTranslate is a small browser extension for a narrow translation problem. You select text on a page, click a floating icon or the right-click menu, and get a translation in a small popup without leaving the page.

Two things make it different from the built-in translator. The first is context. The extension does not send only the selected word or sentence. It also takes a small window of nearby text from the same block and tells Gemini to translate just the selection and use the rest only for meaning. The current build sends up to 1,200 selected characters with about 300 characters of context on each side, through Gemini Flash Lite, into whatever target language you picked.

The second is that the target language is set once. You are not choosing a language pair every time. You set the language you want to read in, and the extension translates from whatever the page happens to be, as long as Gemini can handle it.

How it started

I built it for myself. I read and browse in several languages, and the normal selection translators kept getting in the way. They translate the word you picked without really looking at the sentence around it, so an ambiguous word comes back in the wrong sense. I wanted to select one phrase, stay where I was on the page, and get a reading that had actually seen the paragraph.

The part I did not expect to like as much was the set-once target language. I keep it on my own language and let the page be whatever it is. I used it on Serbian text while I lived in Serbia, I use it on Vietnamese now that I live in Vietnam, I use it on English every day, and it has handled Japanese sites I wandered onto without me changing a setting. Not having to think about the source language is most of why it stuck.

The first bet

The first bet was modest. A small extension could make translation feel closer to reading. Select the part you do not understand, keep your place, and get an answer that has seen enough context to avoid the obvious mistakes.

I also wanted the privacy model to stay simple. The user brings a Gemini API key. The extension keeps that key in Chrome storage, sends requests straight to Google's API, and never routes the text through a server of mine. That adds setup friction, but it keeps the trust boundary clear, and it turns out to cost almost nothing in practice. On my own key the usage runs a few cents a month, low enough that I never think about it. If the product ever needed a normal subscription, that would be its own validation step, not something to bury in the first version.

What was actually hard

The extension is small, but the hard parts were not only the UI.

The first was context capture. A content script has to guess the right surrounding text on an arbitrary page, not a clean document. The current version walks up to the nearest block element, takes the text just before and after the selection, normalizes the whitespace, and sends that along. It is not a reader mode. It is a practical middle layer that works on most normal pages and makes the next problem obvious.

The second was ambiguity, which is the whole reason the product exists. I stress-tested it with single words like foul, where the right translation swings between a sports foul and several unrelated senses depending on the sentence. Flash Lite was fast, with local benchmark medians around 500 to 600 ms on the small test cases, but it still picked the wrong sense on some single-word examples. Claude Haiku did better on that test and was slower. That is the tradeoff the product lives with. Speed keeps reading fluid, but the promise breaks if context gets ignored at the exact moment it matters.

The third was the reality of Chrome extensions. Selection changes, service worker cold starts, content-script injection, popup positioning, and long selections each have their own edges. Version 1.2 dropped text-to-speech and became translation-only, which made it more coherent. Version 1.3 added optional anonymous analytics with a firm rule that it never records the selected text, the page URL, the translation, or the key.

Who actually uses it

It is not a big product, but it is a real one. I use it most days. My wife uses it. A few friends use it. Nobody is paying and the numbers are small, but it is past the stage where I am the only person who would notice if it disappeared.

That small base is worth more to me than the version history. It is the part that says the core loop is genuinely useful to someone other than its author, even though I never pushed it further.

Where it could go

When I looked for a segment where context-aware translation could become a real habit rather than an occasional convenience, the research pointed at heavy web-novel readers. People who read long serialized fiction translated from Chinese or Japanese already lean on machine translation, glossaries, and reader-mode tools because they want to read far ahead of the official releases. Their harder problem is consistency. Names, ranks, and recurring terms need to stay stable across hundreds of chapters, which a one-shot translator does not handle.

I did not build for that segment. It mostly told me where a serious version would have to go, toward remembered terms, exportable translations, and extraction for pages that block selection. For now it stays a note about direction, not something the product does.

What remains open

The most honest open item is money. The product works, real people use it, and I never tried to charge for it. I did not get that far, so I cannot claim anything about whether it could be a business.

The setup tradeoff is the next question. Bring-your-own-key is clean for privacy and costs almost nothing, but most people will not create an API key before translating a sentence. It is probably right for a prototype and wrong for anything mainstream.

Distribution is the last one. A Chrome extension installs in seconds, but translation is a crowded category, and a better store description is not a reason to switch. It would need a narrow audience with a sharp reason to care, which is what the reader research was circling.

What this page should show

ContextTranslate is a small proof-of-work project, not a finished business. It started from a friction I had myself, grew into something my family and a few friends actually use, and stopped short of any real attempt to make money from it. I am comfortable showing it at that size, because the interesting part was never the scale.

The interesting part is how much sits under a one-line idea. Translate the selected text with context turns into capturing the right surrounding text on a messy page, holding a clean privacy boundary, choosing a model against a speed-versus-accuracy tradeoff, and handling the failure states a real extension runs into. The product is tiny, but those are the same questions a much larger workflow system has to answer.