title: Qt5 QDialogButtonBox localized values aren't found, though they exist in qt_xx.qm and were found in Qt4
body: <p>Upgrading my application from Qt 4.8 to Qt 5.4.1, I notice that when running my application in non-English, the translated items in the "QDialogButtonBox" section of qt_xx.ts are not found.  Other items, such as those in the "QWizard" section, are found and displayed correctly.</p>
  
  <p>How can I get my <code>QMessageBox</code>'s to have their buttons use the translated strings in qt_xx.qm?</p>
  
  <p>I used French to demonstrate this issue (code below):</p>
  
  <p>I deleted all the sections in the qt_fr.ts file except for "QDialogButtonBox" and "QWizard".  I edited the translation of "Cancel" in the "QWizard" section to be sure that qt_fr.qm is used at all.  Then I ran lrelease to create my qt_fr.qm.</p>
  
  <p>On a Windows 7 box, in the Region and Language dialog:</p>
  
  <ul>
  <li>in the Formats tab, I set the Format to "French (France)"</li>
  <li>in the Keyboards and Languages tab, I set the Display Language to French.</li>
  </ul>
  
  <p>I run my sample project with the .exe and qt_fr.qm in the same folder.  In that folder I also have a copy of the necessary Qt5 dll's (can copy them from a Windows build of Qt, in qtbase\bin).</p>
  
  <p>Results:</p>
  
  <p>When I click the "QMessageBox" button I see a <code>QMessageBox</code>, with the buttons NOT translated.  When I click the "QWizard" button I see a <code>QWizard</code>, and the Cancel button DOES have my edited translation.</p>
  
  <p>The QMessageBox buttons are translated in the Qt 4 version of my application.  What changed?  How do I get it to work in Qt 5?</p>
  
  <p>Sample project code:</p>
  
  <p>btn_localize_bug757.pro:</p>
  
  <pre><code>QT       += core gui
  
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  
  TARGET = btn_localize_bug757
  TEMPLATE = app
  
  
  SOURCES += main.cpp\
          mainwindow.cpp
  
  HEADERS  += mainwindow.h
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>#include "mainwindow.h"
  #include &lt;QtWidgets/QApplication&gt;
  #include &lt;QtCore/QTranslator&gt;
  
  int main(int argc, char *argv[])
  {
    QApplication a(argc, argv);
  
    QTranslator qtTranslator;
    qtTranslator.load("qt_fr");
    a.installTranslator(&amp;qtTranslator);
  
    MainWindow w;
    w.show();
  
    return a.exec();
  }
  </code></pre>
  
  <p>mainwindow.h:</p>
  
  <pre><code>#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  
  #include &lt;QtWidgets/QMainWindow&gt;
  
  #include &lt;QtWidgets/QPushButton&gt;
  
  class MainWindow : public QMainWindow
  {
    Q_OBJECT
  
  public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
  
  private slots:
    void showMessage();
    void showWizard();
  
  private:
    QPushButton *showMessageButton;
    QPushButton *showWizardButton;
  };
  
  #endif // MAINWINDOW_H
  </code></pre>
  
  <p>mainwindow.cpp:</p>
  
  <pre><code>#include "mainwindow.h"
  
  #include &lt;QtWidgets/QMessageBox&gt;
  #include &lt;QtWidgets/QVBoxLayout&gt;
  #include &lt;QtWidgets/QWizard&gt;
  
  MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
  {
    setWindowTitle("test");
  
    QPushButton *showMessageButton = new QPushButton("QMessageBox", this);
    connect(showMessageButton, SIGNAL(clicked()), SLOT(showMessage()));
  
    QPushButton *showWizardButton = new QPushButton("QWizard", this);
    connect(showWizardButton, SIGNAL(clicked()), SLOT(showWizard()));
  
    QVBoxLayout *layout = new QVBoxLayout;
    layout-&gt;addWidget(showMessageButton);
    layout-&gt;addWidget(showWizardButton);
  
    QWidget *window = new QWidget();
    window-&gt;setLayout(layout);
  
    setCentralWidget(window);
  }
  
  MainWindow::~MainWindow()
  {
  
  }
  
  void MainWindow::showMessage()
  {
    QMessageBox msg(this);
    msg.setWindowModality(Qt::WindowModal);
    msg.setIcon(QMessageBox::Question);
    msg.setText("test");
    msg.setStandardButtons(QMessageBox::Save |
                                           QMessageBox::Discard |
                                           QMessageBox::Cancel);
    msg.setDefaultButton(QMessageBox::Save);
  
    msg.exec();
  }
  
  void MainWindow::showWizard()
  {
    QWizard *wiz = new QWizard();
    wiz-&gt;show();
  }
  </code></pre>
  
  <p>qt_fr.ts:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE TS&gt;
  &lt;TS version="2.0" language="fr"&gt;
  &lt;context&gt;
      &lt;name&gt;QDialogButtonBox&lt;/name&gt;
      &lt;message&gt;
          &lt;source&gt;OK&lt;/source&gt;
          &lt;translation&gt;OK&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Save&lt;/source&gt;
          &lt;translation&gt;Enregistrer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;Save&lt;/source&gt;
          &lt;translation&gt;Enregi&amp;amp;strer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Open&lt;/source&gt;
          &lt;translation&gt;Ouvrir&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Cancel&lt;/source&gt;
          &lt;translation&gt;Annuler&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;Cancel&lt;/source&gt;
          &lt;translation&gt;&amp;amp;Annuler&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Close&lt;/source&gt;
          &lt;translation&gt;Fermer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;Close&lt;/source&gt;
          &lt;translation&gt;&amp;amp;Fermer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Apply&lt;/source&gt;
          &lt;translation&gt;Appliquer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Reset&lt;/source&gt;
          &lt;translation&gt;Réinitialiser&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Help&lt;/source&gt;
          &lt;translation&gt;Aide&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Don&amp;apos;t Save&lt;/source&gt;
          &lt;translation&gt;Ne pas enregistrer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Discard&lt;/source&gt;
          &lt;translation&gt;Ne pas enregistrer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;Yes&lt;/source&gt;
          &lt;translation&gt;&amp;amp;Oui&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Yes to &amp;amp;All&lt;/source&gt;
          &lt;translation&gt;Oui à &amp;amp;tout&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;No&lt;/source&gt;
          &lt;translation&gt;&amp;amp;Non&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;N&amp;amp;o to All&lt;/source&gt;
          &lt;translation&gt;Non à to&amp;amp;ut&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Save All&lt;/source&gt;
          &lt;translation&gt;Tout Enregistrer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Abort&lt;/source&gt;
          &lt;translation&gt;Abandonner&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Retry&lt;/source&gt;
          &lt;translation&gt;Réessayer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Ignore&lt;/source&gt;
          &lt;translation&gt;Ignorer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Restore Defaults&lt;/source&gt;
          &lt;translation&gt;Restaurer les valeurs par défaut&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Close without Saving&lt;/source&gt;
          &lt;translation&gt;Fermer sans enregistrer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;OK&lt;/source&gt;
          &lt;translation&gt;&amp;amp;OK&lt;/translation&gt;
      &lt;/message&gt;
  &lt;/context&gt;
  &lt;context&gt;
      &lt;name&gt;QWizard&lt;/name&gt;
      &lt;message&gt;
          &lt;source&gt;Go Back&lt;/source&gt;
          &lt;translation&gt;Précédent&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Continue&lt;/source&gt;
          &lt;translation&gt;Continuer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Commit&lt;/source&gt;
          &lt;translatorcomment&gt;si il s&amp;apos;agit de commit au même sens que git... (en même temps se marier en cliquant... ?!!?!)&lt;/translatorcomment&gt;
          &lt;translation&gt;Soumettre&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Done&lt;/source&gt;
          &lt;translation&gt;Terminer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Quit&lt;/source&gt;
          &lt;translation type="obsolete"&gt;Quitter&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Help&lt;/source&gt;
          &lt;translation&gt;Aide&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;lt; &amp;amp;Back&lt;/source&gt;
          &lt;translation&gt;&amp;lt; &amp;amp;Précédent&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;Finish&lt;/source&gt;
          &lt;translation&gt;&amp;amp;Terminer&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;Cancel&lt;/source&gt;
          &lt;translation&gt;testAnnuler&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;Help&lt;/source&gt;
          &lt;translation&gt;&amp;amp;Aide&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;Next&lt;/source&gt;
          &lt;translation&gt;&amp;amp;Suivant &amp;gt;&lt;/translation&gt;
      &lt;/message&gt;
      &lt;message&gt;
          &lt;source&gt;&amp;amp;Next &amp;gt;&lt;/source&gt;
          &lt;translation&gt;&amp;amp;Suivant &amp;gt;&lt;/translation&gt;
      &lt;/message&gt;
  &lt;/context&gt;
  &lt;/TS&gt;
  </code></pre>