Software Overview#
This project is a frontend-first translation system designed for Qt Linguist .ts workflows. It integrates Large Language Models (LLMs) while keeping the format safe, the process controllable, and the output reliably compatible with the original project.
It supports two translation approaches:
Online GPT API
Translate directly in the browser via an OpenAI-compatible API.Local LLM
Generate an executable Jupyter Notebook and run translation offline on the user’s machine (CPU / GPU).
Both approaches provide glossary guidance, format + placeholder protection, batch processing with progress tracking, and a live source/translation comparison to help convert strings in projects like QGIS into Traditional Chinese.
Which option should I choose?#
Option |
How it works |
Best for |
Highlights & limits |
|---|---|---|---|
Online GPT API |
Calls your configured API in the browser |
Quick setup, translate directly on the web |
Built-in progress + comparison table, one-click |
Local LLM |
Generates a configurable |
Offline use, your own GPU, testing open models |
Highly customizable, but you must set up the environment |
Quick Start#
A. Online GPT API (recommended to try first)#
Open the ChatGPT API Translation page (
app_api).Set API Key, Base URL, and Model.
Upload the
.tsfile to translate.(Optional) Upload a Glossary (
CSV / ODS, columns:en, zhorEnglish Term, Chinese Term).Set Batch and the maximum number of entries for a small test run.
Run translation and review the live source/translation table and progress.
After verifying format safety, download
qgis_zh-Hant.ts.
B. Local LLM (offline)#
Open the Local LLM page (
app_local).Configure model settings, batch size, token limits, glossary path, etc.
Download the generated
.ipynb.Install dependencies and run the notebook in your local Jupyter environment.
Core Features#
Translation & terminology consistency#
Batch-based translation to keep input/output aligned.
Glossary + LCS matching to detect key terms in the source text and nudge the model to use fixed translations
(e.g.,raster → 網格) to reduce terminology drift.
Format & structure protection#
Automatically protects and restores:
HTML tags and entities
Placeholders (
%n,%1,{0}, etc.)Original
.tsstructure andDOCTYPE
Correct handling for
numerus="yes"and<numerusform>output.
Batch processing & review#
Configure batch size and an entry limit.
Live progress bar and source/translation comparison table for quick spot checks.
Export & integration#
Exports
.tsvia browser download (no backend server required).Works with
.qmcompilation and later merge/version workflows.
Pre-export validation (what the system guarantees)#
Before exporting the .ts file, the system checks:
XML is parseable
<numerusform>entries are complete fornumerus="yes"Placeholders are not missing or mismatched in count
HTML tags are not broken or unclosed
If validation fails, that entry will not be written back, preventing broken .ts outputs.
Note
This project runs in the browser via Pyodide and does not require a server or a local Python runtime.