1. Help Center
  2. Supported formats

Qt Translation Source

What Qt Translation Source really is and what needs to be done when preparing it for localization.

File Extensions .ts
API Extension ts
Import Yes
Export Yes
Pluralization supported? No
Descriptions supported? No


Qt Translation Source has a “.ts” file extension. It is an XML-based standard localization file format for QT applications. Translations are typically placed in the <translation> tag. Each <translation> tag may have different type properties including “unfinished”, “vanished”, “obsolete”, etc.  Please always make sure to add “type=’unfinished’” to tags where you would want the strings to be translated. 

Code Sample

<?xml version="1.0" encoding="UTF-8"?>
<TS version="2.0" language="en-GB">
  <context>
    <message>
      <source>boolean_key</source>
      <translation>--- true
</translation>
    </message>
    <message>
      <source>empty_string_translation</source>
      <translation/>
    </message>
    <message>
      <source>key_with_description</source>
      <translation>This key has a description! (At least in some formats)</translation>
    </message>
    <message>
      <source>key_with_line-break</source>
      <translation>This translations contains
a line-break.</translation>
    </message>
    <message>
      <source>nested.deeply.key</source>
      <translation>I'm a deeply nested key.</translation>
    </message>
    <message>
      <source>nested.key</source>
      <translation>See, this key is nested inside a namespace.</translation>
    </message>
    <message>
      <source>null_translation</source>
      <translation/>
    </message>
    <message numerus="yes">
      <source>pluralized_key</source>
      <translation>
        <numerusform>Only one pluralization found.</numerusform>
        <numerusform>Hey, you have %s pluralizations!</numerusform>
        <numerusform>You have no pluralization.</numerusform>
      </translation>
    </message>
    <message>
      <source>sample_collection</source>
      <translation>---
- first item
- second item
- third item
</translation>
    </message>
    <message>
      <source>simple_key</source>
      <translation>Simple key, simple message, so simple.</translation>
    </message>
    <message>
      <source>unverified_key</source>
      <translation>This translation is not yet verified and waits for it. (In some formats we also export this status)</translation>
    </message>
  </context>
</TS>