Questions tagged [qt-linguist]

Qt Linguist is a tool for adding translations to Qt applications. Release managers, translators, and developers can use Qt Linguist to accomplish this tasks.

Qt Linguist can be run from the taskbar menu, or by double clicking the desktop icon, or by entering the command linguist at the command line.

The Qt Linguist main window is divided into several, dockable subwindows arranged around a central translation area. The context list is normally shown on the left, and the source code, string list, and either the phrases and guesses, or the warnings are shown above and below the translations area.

Qt Linguist can automatically check whether your translation strings pass a list of validation tests. Validation test failures are shown in the warnings window. If the warnings window is not visible, click the Warnings tab at the bottom of the main window.

Qt Linguist makes use of four kinds of files:

  • TS translation source files are human-readable XML files containing source phrases and their translations. These files are usually created and updated by lupdate and are specific to an application.
  • .xlf XLIFF files are human-readable XML files that adhere to the international XML Localization Interchange File Format. Qt Linguist can be used to edit XLIFF files generated by other programs. However, for standard Qt projects, only the TS file format is used. Note: The minimum supported version for XLIFF format files is 1.1. XLIFF 1.0 version files are not supported.
  • QM Qt message files are binary files that contain translations used by an application at run-time. These files are generated by lrelease, but can also be generated by Qt Linguist.
  • .qph Qt phrase book files are human-readable XML files containing standard phrases and their translations. These files are created and updated by Qt Linguist and may be used by any number of projects and applications.
55 questions
8
votes
2 answers

How to change languages(translations) dynamically on PyQt5?

I wonder if it is possible to change the languages(translations) dynamically without using qt designer to make the UI? That means I don't want to use the function retranslateUi() to update the program interface. Here is my code, but I'm stuck on…
just_be_happy
  • 592
  • 1
  • 6
  • 19
8
votes
1 answer

Qt5: Qt Linguist redistributable

I'm writing a manual for translators and can't find an easy and official way of Qt Linguist editor distribution. It looks like you can get it for Linux by downloading qttools5-dev-tools package. But for other systems? Qt5 online installer doesn't…
truf
  • 2,843
  • 26
  • 39
7
votes
1 answer

"vanished" type for the "translation" element in the TS files

I noticed that some messages in a Qt TS file have a "vanished" type for their translation elements, but its use is not clear. It seems that only messages in the "unnamed" context have this type. The corresponding DTD only says that this value was…
Rusty Gear
  • 455
  • 1
  • 4
  • 11
5
votes
1 answer

How to update *.ts (for Qt Linguist) files in CMake Qt project?

I found how to use .ts files in CMake: SET(TRANS localization/en_en.ts) QT5_ADD_TRANSLATION(QM ${TRANS}) (and added to executables). And when i run lupdate from the Qt menu I've got the following: lupdate warning: no TS files specified. Only…
user453575457
  • 464
  • 6
  • 21
5
votes
3 answers

Qt linguist lupdate ignores qml files

When running lupdate none of the qsTr in the qml files are recognized. The resulting .ts file doesn't contain any translation context. $ lupdate -verbose App.pro Updating 'translations/en.ts'... Found 0 source text(s) (0 new and 0 already…
Appleshell
  • 7,088
  • 6
  • 47
  • 96
4
votes
2 answers

CMake qt5_add_translation, how to specify the output path?

I use qt5_add_translation to run lrelease and generate the .qm files. By default the .qm files are put at the root level of the build dir, no matter where you put the .ts files in the source dir. How can I specify a subdir for those files in the…
ymoreau
  • 3,402
  • 1
  • 22
  • 60
4
votes
1 answer

PyQt5 translation: is it possible to run pylupdate5 from Python?

I have some PyQt5 application with some tr() translations in it. I have a Python script that compiles UI forms and resources, and I want it to also update the ts file with translations, because it's a bit annoying to run pylupdate manually each…
Felix
  • 3,351
  • 6
  • 40
  • 68
4
votes
2 answers

How do I start using QtLinguist to translate my QtCreator project?

I have a simple .pro Qt Creator project. I have most, if not all, of my application text in Qt .ui XML form files. I want to use Qt Linguist to translate text in that project, but I have no idea how to start. There's no useful "Getting started with…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
4
votes
1 answer

Translating Qt applications

I need to have my application translated into many different languages, I have the translators and know that I can use Qt Linguist. However as far as I can tell I have to package up Linguist myself and ship it out to the translators. Is there a…
Phil Hannent
  • 12,047
  • 17
  • 71
  • 118
3
votes
0 answers

Detect incomplete translation files in Qt

I want to be able to detect if translations are missing for any language during my release build. I'm using CMake to build the application and CMake is also running lupdate and lrelease. In this process I would like to display a warning if some…
KMK
  • 1,439
  • 5
  • 21
  • 39
2
votes
0 answers

Qt. How can I translate QPageSetupDialog dialog?

I need to translate standard Qt QPageSetupDialog that I thought used by QPrintPreviewDialog, but now I am not sure. I was able to translate QPrintPreviewDialog itself by using qtbase_de.qm, I generated it with lrelease and qtbase_de.ts downloaded…
2
votes
0 answers

Translate string that are unknown at compile time

I am writing an application which has content that can be added from external sources (through a set of JSON files). Therefore the content to be displayed is mostly unknown at comile time but will be curated (no random sources). For the content that…
Herr von Wurst
  • 2,571
  • 5
  • 32
  • 53
2
votes
1 answer

Translating a Q_ENUM keys

I use the Q_ENUM macro in my code, and then I use the associated QMetaEnum to populate a QComboBox. Is there any "standard" way to manage the translation of the Q_ENUM keys (retrieved with QMetaEnum::key() method)? I didn't find anything in the Qt's…
Aurelien
  • 1,032
  • 2
  • 10
  • 24
2
votes
0 answers

How to manage Qt5 translation files of dependent projects with CMake?

We have a large set of libraries, each with their translations, that is set up using CMake. For each application that uses these libraries, it scours its TARGET_LIBRARIES (variable set by us) for translations and combines them using lconvert. It…
rubenvb
  • 74,642
  • 33
  • 187
  • 332
2
votes
1 answer

QTranslator Linguist: Are line numbers required?

I used that example here There you can see line numbers, for all location tags. I do not want to use linenumbers, since they might change from time to time. When I open the *.ts file in the Linguist, the *.ui is shown there as well, as you can see…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
1
2 3 4