One chat, every language
Most of the corpus exists only in English. Most of our users do not. Rather than translate everything in advance, we taught the chat to translate as it speaks — and cached it so it stays fast.
Our chat answers questions about the lectures and the scriptures. But there is an inconvenient truth underneath it: most of the corpus — lectures, fragments, commentary — exists only in English. The users arrive in Russian, Ukrainian, Serbian. The question we set ourselves: how do we give each person an answer in their own language, without translating the whole corpus by hand?
The easy path is to translate everything in advance and store it. We rejected it at once: the corpus lives and grows, and every new verse or lecture would drag a manual translation into each language behind it. So we translate on the fly — but with some care.
Search language is not answer language
The distinction that simplified everything: the language you search in and the language you are answered in are two different things.
When you ask, the system first checks whether material exists in your language. If it does, it searches there. If it does not, it falls back calmly to English and searches there — so it returns real sources instead of an empty result. The connected narration it writes on top of what it found, though, is always in your language.
question (your language)
→ material in your language? yes → search it
no → search English (real sources, not silence)
→ narration written on top → always in your language
Found in English, told to you in yours.
Quotes, transliteration, audio
Quotes. When a śloka goes into an answer, its translation is matched to your language — and if no ready translation exists, one is produced at the moment of answering.
Transliteration. We do not store the Sanskrit transliteration separately for each language. We keep one clean Latin form (IAST) and derive Russian, Ukrainian, or Serbian Cyrillic from it on the fly — one function instead of a dozen pre-built tables.
IAST: kṛṣṇa
→ ru кр̣шн̣а
→ uk кр̣шн̣а
→ sr кр̣шн̣а (one derivation, not three stored columns)
Audio. Lecture fragments go in as they are — in the original, as they sound on the recording. But if a fragment’s language is not yours, a translation rides alongside it, and a single tap flips between translation and original and back. Both versions arrive together, with no extra request.
Keeping “on the fly” from meaning “every time”
The danger with translate on the fly is that it quietly becomes translate on every sneeze. To prevent that, two levels of storage.
Each translated piece is translated exactly once and stored in the database beside its original. Over the database sits a cache that returns a ready translation instantly, without troubling either the database or the model. The first request thinks for a moment; every one after it is immediate.
need a translation?
cache ─hit→ instant
└miss→ DB ─hit→ store in cache → instant next time
└miss→ translate once → write DB → cache → return
The result
The chat speaks to each person in their own language, but rests honestly on the original sources. Translation of verses, transliteration, localization of fragments — all in real time, and all cached, so it stays fast. And the original is always one tap away: in sacred texts, the precision of the source matters no less than how well it is understood.
Part of
Lectorium