How to translate Dialog's standard buttons?
Solved
QML and Qt Quick
-
How to translate
Yes
andNo
buttons of the following dialog?import QtQuick import QtQuick.Controls import QtQuick.Layouts Dialog { id: loadDialog modal: true title: appName standardButtons: Dialog.Yes | Dialog.No Text { text: qsTr("Load_Key") } onAccepted: window.loadGameWithAd() }
I tried to add
RESOURCES += $$files(E:/Qt/Qt6.2.2/windows/translations/*.qm)
to my project, but with no success.
Also I tried to add
<context> <name>Dialog</name> <message> <source>Yes</source> <translation>Да</translation> </message> <message> <source>No</source> <translation>Нет</translation> </message> </context>
to my translation file, but also without a success.
My QT version is 6.2.2
-
@Dmitriano found the following in
qt-everywhere-src-6.2.2\qttranslations\translations\qtbase_ru.ts
:<context> <name>QPlatformTheme</name> <message> <source>OK</source> <translation>OK</translation> </message> <message> <source>Save</source> <translation>Сохранить</translation> </message> <message> <source>Save All</source> <translation>Сохранить все</translation> </message> <message> <source>Open</source> <translation>Открыть</translation> </message> <message> <source>&Yes</source> <translation>&Да</translation> </message> <message> <source>Yes to &All</source> <translation>Да для &всех</translation> </message> <message> <source>&No</source> <translation>&Нет</translation> </message> <message> <source>N&o to All</source> <translation>Н&ет для всех</translation> </message> <message> <source>Abort</source> <translation>Прервать</translation> </message> <message> <source>Retry</source> <translation>Повторить</translation> </message> <message> <source>Ignore</source> <translation>Пропустить</translation> </message> <message> <source>Close</source> <translation>Закрыть</translation> </message> <message> <source>Cancel</source> <translation>Отмена</translation> </message> <message> <source>Discard</source> <translation>Отклонить</translation> </message> <message> <source>Help</source> <translation>Справка</translation> </message> <message> <source>Apply</source> <translation>Применить</translation> </message> <message> <source>Reset</source> <translation>Сбросить</translation> </message> <message> <source>Restore Defaults</source> <translation>По умолчанию</translation> </message> </context>
but adding
qt-everywhere-src-6.2.2\qttranslations\translations\qtbase_ru.ts
to the project does not help.