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
1
vote
1 answer

Cannot find Qt5LinguistTools in Ubuntu 22.04

My question is very similar to this one. I am trying to build a Qt5 project with Cmake and I am getting this error : -- QT_DIR: /Users/Shared/Qt/5.12.11/clang_64 -- CMAKE_PREFIX_PATH (should contain the QT install path):…
Mickaël C. Guimarães
  • 1,020
  • 2
  • 14
  • 32
1
vote
1 answer

Is there a way to use retreanslateUi in python code while the function being described in .ui file?

I'm creating a multilanguage desktop app using Qt Designer and PyQt5. I'm following this answer to make my app change languages dynamically. I've created a .ui file via Qt Designer and I'm loading the UI directly in python code via loadUi.…
sunflower
  • 23
  • 5
1
vote
1 answer

How to run QT's `lupdate`-tool with a `qmake CONFIG`?

This question has been posted before in the qt community: https://forum.qt.io/topic/106930/how-to-run-lupdate-with-a-qmake-config I use such a construct in my project files: LANGUAGES = de TRANSLATION_NAME =…
1
vote
0 answers

Keeping translations when moving source strings

I have a single translator.cpp source file containing a lot of strings. These have been been translated to various languages using Qt Linguist. Now I want to split the single file into multiple files: Old structure: class Translator { QString…
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
1
vote
1 answer

How to stop QtLinguist from starting when Visual Studio wants to show TypeScript file?

After installing Qt tools for Visual Studio, whenever I Ctrl+click a class name, Qt Linguist starts: This prevents me from looking up type definitons, even though I can see Visual Studio has parsed them. When I hover the type, it's clearly…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
1
vote
1 answer

QTranslator: why are some parts of app not translated?

There is a working app and I am adding a new language for GUI. Everything works fine but some part of the app are simply not translated. QLinguist detects all of them, and I have added a new translations, but still no result. Here is the fragment of…
Bobur
  • 545
  • 1
  • 6
  • 21
1
vote
1 answer

How translate Message that comes from web service?

I have an qt quick application that works with a web service behind code for qml file here I want get list of book void BookManager::findBook(QString bookName){ QNetworkReply* reply=getRequest("api/Book/Find/"+bookName); …
mohsen
  • 1,763
  • 3
  • 17
  • 55
1
vote
1 answer

QT_TRANSLATE_NOOP disambiguation with pylupdate

I'm trying to use pylupdate to create translation files. import sys from PyQt5 import QtCore from PyQT5.QtCore import QT_TRANSLATE_NOOP _translate = QtCore.QCoreApplication.translate if __name__ == '__main__': app =…
Faller
  • 1,588
  • 3
  • 16
  • 27
1
vote
2 answers

How to specify output name for qt5_add_translation?

I want to generate a plenty *.qm for plenty *.ts files for different languages using qt5_add_translation. All the *.ts files are named using *.de_DE.ts/*.fr_FR.ts/etc convention. But qt5_add_translation produce output, using only basename until…
Tomilov Anatoliy
  • 15,657
  • 10
  • 64
  • 169
1
vote
1 answer

How to switch the base language for my .ts files

Now, suddenly after a few years, I'm going to replace all German strings with English ones in my C++ sources. The question is how to turn my already existing German-to-targetLanguage .ts files into English-to-targetLanguage .ts files. I've got the…
falkb
  • 1,294
  • 11
  • 35
1
vote
1 answer

QT5 Linguist macro in cmake

despite being quite new to cmake, I succeeded to create a new project including Qt5LinguistTools and a .ts file containing my translations. I added a section into my cmake file to call lupdate and lrelease on my file(s) using the defined macro…
wambach
  • 341
  • 3
  • 12
1
vote
1 answer

QT Application UTF8-strings in translation get displayed erroneous

We are using QT 5.5 successfully throughout our VC++ projects in VS2015. Now, i am adding i18n thereto, using QTs Linguist tools to create my strings 2b translated and the resulting .qm files. I load the files through QTranslator object, the…
wambach
  • 341
  • 3
  • 12
1
vote
3 answers

Ot translation: original QString text

Is there a way to get the original language independent text of a QString that was marked for translation ? Here is a simplification of my code: QString MyClass::getError() { QString errorText = tr("hardError1"); return errorText; } The…
luffy
  • 2,246
  • 3
  • 22
  • 28
1
vote
0 answers

Translate Qt-Dialogs: ColorDialog or FileDialog

I have a Qt application. There I use QColorDialog to pick a QColor and QFileDialog to read/save files. My specific terms I have translated into a individual myApp_DE.qm file (works fine except for this). But the Qt specific dialogs, i.e.…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
1
vote
0 answers

Create Multilanguage QtQuick App with QtLinguist

I do this stuff for research, so there´s no source code. My programm has to be able to change the language via buttons. I got the information that the QtLinguistis often used for this stuff. The problem is that I can´t find something like a…
RefMa77
  • 283
  • 2
  • 14