Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED]Qt Linguist easy?

[SOLVED]Qt Linguist easy?

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toho71
    wrote on last edited by
    #1

    When I have made my forms and buttons etc etc with the Creator IDE and have the optional Translatable = true.

    I think that I don't need to do like this myButton(tr(caption)) but when I have done the lUpdate with my translate files and
    my main looks like this

    @ QString locale = QLocale::system().name();

    QTranslator translator;
    //translator.load(QString("magic2_") + locale + (".ts"));
    translator.load(QString("magic2_sv.ts"));
    
    app.installTranslator(&translator);
    

    @

    Nothing happens.
    Is there something I have missed.
    I know that the file exists because I have translate the captions in the Qt Linguist tool.

    In the tr-file it looks like this

    @<message>
    <location filename="start.ui" line="1822"/>
    <source>Mains - Limits</source>
    <translation type="unfinished">Nät - Gränsvärden</translation>
    </message>
    @

    pls help

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You application should load QM files, not TS files. Run lrelease tool, or in Qt Linguist, select File -> Release. Then, load resulting QM file in your app.

      (Z(:^

      1 Reply Last reply
      0
      • T Offline
        T Offline
        toho71
        wrote on last edited by
        #3

        Thank you very much.
        This worked perfect when I used the qm file.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved