@Mercury13
Программист на «си с крестами» и не только

Qt: как локализовать меню QScrollBar?

Собственно, вопрос. Меню английское. Как его перевести на русский? Где эти строки хранятся?
612e046c6f289632364238.png
  • Вопрос задан
  • 80 просмотров
Решения вопроса 1
@xibir
int main(int argc, char* argv[])
{
   QApplication app(argc, argv);
   QTranslator tr;
   if (tr.load("qtbase_ru", QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
      QApplication::installTranslator(&tr);
   ...
}
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
Zifix
@Zifix Куратор тега Qt
Barbatum
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
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы