Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. translation

    Log in to post
    • All categories
    • O

      Unsolved How should I organise translations of plugins?
      General and Desktop • plugin translation • • odelaune

      4
      0
      Votes
      4
      Posts
      24
      Views

      O

      Ok, here is my progress. Here the CMakeLists.txt of my plugin

      set(TS_FILES i18n/MyPlugin_en.ts i18n/MyPlugin_fr.ts ) # Adding translations qt_add_translations(MyPlugin TS_FILES ${TS_FILES} LUPDATE_OPTIONS -no-obsolete OUTPUT QM_FILES) install(FILES ${qm_files} DESTINATION ${CMAKE_INSTALL_BINDIR})

      Initially the MyPlugin_*.ts files are empty, so I need to go to the i18n folder and to run lupdate there. Then I translate strings.

      Finally, I compile. There is no error but the strings of MyPlugin are not translated.

      Any idea about what is missing?

    • L

      Unsolved How use translation files of another project?
      General and Desktop • translation • • leonardo M B

      3
      0
      Votes
      3
      Posts
      46
      Views

      S

      A QTranslator handles translations from a single translation file. After that the QTranslator is installed for the application. If you have multiple QTranslators installed translations will be looked up from newest to oldest.

    • S

      Unsolved Empty .ts files after lupdate (CMake and macOS 6.3.2)
      General and Desktop • lupdate translation • • Sikarjan 0

      4
      0
      Votes
      4
      Posts
      227
      Views

      S

      I just redid the project with qmake an here everything works out of the box. Also adding an icon, which I was not able to do with the official documentation.

      So I expect there is something wrong with the creation process of CMakeListe.txt?

    • R

      Solved How to add dynamic UI translation using QM files?
      General and Desktop • translation runtime dynamic loading • • Red Baron

      9
      0
      Votes
      9
      Posts
      752
      Views

      R

      Ok, so I removed all the tr() entries from my code and things are working. I guess the UI form file was the key to solving the issue. Thanks for the help, guys!

    • G

      Solved How to create translation files (.ts) in our project from lupdate command?
      Qt 6 • qt creator qt6 translation lupdat • • gouneken

      4
      0
      Votes
      4
      Posts
      1737
      Views

      G

      @J-Hilk Thanks, even though that was not the answer I expected, you showed me a shortcut that saves me from using the command line. It will save me time. Have a nice day!

    • D

      Solved What was changed with QObject::tr(key) in QT6?
      Qt 6 • translation • • Dmitriano

      3
      0
      Votes
      3
      Posts
      155
      Views

      D

      @Christian-Ehrlicher Yes, nothing changes, but I moved my class to a namespace.

    • D

      Solved How to translate Dialog's standard buttons?
      QML and Qt Quick • translation • • Dmitriano

      3
      0
      Votes
      3
      Posts
      223
      Views

      D

      @Dmitriano Figured this out!

      I add qt-everywhere-src-6.2.2\qttranslations\translations\qtbase_ru.ts to the project and load qtbase_ru.qm with the Translator in C++ code.

    • jeanmilost

      Solved Is there a way to load the .ts files directly with QTranslator, without compiling them to .qm?
      QML and Qt Quick • translator translation file qml • • jeanmilost

      4
      0
      Votes
      4
      Posts
      486
      Views

      M

      I think you can bundle lupdate in your application and create qm file on the fly.

      P.S. : TS files are just xml files, so you can change them in your own application, via user feedback or something else

    • C

      Solved Cannot Translate ListElement "name" Variables
      QML and Qt Quick • qml qtquick qtquick 1.0 translate translation • • closx

      3
      0
      Votes
      3
      Posts
      414
      Views

      C

      @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.

    • Marco Pellin

      Solved Runtime translation / i18n - QML C++ engine
      QML and Qt Quick • i18n translation qml c++ engine nested languagechange • • Marco Pellin

      2
      0
      Votes
      2
      Posts
      1578
      Views

      Marco Pellin

      In the end everything was fine with the example above.
      I just had to update and release my translation files, because in the meantime I changed the name of a .qml file, and the filename is directly linked into the .ts files created by linguist and used by Qt.
      I feel a bit ashamed but yes, it was really trivial and kinda stupid :)

    • Zoltan

      Solved Translation does not work when the text of QLineEdit is modified
      General and Desktop • translation • • Zoltan

      13
      0
      Votes
      13
      Posts
      3104
      Views

      ?

      @Zoltan I have the same problem, must I do?

    • S

      Solved Limit paint area
      General and Desktop • qpaint translation viewport • • Suths

      5
      0
      Votes
      5
      Posts
      1655
      Views

      S

      Thanks for the advice mrjj. I used the translate functions and the save and restore to ensure that each section has a logical coordinate system that makes sense to it.

    • E

      Unsolved Translations from SQL DB string?
      General and Desktop • sql i18n qml translation • • EStudley

      2
      0
      Votes
      2
      Posts
      984
      Views

      SGaist

      Hi,

      You should rather store the original error message in the database and to the translation when showing the database content.

    • Gazzer

      Unsolved QLinguist and Chinese
      Mobile and Embedded • chinese translation static text embedded linux • • Gazzer

      12
      0
      Votes
      12
      Posts
      6668
      Views

      joveresch

      I am having this exact problem. I compiled my project for an embedded arm device, linux desktop, and windows desktop. The windows and linux hosts display the characters correctly, where the embedded device just shows nothing.

      I'm using the Noto fonts https://www.google.com/get/noto/#sans-hans and am positive it is being used on the linux desktop, since if I don't copy the font into the same directory as the application, it just shows blocks. When the font is in the directory, it shows everything properly.

      I tried the same thing with the embedded build, and nothing shows up. The font being loaded, since if it's not in the directory, it complains that it can't load it. Is there some extra switch or rendering tool/application that embedded linux needs? I've tried with both 'linuxfb' and 'egl' platforms with no success.

      Thanks in advance for any help.

    • A

      Solved Translation at runtime (dynamic translation)
      General and Desktop • translation • • AlaaM

      4
      0
      Votes
      4
      Posts
      1705
      Views

      mrjj

      @AlaaM ยจ
      Hi I think you can have multiple translators(file) active, so when you switch language
      its best to remove old one or it might get messy as the old one would also be searched.
      But if completely different language, i doubt anything crazy will happen.

      http://www.informit.com/articles/article.aspx?p=1405555&seqNum=3

    • CharlieG

      Solved Translation with mobile application
      Mobile and Embedded • translation android mobile • • CharlieG

      4
      0
      Votes
      4
      Posts
      1225
      Views

      SGaist

      Don't worry, that kind of things happens frequently ;)

      You're welcome !

      Since you have it working now, please mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)

    • R

      Translation of QDialogButtonBox in statically build app
      General and Desktop • qt5 translation static build • • Radim

      6
      0
      Votes
      6
      Posts
      2172
      Views

      R

      Finally I'm able to automatically copy the qt translation files and create resource file from the pro file:

      TRANSLATIONS = myapp_cs.ts \ myapp_xx.ts QT_TRANSLATIONS = qtbase_cs.qm #------------------------------------------------- # create lang folder QM_DIR = $$shadowed($${PWD})/lang mkpath($${QM_DIR}) mkpath($${QM_DIR}/lang) #------------------------------------------------- # copy system translation files to lang folder for(FILE,QT_TRANSLATIONS){ FILE = $$shell_path($$[QT_INSTALL_TRANSLATIONS]/$${FILE}) system($${QMAKE_COPY} $${FILE} $$shell_path($${QM_DIR}/lang)) } #------------------------------------------------- #generate qm files directly from qmake for(FILE,TRANSLATIONS){ QM_FILE = $$shell_path($${QM_DIR}/lang/$$replace(FILE,.ts,.qm)) system(lrelease $${FILE} -qm $${QM_FILE}) } #------------------------------------------------- #create resource file with translations win32:system(cd $$shell_path($${QM_DIR}) & rcc --project -o lang.qrc) unix:system(cd $$shell_path($${QM_DIR}) ; rcc --project -o lang.qrc) RESOURCES += $${QM_DIR}/lang.qrc #------------------------------------------------- # extra target to generate ts translation files lupdate.commands = lupdate $$_PRO_FILE_ lupdate.depends = FORCE QMAKE_EXTRA_TARGETS += lupdate #------------------------------------------------- # extra compiler to generate qm translation files lrelease.input = TRANSLATIONS lrelease.output = $${QM_DIR}/lang/${QMAKE_FILE_BASE}.qm lrelease.commands = lrelease ${QMAKE_FILE_NAME} -qm ${QMAKE_FILE_OUT} lrelease.CONFIG += no_link target_predeps QMAKE_EXTRA_COMPILERS += lrelease
    • K

      [Solved] Get translated string without switching the language
      General and Desktop • qt 4.8 translation language languagechange • • kumararajas

      13
      0
      Votes
      13
      Posts
      5328
      Views

      K

      @SGaist OK. Thanks for the answer. I'll give a try.

    • T

      Base translation not working
      General and Desktop • translation qtpt • • tabacof

      6
      0
      Votes
      6
      Posts
      1668
      Views

      M

      The standard translations for Ok, Cancel, Save had been moved into <name>QPlatformTheme</name>
      They are missing now in all the old qt_??.ts and are only available in the newer qtbase_??.ts

      I had copied the QPlatformTheme messages into the ts-files I needed.

      Markus

    • patrikd

      Translation of native android dialog
      Mobile and Embedded • android translation • • patrikd

      4
      1
      Votes
      4
      Posts
      1304
      Views

      SGaist

      Are you loading all the necessary translation files ?