Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. translate
    Log in to post

    • SOLVED Cannot Translate QT Quick Properties Dynamically
      QML and Qt Quick • qml qtquick translate qtquick 1.0 international • • closx  

      13
      0
      Votes
      13
      Posts
      947
      Views

      @KroMignon Hey! I forgot to answer to you! Did not meant to be rude and sorry for that :( Conclusion: I gave some tries with your suggest and lots of other stuff on internet, but failed :D So I have created a "Restart the system to apply all the language changes" screen and a "restart/cancel" choice on a language change state. I guess it will be okay even if it wont be "real-time" :P Good Work!
    • SOLVED Cannot Translate ListElement "name" Variables
      QML and Qt Quick • qml qtquick translation translate qtquick 1.0 • • closx  

      3
      0
      Votes
      3
      Posts
      330
      Views

      @KroMignon LOVE YOU! Thank you very much, worked w/out problems, and made me understand my mistake. note: Needed to update .ts file and release .qm file after changing code.
    • UNSOLVED Lupdate and macros
      General and Desktop • translate lupdate macros • • sailor.steve  

      3
      0
      Votes
      3
      Posts
      694
      Views

      @sailor.steve said in Lupdate and macros: I wrapped the text in macros that need to be translated In addition to @sierdzio response, please keep in mind that Qt translation tools use the "original" text as the key for looking the proper translation in the available loaded Qt translator object, and if such string is not found, that same string is displayed instead. This is a little bit different from some other translation tools that use "constants" (i.e. macro?) as the key and then you provide a file with constant -> translation pairs.
    • SOLVED QT_TRANSLATE_NOOP inside static const QMap?
      General and Desktop • i18n translate translator international • • Opa114  

      11
      0
      Votes
      11
      Posts
      4464
      Views

      @mrjj okay - thanks for help!
    • UNSOLVED How to translate text dynamically...?
      Mobile and Embedded • qt 5.5.0 translate qt 4.7.4 • • Rohith  

      9
      0
      Votes
      9
      Posts
      2696
      Views

      @Rohith I don't know. Use Google Search to find it out!
    • SOLVED Using Qt translated texts causes adding them to app ts
      General and Desktop • translations translate lupdate • • SeeLook  

      3
      0
      Votes
      3
      Posts
      1188
      Views

      Another solution that not require hacking Qt is to alias QApplication::translate method: inline QString myTr(const char* context, const char* key, const char* disambiguation = 0, int n = -1) { return QApplication::translate(context, key, disambiguation, n); } and then get translated text with: myTr("QShortcut", "Help"); Such texts are invisible for lupdate.
    • need help to translate python script to Qt quick qml code
      QML and Qt Quick • qml python qt quick translate • • antemort  

      2
      0
      Votes
      2
      Posts
      912
      Views

      Hi @antemort, It can't be done purely in QML. You will need to use sockets on C++ side. Qt has C++ API's for sockets. QTcpServer creates a server and QTcpSocket for client. After that you will need to expose them to QML. Edit: Some one has tried to do that already. See https://github.com/jemc/qml-sockets
    • Dynamic translation of strings in widgets
      General and Desktop • qtcreator dynamic translate • • GregWilsonLindberg  

      10
      0
      Votes
      10
      Posts
      5658
      Views

      Below is an answer. void MyWidget::changeEvent(QEvent *event) { if (e->type() == QEvent::LanguageChange) { titleLabel->setText(tr("Document Title")); ... okPushButton->setText(tr("&OK")); } else QWidget::changeEvent(event); } code within if (e->type() == QEvent::LanguageChange) { ... ) should contain ALL the code which has to be called when language changed. Basically every line of the code with tr() has to be called there. In there you can put call to retranslateUi, but retranslateUi is just a function where QtDesigner put strings created in there. this might be or might not be sufficient for your widget. Finally there are people who do not use designer. That is why you could not find retranslateUi mentioned anywhere. Keyword is tr(). For example you may fill tree widget outside of designer. If you used text which has to be internationalized there, you need to make sure the same code is executed as a reaction on language changed. Common logic suggests to put all code which requires initialization in a single function or slot. Such function or slot should be called when QEvent::LanguageChange arrives. Call this function myRetranslateUi if you want. You do not have to subclass every widget (as suggested by example) though. Alternative is to install event filter.
    • How to extract text, translate, and display
      Mobile and Embedded • android http qnetwork translate • • jjoejimmy  

      1
      0
      Votes
      1
      Posts
      540
      Views

      No one has replied