Drop Locale

Qt Linguist .ts translator that runs in your browser

Drop a Qt Linguist .ts file in below, pick a target language, download the translated file. The .ts file stays on your device.

Loading translator...

How it works

Drop a .ts file on the page, click to choose one, or paste the contents straight in. The parser reads the file in your browser and lists every message that still needs a translation, grouped by Qt context. Pick a target language and translation starts immediately. The translated file is reassembled from the same parsed tree so every comment, location reference, obsolete entry, and unrelated attribute survives the round trip.

Quality Warning

Please don’t rely on the quality of these translations to ship a finalized product. This is just a starting point. It’s machine translation and there are no guarantees about its quality.

What we do not do

The file itself never leaves your device. We do not see what you are translating, we do not store any of the strings, and there is nothing about your file in our logs. The privacy wedge in DropFormat is structural: the .ts parser, the Google Translate caller, and the file writer all run inside your browser tab.

What does leave your device: the individual strings go to translate.googleapis.com the same way they would if you pasted them into translate.google.com yourself. We are not in the middle. If your .ts file contains internal product strings you do not want a third party to see, do not translate it here; use an offline tool.

What it supports

Qt Linguist 1.x and 2.x. The parser is hand-written for the Qt Linguist subset, so it is tolerant of common real-world variations: BOM-prefixed files, Windows line endings, mixed quote styles on attributes, CDATA sections, the standard <!DOCTYPE TS> declaration that lupdate writes on every save (stripped automatically), and missing version attributes on older files.

Context grouping. A Qt .ts file groups messages by <context> (usually the C++ class name the string came from). The translator preserves that grouping. Each <message> is one translatable entry, keyed by its context, source text, and disambiguation comment so two messages with the same source in the same context stay distinct in the review pane.

Numerus plural messages. Messages tagged numerus="yes" wrap their translation in multiple <numerusform> elements, one per plural slot the target language requires. The translator generates the right number of forms based on the target language plural rules (one form for Japanese and Korean, two for French and German, three or more for Slavic languages and Arabic).

Disambiguation comments. Qt’s tr() function takes an optional second argument that disambiguates two identical source strings used in different places (an “Open” menu item vs. an “Open” button label). DropFormat treats those <comment> elements as part of the entry identity so each goes to translation separately, and both round-trip back into the file with the same disambiguation attached.

Obsolete and vanished states round-trip untouched. Entries marked type="obsolete" (Qt 4 era) or type="vanished" (Qt 5+) stay in the file with their old translation intact. lupdate sometimes resurrects strings that were temporarily removed and re-removes them; keeping the old translation means recovering the original wording when that happens. DropFormat does not retranslate these.

type=”unfinished” is treated as fuzzy. Linguist marks every freshly-extracted message as type="unfinished". The translator runs them all and removes the type="unfinished" attribute when it writes the new <translation> text. Existing translations (without the unfinished marker) are also retranslated so the file targets the language you picked, not whatever language the file was last targeting.

The <TS language=”…”> attribute is rewritten. Qt .ts files declare their target language at the root (<TS language="de_DE">). On download, that attribute is rewritten to the language you picked so Qt Linguist and lrelease both see the right target. The sourcelanguage attribute is left alone.

Notes from <extracomment> (developer-supplied translator hints from C++ source comments) and <translatorcomment> (translator-supplied notes) are shown in the review pane as context. <location> elements, custom attributes, and unknown sibling elements round-trip unchanged.

Not yet: inline-element-aware handling of Qt’s HTML-like markup inside source text (placeholders pass through to the translator as part of the source text), validation of the target-language code against Qt’s enum, and lrelease compilation to .qm binary (Linguist itself does this; the .ts file you download here drops straight into Qt Linguist).

What we tolerate, and what we reject

Some malformed files we repair on the way in. Others we refuse to load so we do not make things worse. This list is the parser’s actual behaviour, generated from the format module itself, not aspirational copy.

Repaired automatically:

  • UTF-8 byte order mark (BOM) at the start of the file
  • Windows (CRLF) or mixed line endings
  • Leading blank lines before the XML declaration
  • Standard <!DOCTYPE TS> declaration (we strip it before parsing)
  • Indented or whitespace-heavy XML formatting
  • XML comments anywhere in the document

Refused with an explanation:

  • Empty or whitespace-only file. Add at least one <context> with <message><source> and re-upload.
  • Custom DOCTYPE or DTD declaration present. Remove the <!DOCTYPE …> line (we accept only the standard Qt .ts shape) and re-upload.
  • XML syntax error or truncated document. Fix the XML so it parses, then re-upload.
  • No translatable <message> entries with non-empty <source>. Confirm at least one <message> has a non-empty <source>.
  • Non-UTF-8 encoding declared. Re-save the file as UTF-8 and re-upload.
  • Looks like a different format (PO, XLIFF, TypeScript source). Use the /translate/ hub to pick the right translator. (TypeScript .ts source files are not Qt Linguist files.)
  • Unsupported Qt .ts version attribute. Re-export with lupdate from a recent Qt version.

Common questions

What is a Qt .ts file? Qt Linguist is the translation toolchain for Qt applications (desktop, embedded, mobile). The lupdate tool scans Qt C++ source for tr() calls and produces a .ts file with every string that needs translating. Translators fill in the <translation> slots in Qt Linguist, then lrelease compiles the result to a binary .qm file the application loads at runtime.

This .ts extension overlaps with TypeScript. Did I land here by mistake? Maybe. DropFormat does not translate TypeScript source files. If you dropped a TypeScript file expecting localization output, you are at the wrong page; DropFormat’s translator hub is for translation files (PO, XLIFF, Qt .ts, TMX, etc.), not application source code. If you meant to translate Qt UI strings, run lupdate first to extract them into a .ts file, then drop that here.

Why does the file declare a target language when I am being asked to pick one? Qt .ts files are per-target-language: one .ts file targets one language. The file you dropped already says what language it was made for; the picker is in case you want to retarget it (translate an existing German file to French, for instance). DropFormat overwrites the language attribute on download to match what you picked.

What happens to existing translations in the file? They show up in the review pane as the pre-filled translation. The translator still re-runs every entry against the chosen target language because there is no reliable way to know what language the existing strings are in; on download, the new translation replaces the old one. If you want to keep existing translations untouched, edit them in the review pane before downloading.

Why is the translation in some cases worse than the Google Translate website? The free endpoint we use is the same one the Google Translate website uses, but the API does not always know about the context the website’s interface provides. For names, branded terms, or jargon, expect to override in the review pane.

What if I am translating something Google’s endpoint will not accept? The free endpoint occasionally returns the source unchanged for content it would rather not translate. Those entries show “kept original” in the review pane so you can hand-translate just those.

Does it cache anything? No. Each run starts fresh.

How are plurals handled? Qt’s plural system uses numerus="yes" on a <message> and one <numerusform> per plural slot. The number of forms depends on the target language: Japanese and Korean need one, French and German two, Russian and Polish three, Arabic six. The translator generates the right number of forms for whichever language you pick.

What about PO, XLIFF, TMX, ARB, .xcstrings, .properties, JSON, .strings, Fluent? Each has its own translator at /translate/po/, /translate/xliff/, /translate/xliff2/, /translate/tmx/, /translate/arb/, /translate/xcstrings/, /translate/properties/, /translate/json/, /translate/strings/, and /translate/fluent/. Drop your file at the page that matches it.

Why this exists

Qt Linguist has a built-in machine-translation plugin path, but configuring it usually means pasting a paid API key into the Linguist preferences and trusting the plugin to send your strings to whoever the key belongs to. DropFormat sits in between: free, browser-based, no upload, designed for the “lupdate just made me a fresh .ts; give me a first-pass target draft I can open in Linguist and clean up” workflow.

What is Qt Linguist?

Qt Linguist is the GUI translation editor that ships with the Qt application framework. Qt applications mark translatable strings in C++ source with tr("...") or QObject::tr("..."), and the lupdate command-line tool scans the source tree to extract those strings into a .ts file, one per target language. Translators open the .ts file in Linguist, fill in or refine each translation, save the file, and run lrelease to compile it down to a compact binary .qm file the running application loads via QTranslator. The .ts format is XML; the .qm format is a serialized hash table. DropFormat operates on the .ts source-of-truth file, the same one Linguist itself reads and writes.