M
M
Mercury132021-08-31 13:29:04
Qt
Mercury13, 2021-08-31 13:29:04

Qt: how to localize QScrollBar menu?

Actually, a question. English menu. How to translate it into Russian? Where are these lines stored?
612e046c6f289632364238.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xibir, 2021-08-31
@Mercury13

int main(int argc, char* argv[])
{
   QApplication app(argc, argv);
   QTranslator tr;
   if (tr.load("qtbase_ru", QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
      QApplication::installTranslator(&tr);
   ...
}

J
Jacob E, 2021-08-31
@Zifix

Usually, there are .qm files for the application, and, if a version of Qt is used that is not installed on the system, Qt's .qm files need to be deployed as well.
In Qt 4, there is one big, monolithic .qm file per locale. For example, the file qt_de.qm contains the German translation of all libraries.
In Qt 5, the .qm files were split up by module and there is a so-called meta catalog file which includes the .qm files of all modules. The name of the meta catalog file is identical to the name of Qt 4's monolithic .qm file so that existing loader code works as before provided all included .qm files are found.

https://doc.qt.io/qt-5/linguist-programmers.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question