DEV Community

Cover image for I Tackled the Planet of Lana Language Challenge by Building an AI Translator & Voice Synthesizer
Malawige Inusha Thathsara Gunasekara
Malawige Inusha Thathsara Gunasekara

Posted on Originally published at novogen.inusha.me

I Tackled the Planet of Lana Language Challenge by Building an AI Translator & Voice Synthesizer

I tackled the challenge in a different way, and created this project as my answer.

When the indie studio Wishfully released the official Language Companion booklet (PoL_LanguageCompanion.pdf) for Planet of Lana II: Children of the Leaf, they ended it on page 13 with an irresistible invitation to the community:

"Congratulations, you’ve reached the end of this intensive crash course in Novo Terali! We hope you’ve enjoyed learning a bit more about Lana’s native tongue, and that your understanding of Novo as a whole has deepened in the process.

Now that you are completely fluent, we would love to hear from you in your best Novo Terali! Share a short (or long!) shoutout in your new favorite language on social media and tag us @planetoflana - we can’t wait to see it!"

Most players reading that would string together three words from the mini-glossary—like "Tiai Lana!" ("Hello Lana!")—tweet it with a screenshot, and call it a day.

I couldn't stop there.

The booklet provided around 80 canonical vocabulary words, basic commands, pronouns, numbers, and a handful of translated game scenes. But how can anyone truly be "fluent" when whole swathes of everyday vocabulary and grammar are still undiscovered?

Instead of just posting a one-line tweet, I asked myself:

What if anyone could translate anything into Novo Terali? What if we could reverse-engineer the linguistic rules from the booklet, marry them with an LLM extrapolation engine, back it with an acoustic voice synthesizer, and build a living, self-healing codex that speaks the language in real time?

That question led to NovoGen — an open-source, full-stack conlang translator, speech synthesizer, and dictionary manager for Planet of Lana.

Home screen of the NovoGen

Here is the story of how it was engineered, the technical hurdles encountered along the way, and what it takes to bring a fictional language to life with modern web and AI technologies.


1. Deconstructing Novo Terali: The Lore & Linguistics

In the Planet of Lana universe, Novo Terali (literally "New Speak") was created on Earth as an accessible auxiliary language designed to unite humanity during the multi-generational Fata te Cora ("Seed and Leaf") space mission. Centuries later, on the planet Novo, survivors preserved and evolved it into the melodic dialect spoken by Lana, her sister Elo, and the villagers of Tailo.

Before writing a single line of backend code, I extracted and analyzed every rule documented in the booklet:

                  ┌──────────────────────────────────────────────┐
                  │          NOVO TERALI PHONOTACTICS            │
                  ├──────────────────────────────────────────────┤
                  │  Vowels:      a [ah], e [eh], i [ee],        │
                  │               o [oh], u [oo] (pure Italian)  │
                  │  Diphthongs:  ai, ia, ea, oa, ui (unclipped) │
                  │  Consonants:  t/d aspirated, rolled 'r',     │
                  │               'h' voiced, no silent letters  │
                  │  Stress:      Light stress on first syllable │
                  │  Rhythm:      Calm, melodic, even pacing     │
                  └──────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Morphological Patterns Discovered:

  • Subject-Verb-Object (SVO) sentence structure ("Ona fatum tia" = "I believe you").
  • Negation: Direct marker dieh placed before verbs ("Ona dieh fatum" = "I do not believe").
  • Agglutinative Suffixes:
    • -em: Plural/verbal inflection (olaiolaiem = "go" → "did you go?").
    • -ari: Agent/actor noun suffix (djimo "make" → djimari "maker/creator"; capitari "director").
    • oti-: Honorific or co-prefix (oti-capitari = "co-director").
  • Philosophical Roots:
    • Fata: Predecessor, seed, origin, parent.
    • Cora: Successor, leaf, progeny, child, future.

2. Architecture Overview: Local-First Meets Cloud-Native

One core design philosophy was that NovoGen must never depend exclusively on third-party cloud APIs. If a user runs it offline without an API key, it should function seamlessly using local compute. If deployed to production, it should scale on serverless infrastructure.

                     ┌───────────────────────────────┐
                     │       Next.js App Router      │
                     │    Tailwind / Vanilla CSS     │
                     └───────────────┬───────────────┘
                                     │
                        POST /api/translate
                                     │
                     ┌───────────────▼───────────────┐
                     │   In-Memory Rate Limiter      │
                     │  (Sliding-Window, 30 req/min) │
                     └───────────────┬───────────────┘
                                     │
                     ┌───────────────▼───────────────┐
                     │  Multi-Tier Translation Engine │
                     └───────────────┬───────────────┘
                                     │
         ┌───────────────────────────┼───────────────────────────┐
         │                           │                           │
 1. Exact SQLite Match      2. Rule Agglutination       3. LLM Extrapolation
    (Canonical Lore DB)        (Suffixes & Modifiers)       (Gemini 3.1 / Ollama)
         │                           │                           │
         └───────────────────────────┼───────────────────────────┘
                                     │
                     ┌───────────────▼───────────────┐
                     │  Phonotactic Quarantine Guard │
                     │ (Anti-Gibberish Verification) │
                     └───────────────┬───────────────┘
                                     │
                     ┌───────────────▼───────────────┐
                     │      ElevenLabs Voice API     │
                     │    (Gigi Voice Model Tuning)  │
                     └───────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

3. Challenge #1: Hallucination Prevention in Conlang Extrapolation

Because the canonical dictionary has only ~80 terms, users translating sentences like "Look at the ancient machine in the forest" require new vocabulary.

If you give an LLM free rein, it will hallucinate English words with random accents or invent sounds that violate the fictional world's phonotactics.

To solve this, I designed a multi-tier fallback system:

  1. Tier 1 (Canonical SQLite Lookup): If an exact phrase or word exists in novo_dictionary.db (seeded directly from the companion booklet), return it immediately with is_canonical = 1.
  2. Tier 2 (Morphological Rules): Check if the word can be constructed via known prefixes and suffixes (e.g., compounding fata or appending -ari).
  3. Tier 3 (Constrained Generative Extrapolation): Prompt Google Gemini 3.1 Flash (or a local Ollama model like llama3.2 or mistral) using an ironclad conlang system prompt:
// System instruction excerpt enforced during translation
const CONLANG_PROMPT = `
You are the official linguistic translator for Novo Terali from Planet of Lana.
Follow these inviolable phonotactic constraints:
1. Every vowel is strictly: a [ah], e [eh], i [ee], o [oh], u [oo].
2. No consonant clusters exceeding 2 consonants; never use 'x', 'q', or 'z'.
3. Extrapolated roots MUST use open syllables (CV or CVC patterns like 'talo', 'suni', 'kora').
4. Compound from known roots where possible (e.g., 'machine' -> 'meka-fata').
5. Canonical vocabulary is SACRED: Never overwrite 'Tiai' (Hello), 'Cora' (Child/Leaf), etc.
Return strictly structured JSON containing translation, IPA phonetics, and grammar breakdown.
`;
Enter fullscreen mode Exit fullscreen mode

When an extrapolated word is generated, it is tagged as extrapolated and cached in SQLite so that subsequent translations remain 100% consistent across sessions.


4. Challenge #2: The Anti-Gibberish Quarantine Guard

Once the app went online, a new vulnerability emerged: cache pollution via keyboard mashing.

If someone types "leftofkfmv" or "asdfghjkl", the LLM would dutifully attempt to coin a poetic Novo Terali term for it, saving garbage into the shared SQLite dictionary.

To combat this without adding perceptible latency, I built a two-stage Linguistic Quarantine Layer (src/lib/validator.ts):

  1. Heuristic Phonotactic Analysis (< 0.1ms):
    • Rejects repetitive character streaks (/([a-z])\1{2,}/i).
    • Rejects impossible English consonant clusters (/[bcdfghjklmnpqrstvwxz]{4,}/i, exempting valid sequences like spl, str, ngth).
    • Rejects vowel-less tokens longer than 2 characters.
    • Rejects extreme single-word lengths (> 24 chars).
  2. Offline English Lemma Verification (< 0.2ms):
    • Loaded a curated set of 45,000 common English words into a fast Set<string>.
    • Words failing both checks are rejected from the translation pipeline and logged to data/quarantine_log.json.
export function validateQuery(query: string): ValidationResult {
  const tokens = query.trim().toLowerCase().split(/\s+/);
  for (const token of tokens) {
    if (isImpossibleCluster(token) || isRepetitiveMash(token)) {
      return { isValid: false, reason: "Phonotactic violation detected" };
    }
  }
  return { isValid: true };
}
Enter fullscreen mode Exit fullscreen mode

To give developers and administrators complete control, I added a dedicated Quarantine Admin Panel directly in the UI. Administrators authenticate using an ADMIN_KEY header, inspect suspicious inputs, approve verified terms into the canonical codex, or flush fraudulent entries with one click.


5. Challenge #3: Giving Lana a Voice with Acoustic Tuning

A conlang only feels alive when you can hear it spoken.

Planet of Lana features evocative, emotional voice acting. The developer notes highlighted that Italian voice actors captured the cadence best because of the open vowels and tapped consonants.

To reproduce this, I integrated the ElevenLabs Text-to-Speech API, selecting the Gigi voice model (a youthful, melodic tone) and meticulously calibrating its acoustic profile:

const voiceSettings = {
  voice_id: "Qd7hDo3tdwmASCs5vLEB", // Gigi
  model_id: "eleven_multilingual_v2",
  voice_settings: {
    stability: 0.82,          // High stability keeps Italianate vowels consistent
    similarity_boost: 0.85,   // Accurately locks to the vocal timbre
    style: 0.0,               // Neutral expressive base prevents over-dramatization
    speed: 0.85               // 15% reduction matches the calm, unhurried Novo pace
  }
};
Enter fullscreen mode Exit fullscreen mode

When users click the speaker button next to any phrase, the server streams high-fidelity 44.1kHz audio in under 400ms. If ElevenLabs is not configured, the app gracefully falls back to the browser's native Web Speech API with an Italian phonetic voice profile.


6. Deployment & Cloud Hardening

To make NovoGen accessible worldwide, I packaged it as a multi-stage Docker container and deployed it to Google Cloud Run:

  • Container Size: Reduced using Next.js standalone output mode (output: "standalone").
  • Dynamic Persistence: Cloud Run containers use a stateless root filesystem. I wrote an automated bootstrap script that copies novo_dictionary.db to /tmp upon startup, granting the SQLite engine full read-write capabilities during execution.
  • Rate Limiting: Implemented an in-memory sliding-window limiter (src/lib/rateLimit.ts) enforcing 30 translations/min and 10 voice syntheses/min per IP to protect downstream APIs from quota abuse.
  • Custom Domain: Mapped to https://novogen.inusha.me backed by Google-managed SSL certificates.

7. The Result: Taking the Challenge to the Stars

Here is what the translation engine can do.

Example 1: Canonical Dialogue Match

  • English: "We have to stop them, Lana."
  • Novo Terali: "Ite o imaiem, Lana."
  • Breakdown: Canonical sentence from Chapter 3 of the companion guide.

Example 2: Complex Extrapolated Expression

  • English: "Listen to the music of the stars, little child."
  • Novo Terali: "Teno lo sonari de eora stel, cora."
  • Breakdown:
    • Teno (listen) — coined root adhering to CV phonology.
    • sonari (music) — derived from son (sound) + -ari (nominalizer).
    • cora — preserved canonical cultural root for child/leaf.

Try It Out!

To the team at Wishfully (@planetoflana): You asked us for a shoutout in Novo Terali.

Instead, I built an entire engine so the whole world can speak it:

"Ite fatum tia, Wishfully. Tiai Novo Terali!"

(We believe in you, Wishfully. Long live Novo Terali!)


Top comments (0)