Overview & Philosophy
In ancient Sumer around 2000 BCE, translators bridging diverse dialects, cuneiform clay tablets, and trade languages were revered as Eme-bala (literally: "those who turn language to bridge worlds"). Modern digital tools, however, have increasingly compromised individual liberty by routing confidential communications and literary manuscripts through remote corporate cloud servers.
Team Sunplaza engineered the Emebala ecosystem to restore absolute sovereignty to the reader and writer. Our codebase is crafted in modern, high-performance systems languages: C++20 for the ultra-low-latency Windows desktop flagship (Emebala Chat) and Rust for the modular literary sanctuary (Emebala Reader).
- Emebala Chat (C++20 Desktop Flagship): Native Win32 / Direct2D client powered by an embedded
llama.cppruntime executing quantized GGUF weights (Hy-MT2-1.8B-Q8_0.gguf). Intercepts input buffers in any application to replace what you typed in-place, accompanied by double-Ctrl+C drag-to-translate and zero-latency Windows Speech Platform audio. - Emebala Reader (Rust Modular Architecture): Literary engine featuring 30+ format parsers (
emebala-fs), synchronized bilingual dual-page spreads, Kokoro-82M ONNX speech synthesis, PP-OCRv6 text recognition, and AES-256-GCM encrypted local vault storage.
🚀 Quickstart Installation
Both Emebala Chat and Emebala Reader are distributed as self-contained standalone Windows applications. Emebala Chat is completely portable: its configuration file (config.json) and neural weights reside directly in its executable folder, requiring no registry writes or hidden AppData directories.
Obtain the latest portable release package or setup binary from the GitHub release distribution:
Get-FileHash -Path ".\EmebalaChat.exe" -Algorithm SHA256
⚙️ System Requirements
| Hardware Subsystem | Minimum Requirements | Recommended (Optimal Latency) |
|---|---|---|
| Operating System | Windows 10 64-bit (Build 19041+) | Windows 11 64-bit (22H2+) |
| CPU Instruction Sets | x86_64 with AVX2 & FMA3 | Modern 8+ Core (AVX2 / AVX-512 supported) |
| System RAM | 8 GB RAM | 16 GB+ Dual-Channel (Fast DDR4/DDR5) |
| GPU Acceleration | Integrated Intel UHD / AMD Vega | NVIDIA GeForce RTX (CUDA sm_75+ Turing or newer) |
| Storage I/O | SATA SSD (1.5 GB for Q8_0 weights) | NVMe SSD (enables sub-second mmap paging) |
| Audio Subsystem | DirectSound compatible audio | Windows Speech Platform with installed language packs |
⚡ In-Place Send-and-Replace Mechanics
In Emebalachat/src/hook.hpp, Emebala Chat implements a revolutionary keystroke replacement workflow: you simply type naturally in your native tongue inside Slack, Discord, WeChat, Teams, WhatsApp, or any browser input, and press the key you normally press to send messages.
| Key Combination | Hook Predicate & Code Rule | Exact Resulting Behavior |
|---|---|---|
| Enter | EnterSendReplaceAllowed() |
In-Place Send-and-Replace: Intercepts typed buffer, translates it into the active target language, replaces text in-place, and sends. |
| Shift + Enter | Shift modifier check (!shift) |
Pass-Through Newline: Bypasses translation entirely; passes straight to target application to insert a multiline carriage return. |
| F9 | hotkey_toggle handler |
Global Toggle: Instantly toggles translation engine between Active (Green) and Paused (Grey) states. |
| Ctrl + F9 | hotkey_lang handler |
Cycle Target Language: Rotates target language through the active language list with sound confirmation. |
| Ctrl + Shift + Enter | hotkey_mode handler |
Toggle Auto-Send: Switches between replacing text only vs replacing-and-submitting automatically. |
VK_PROCESSKEY (0xE5). The hook's internal ImeMirrorNext state machine guarantees that unfinished compositions are never accidentally truncated or corrupted.
🖱️ Floating Rosetta Badge & Drag Gestures
Emebala Chat renders a lightweight hardware-accelerated Direct2D badge widget directly on the screen (Emebalachat/src/ui/badge.cpp):
- Single Left-Click: Toggles engine between Active and Paused translation state.
- Double-Click: Instantly swaps source and target translation direction (e.g. English ↔ Korean).
- Click & Drag: Freely repositions the floating status pill anywhere across single or multi-monitor desktop setups. Coordinates persist in
badge_xandbadge_y. - Double Ctrl + C Trigger (
"double_ctrl_c"): Highlighting any text on screen and pressing Ctrl+C twice quickly summons the Floating Translation Tooltip right at your cursor.
🔊 Windows Speech Platform (Chat TTS)
In Emebala Chat (src/sound.cpp), speech synthesis is powered directly by the native Windows Speech Platform (Windows 내장 언어팩) through the ISpVoice COM interface and WinRT Windows.Media.SpeechSynthesis.
🔒 Low-Level Keyboard Hook Safety Model
Emebala Chat's keyboard hook architecture (src/hook.cpp) was engineered under stringent safety constraints:
- LowLevelHooksTimeout Prevention (REQ-R06): The hook callback performs zero blocking I/O, zero network calls, and zero model inference on the hook thread. Heavy workloads are dispatched asynchronously to a dedicated pipeline worker thread (
src/worker.cpp). - Zero Cloud Clipboard Leakage: When capturing and restoring text selections, the Windows flag
CanIncludeInClipboardHistory = 0is applied, preventing transient translation strings from polluting Windows 10/11 cloud clipboard synchronization history. - Zero Telemetry Logging: Keystrokes that are not the intercepted action keys are never logged, buffered, or stored to disk.
📖 Emebala Reader: Synchronized Dual-Page Engine
Engineered in Rust with a Flutter frontend bridge, Emebala Reader delivers a desktop sanctuary for long-form literature and scholarship:
- Sentence-Level Paragraph Alignment: The original text and translated text are dynamically mapped sentence-by-sentence into twin parallel columns or facing spreads.
- Reflowable Dual-Spread Layout: Typography adapts to window width, zoom scales, and cultural reading themes while strictly preserving line and footnote alignment.
- Continuous Bilingual Scrolling: Progressing through chapters scrolls both languages in perfect unison.
📚 30+ Supported Book & Document Formats
Emebala Reader's file system crate (native/emebala-fs/src) houses 39 Rust parser modules, delivering universal compatibility across world literature, digital comics, and academic documents:
| Category | Supported File Extensions | Rust Parser Modules (emebala-fs) |
Rendering Capabilities |
|---|---|---|---|
| Hangul Word Processor (HWP / HWPX) | .hwp, .hwpx |
hwp.rs |
Full Hangul HWP and HWPX compound document parsing |
| Microsoft Word & Office (DOCX / ODT / RTF) | .docx, .odt, .rtf |
docx.rs, odt.rs, rtf.rs |
DOCX, ODT, and RTF XML DOM extraction, tables, styles, and character formatting |
| Digital Fiction & E-Books (EPUB / MOBI / KFX / FB2 / FBZ) | .epub, .mobi, .kfx, .fb2, .fbz |
epub.rs, mobi.rs, kfx.rs, fb2.rs |
EPUB, MOBI, KFX, and FB2 reflowable chapters, metadata, table of contents |
| Fixed-Layout Documents (PDF / DjVu / CHM / XPS) | .pdf, .djvu, .chm, .xps |
pdf.rs, djvu.rs, chm.rs, xps.rs |
PDF, DjVu, CHM, and XPS multi-column bounding box extraction, DjVu JB2 compression |
| Comic Books & Manga (CBZ / CBR / CB7 / CBT) | .cbz, .cbr, .cb7, .cbt |
cbz.rs, cbr.rs, cb7.rs, cbt.rs |
Archive extraction (CBZ, CBR, CB7, CBT) with image caching |
| Plain Text & Web (TXT / Markdown / HTML) | .txt, .md, .html, .mhtml |
txt.rs, md.rs, html.rs, mhtml.rs |
TXT and Markdown UTF-8/UTF-16 auto-detection, CommonMark markdown parsing |
🎨 Cultural Reading Themes & Typography
To eliminate digital eye strain during prolonged contemplation, Emebala Reader incorporates three bespoke cultural themes:
| Theme | Historical Heritage | Color Values | Recommended Reading Setting |
|---|---|---|---|
| Mesopotamian Clay | Cuneiform clay tablets of ancient Sumer (2000 BCE) | Clay Terracotta #C4956A, Deep Earth #14110F |
Nighttime low-blue-light reading |
| Joseon White Porcelain | Korean Joseon Dynasty pure white porcelain (백자) | Ivory Silk #F7F3EE, Cobalt Blue #2F5D9B |
Daylight study and academic literature |
| Traditional Hanji Mulberry | Handmade mulberry fiber paper (한지) with natural warmth | Warm Hanji #DFB78E, Antique Ink #241E1A |
Classical poetry, memoirs, historical texts |
🔍 PP-OCRv6 On-Device Text Recognition
Scanned manuscripts, historical documents, and image-based PDF/comics are processed via the integrated OCR pipeline in native/emebala-ai/src/ocr.rs:
- ONNX Runtime Local Inference: Uses ONNX Runtime CPU/DirectML with zero external dependencies.
- DBNet++ Text Detection: Detects irregular, rotated, and curved text lines across dense historical pages.
- SVTR_LCNet Text Recognition: High-accuracy multilingual character recognition supporting Latin, Hangul, CJK characters, Arabic, Cyrillic, and Devanagari.
- Spatial Bounding Box Reconstruction: Extracted lines preserve layout geometry on the left page while feeding clean strings to the bilingual translation engine on the right page.
🎧 Kokoro ONNX & Windows SMTC Audio Controls
For long-form book listening, Emebala Reader embeds state-of-the-art neural audio synthesis (native/emebala-ai/src/tts/):
- Kokoro-82M ONNX TTS (
kokoro.rs): Ultra-natural expressive voice generation running locally on ONNX Runtime with low memory overhead. - Supertonic TTS (
supertonic.rs): High-throughput streaming voice synthesis for rapid passage audition. - Windows System Media Transport Controls (SMTC): Native Windows OS integration (
audio_service_win). Control book playback, volume, pause/resume, and chapter skipping using physical keyboard media keys and the Windows lock screen media overlay.
🌐 Hy-MT2 33 World Languages Specification
The core translation engine supports 33 World Languages (1,056 bidirectional translation pairs) organized across five major geographical and linguistic families:
| # | Language Family | Language Name | ISO 639-1 | Native Script | Local Execution Status |
|---|---|---|---|---|---|
| 1 | East Asian | Korean (한국어) | ko | Hangul | Active Production |
| 2 | East Asian | Japanese (日本語) | ja | Kanji / Kana | Active Production |
| 3 | East Asian | Chinese Simplified (简体中文) | zh-CN | Simplified Hanzi | Active Production |
| 4 | East Asian | Chinese Traditional (繁體中文) | zh-TW | Traditional Hanzi | Active Production |
| 5 | European | English | en | Latin | Active Production |
| 6 | European | German (Deutsch) | de | Latin | Active Production |
| 7 | European | French (Français) | fr | Latin | Active Production |
| 8 | European | Spanish (Español) | es | Latin | Active Production |
| 9 | European | Portuguese (Português) | pt | Latin | Active Production |
| 10 | European | Italian (Italiano) | it | Latin | Active Production |
| 11 | European | Dutch (Nederlands) | nl | Latin | Active Production |
| 12 | European | Russian (Русский) | ru | Cyrillic | Active Production |
| 13 | European | Ukrainian (Українська) | uk | Cyrillic | Active Production |
| 14 | European | Polish (Polski) | pl | Latin | Active Production |
| 15 | European | Czech (Čeština) | cs | Latin | Active Production |
| 16 | Middle Eastern | Arabic (العربية) | ar | Arabic (RTL) | Active Production |
| 17 | Middle Eastern | Hebrew (עברית) | he | Hebrew (RTL) | Active Production |
| 18 | Middle Eastern | Persian / Farsi (فارسی) | fa | Perso-Arabic (RTL) | Active Production |
| 19 | Middle Eastern | Turkish (Türkçe) | tr | Latin | Active Production |
| 20 | South Asian / Indic | Hindi (हिन्दी) | hi | Devanagari | Active Production |
| 21 | South Asian / Indic | Bengali (বাংলা) | bn | Bengali | Active Production |
| 22 | South Asian / Indic | Urdu (اردو) | ur | Nastaliq (RTL) | Active Production |
| 23 | South Asian / Indic | Telugu (తెలుగు) | te | Telugu | Active Production |
| 24 | South Asian / Indic | Tamil (தமிழ்) | ta | Tamil | Active Production |
| 25 | South Asian / Indic | Marathi (मराठी) | mr | Devanagari | Active Production |
| 26 | South Asian / Indic | Gujarati (ગુજરાતી) | gu | Gujarati | Active Production |
| 27 | Southeast Asian | Vietnamese (Tiếng Việt) | vi | Latin (Quốc ngữ) | Active Production |
| 28 | Southeast Asian | Thai (ไทย) | th | Thai | Active Production |
| 29 | Southeast Asian | Indonesian (Bahasa Indonesia) | id | Latin | Active Production |
| 30 | Southeast Asian | Malay (Bahasa Melayu) | ms | Latin | Active Production |
| 31 | Southeast Asian | Tagalog / Filipino | tl | Latin | Active Production |
| 32 | Southeast Asian | Khmer (ភាសាខ្មែរ) | km | Khmer | Active Production |
| 33 | Southeast Asian | Burmese (မြန်မာစာ) | my | Myanmar | Active Production |
🏔️ 5 Regional Dialects & Indigenous Heritages
Beyond the 33 major world languages, Emebala safeguards 5 regional dialects and indigenous tongues often neglected by commercial translation cloud providers:
| Dialect / Indigenous Heritage | ISO 639 | Cultural Geography | Engine Specialization |
|---|---|---|---|
| Cantonese (粵語 / 廣東話) | yue |
Hong Kong, Macau, Guangdong, Diaspora | Preserves colloquial Cantonese characters, particles & Jyutping syntax |
| Tibetan (བོད་སྐད།) | bo |
Tibetan Plateau, Himalayan Regions | Syllabic tsheg delimiter parsing, Buddhist canon terminology |
| Uyghur (ئۇيغۇرچە) | ug |
Central Asia, Xinjiang Basin | Perso-Arabic RTL, vowel harmony adaptation, classical Chagatai roots |
| Mongolian (Монгол хэл / ᠮᠣᠩᠭᠣᠯ) | mn |
Mongolia, Inner Mongolia | Dual mapping for Traditional Vertical Script and Modern Cyrillic |
| Kazakh (Қазақ тілі / Qazaqşa) | kk |
Kazakhstan, Central Asian Steppe | Support across Cyrillic, Latin reforms, and Arabic (Tote Jazu) scripts |
⚡ Dual Inference Architecture (llama.cpp & CTranslate2)
Emebala tailors its neural execution layer to the operational demands of each application:
Emebala Chat embeds llama.cpp directly via CMake FetchContent. It executes quantized GGUF weights (models/Hy-MT2-1.8B-Q8_0.gguf) with hardware acceleration:
- Zero Dynamic Allocations during Translation: The context and KV cache are pinned in memory for instantaneous keystroke response (~40ms).
- WinHTTP Cloud Fallback Client (
src/google_translate.cpp): Whencloud_fallback_enabled: trueis explicitly configured by the user, Chat includes a native WinHTTP client for fallback translation. Whenfalse(default), zero external traffic is ever permitted.
In native/emebala-ai/src/translation/, Emebala Reader implements two modular backends:
HyMt2Backend(hymt2.rs): Powered byllama-cpp-2for Hy-MT2 1.8B and 7B GGUF models.Ct2Backend(ct2.rs): Powered byCTranslate2for rapid concurrent batch translation across multi-paragraph book chapters.
🛡️ AES-256-GCM Vault & Memory Security
In native/emebala-crypto/src/, Emebala implements enterprise-grade cryptographic sovereignty:
- AES-256-GCM Authenticated Encryption: Reading logs, bookmarks, and confidential notes are encrypted with 256-bit Galois/Counter Mode to guarantee confidentiality and data integrity.
- Argon2id Key Derivation: Master passphrases are stretched using memory-hard Argon2id parameters to resist GPU/ASIC brute-force attacks.
- Memory Scrubbing on Drop (
zeroize): Sensitive encryption keys and decrypted text chunks are wrapped inzeroize::ZeroizeOnDropcontainers, guaranteeing memory pages are scrubbed immediately upon release. - Windows DPAPI & Credential Manager: Encryption seeds on Windows are guarded by DPAPI, binding keys to the user's hardware TPM.
🔎 SQLite with FTS5 Trigram Full-Text Search
In native/emebala-db/src/, book contents, bilingual sentence alignments, and reading notes are indexed locally using SQLite FTS5 with trigram tokenizers:
- Sub-String & CJK Search: Trigram indexing enables instant search across Korean, Japanese, and Chinese texts without requiring complex word-break dictionaries.
- Cross-Language Querying: Search source and translated texts simultaneously across thousand-page books in milliseconds.
🕊️ Zero-Telemetry Verification Protocol
Verify Emebala's zero-cloud guarantee using your preferred network monitoring tool (Wireshark, Fiddler, or Windows Resource Monitor):
Get-NetTCPConnection | Where-Object { (Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName -like "*Emebala*" }
The output is completely empty. No outbound socket connects, no telemetry pings, and no background analytics ever leave your device.
⌨️ Global Hotkeys & Keyboard Shortcuts Matrix
The definitive shortcuts verified directly against Emebalachat/src/hook.hpp and src/config.hpp:
| Target Action | Trigger Key / Gesture | Code Reference | Behavior Details |
|---|---|---|---|
| In-Place Send & Replace | Enter | EnterSendReplaceAllowed |
Translates typed input buffer in any chatbox and replaces it in-place. |
| Pass-Through Newline | Shift + Enter | !shift predicate |
Inserts multiline carriage return without triggering translation. |
| Toggle Active / Paused | F9 | hotkey_toggle |
Toggles translation between active (green) and paused (grey) state. |
| Cycle Target Language | Ctrl + F9 | hotkey_lang |
Advances target language forward through the 33 supported world languages. |
| Toggle Auto-Send Mode | Ctrl + Shift + Enter | hotkey_mode |
Toggles whether translated text is automatically submitted on Enter. |
| Drag-to-Translate Tooltip | Double Ctrl + C | "double_ctrl_c" |
Pressing Ctrl+C twice quickly summons translation tooltip at cursor. |
| Badge Toggle State | Left-Click Badge | badge.cpp |
Single click on floating Direct2D pill toggles pause/active. |
| Badge Swap Languages | Double-Click Badge | badge.cpp |
Double click on floating Direct2D pill flips source and target language. |
| Badge Reposition | Drag Badge | badge.cpp |
Click and drag floating pill to any monitor; coordinates persist in config. |
| Reader Page Turn | Space / → | emebala-reader |
Advances to next synchronized bilingual spread. |
| Reader Prev Page | Shift + Space / ← | emebala-reader |
Returns to previous synchronized bilingual spread. |
| Reader Cycle Theme | Ctrl + T | emebala-reader |
Cycles cultural themes: Mesopotamian Clay > Porcelain > Hanji. |
🔧 Portable config.json Schema
In Emebala Chat (Emebalachat/src/config.cpp#L477-483), configuration is stored directly beside the executable as GetExecutableDir() / "config.json". Below is the exact 18-key flat schema from code:
{
"ui_language": "auto",
"engine_type": "auto",
"model_path": "models/Hy-MT2-1.8B-Q8_0.gguf",
"source_language": "Auto Detect",
"target_language": "English",
"auto_send": false,
"sound_enabled": true,
"drag_to_translate": true,
"cloud_fallback_enabled": false,
"drag_hotkey": "double_ctrl_c",
"hotkey_toggle": "F9",
"hotkey_lang": "Ctrl+F9",
"hotkey_mode": "Ctrl+Shift+Enter",
"temperature": 0.7,
"top_p": 0.6,
"top_k": 20,
"repetition_penalty": 1.05,
"badge_x": -1,
"badge_y": -1
}
cloud_fallback_enabled Privacy Gate: Defaults to false. When false, your text is strictly kept on local silicon and never dispatched to any external HTTP fallback under any condition.
❓ Troubleshooting & Frequently Asked Questions
Windows User Interface Privilege Isolation (UIPI) restricts standard user applications from sending synthetic keyboard events to elevated processes. If you wish to translate inside elevated terminals, run Emebala Chat as Administrator.
Navigate to Windows Settings > Time & Language > Speech > Manage Voices > Add voices. Install your preferred language pack. Emebala Chat's COM enumerator detects new voices immediately without requiring a restart.
Because Emebala Chat is fully portable, simply exit the application via system tray and delete its folder. There are no leftover background registry keys or background services.