QT TS

  • File extension: *.ts
  • Localization type: “qtts”
  • Pluralization: yes
  • Description: yes
  • Translations Upload: yes
  • Custom Attributes: yes

File Sample

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en" sourcelanguage="en">
<context>
  <name>Page</name>
  <message>
    <source>Text for translation</source>
    <comment>commenting</comment>
    <translation type="obsolete">translated string</translation>
  </message>
  <message>
     <source>Text for translation #2</source>
     <extracomment>some text</extracomment>
    <translation>some translation</translation>
  </message>
</context>
<context>
  <name>installscript</name>
  <message>
    <source>Text for translation #3</source>
    <oldcomment>some new comments here</oldcomment>
    <translation>some new translation here</translation>
  </message>
</context>
<context>
    <name>apple_count</name>
    <message numerus="yes">
      <source>%s apple(s)</source>
      <translation>
        <numerusform>%s Apfel</numerusform>
        <numerusform>%s Äpfel</numerusform>
      </translation>
    </message>
  </context>
</TS>

Attributes

Import as a hidden string:

<message>
  <source>String for translation</source>
  <translation type="obsolete">translated string</translation>
</message>
<message>
  <source>String for translation</source>
  <translation type="unfinished">translated string</translation>
</message>

Plurals

<context>
    <name>apple_count</name>
    <message numerus="yes">
      <source>%s apple(s)</source>
      <translation>
        <numerusform>%s Apfel</numerusform>
        <numerusform>%s Äpfel</numerusform>
      </translation>
    </message>
  </context>

Custom Attributes

Source text will be taken from the <translation> node:

<TS x-crowdin-source-element="translation">

Comments

Comment to the string can be indicated by the following: <comment>, <extracomment>, <oldcomment>

<message>
  <source>Text for translation</source>
  <comment>commenting</comment>
  <translation>translation</translation>
</message>

See Also

Was this article helpful?