diff --git a/src/preferences/dialog/dlgprefcolors.cpp b/src/preferences/dialog/dlgprefcolors.cpp index 999e70040c9c..04b708931dfc 100644 --- a/src/preferences/dialog/dlgprefcolors.cpp +++ b/src/preferences/dialog/dlgprefcolors.cpp @@ -96,19 +96,21 @@ void DlgPrefColors::slotUpdate() { BaseTrackTableModel::kKeyColorsEnabledDefault)); for (const auto& palette : std::as_const(mixxx::PredefinedColorPalettes::kPalettes)) { QString paletteName = palette.getName(); + QString translatedName = QCoreApplication::translate( + "PredefinedColorPalettes", qPrintable(paletteName)); QIcon paletteIcon = drawPalettePreview(paletteName); - comboBoxHotcueColors->addItem(tr(qPrintable(paletteName)), paletteName); + comboBoxHotcueColors->addItem(translatedName, paletteName); comboBoxHotcueColors->setItemIcon( comboBoxHotcueColors->count() - 1, paletteIcon); - comboBoxTrackColors->addItem(tr(qPrintable(paletteName)), paletteName); + comboBoxTrackColors->addItem(translatedName, paletteName); comboBoxTrackColors->setItemIcon( comboBoxTrackColors->count() - 1, paletteIcon); if (palette.size() == 12) { - comboBoxKeyColors->addItem(tr(qPrintable(paletteName)), paletteName); + comboBoxKeyColors->addItem(translatedName, paletteName); comboBoxKeyColors->setItemIcon( comboBoxKeyColors->count() - 1, paletteIcon); @@ -117,12 +119,14 @@ void DlgPrefColors::slotUpdate() { const QSet colorPaletteNames = m_colorPaletteSettings.getColorPaletteNames(); for (const auto& paletteName : colorPaletteNames) { + QString translatedName = QCoreApplication::translate( + "PredefinedColorPalettes", qPrintable(paletteName)); QIcon paletteIcon = drawPalettePreview(paletteName); - comboBoxHotcueColors->addItem(tr(qPrintable(paletteName)), paletteName); + comboBoxHotcueColors->addItem(translatedName, paletteName); comboBoxHotcueColors->setItemIcon( comboBoxHotcueColors->count() - 1, paletteIcon); - comboBoxTrackColors->addItem(tr(qPrintable(paletteName)), paletteName); + comboBoxTrackColors->addItem(translatedName, paletteName); comboBoxTrackColors->setItemIcon( comboBoxHotcueColors->count() - 1, paletteIcon); @@ -130,19 +134,19 @@ void DlgPrefColors::slotUpdate() { const ColorPalette trackPalette = m_colorPaletteSettings.getTrackColorPalette(); - comboBoxTrackColors->setCurrentText( - tr(qPrintable(trackPalette.getName()))); + comboBoxTrackColors->setCurrentText(QCoreApplication::translate( + "PredefinedColorPalettes", qPrintable(trackPalette.getName()))); const ColorPalette hotcuePalette = m_colorPaletteSettings.getHotcueColorPalette(); - comboBoxHotcueColors->setCurrentText( - tr(qPrintable(hotcuePalette.getName()))); + comboBoxHotcueColors->setCurrentText(QCoreApplication::translate( + "PredefinedColorPalettes", qPrintable(hotcuePalette.getName()))); slotHotcuePaletteIndexChanged(comboBoxHotcueColors->currentIndex()); const ColorPalette keyPalette = m_colorPaletteSettings.getKeyColorPalette(); - comboBoxKeyColors->setCurrentText( - tr(qPrintable(keyPalette.getName()))); + comboBoxKeyColors->setCurrentText(QCoreApplication::translate( + "PredefinedColorPalettes", qPrintable(keyPalette.getName()))); bool autoHotcueColors = m_pConfig->getValue(kAutoHotcueColorsConfigKey, false); if (autoHotcueColors) { @@ -180,15 +184,19 @@ void DlgPrefColors::slotUpdate() { // Set the default values for all the widgets void DlgPrefColors::slotResetToDefaults() { - comboBoxHotcueColors->setCurrentText( - tr(qPrintable(mixxx::PredefinedColorPalettes::kDefaultHotcueColorPalette - .getName()))); - comboBoxTrackColors->setCurrentText( - tr(qPrintable(mixxx::PredefinedColorPalettes::kDefaultTrackColorPalette - .getName()))); - comboBoxKeyColors->setCurrentText( - tr(qPrintable(mixxx::PredefinedColorPalettes::kDefaultKeyColorPalette - .getName()))); + comboBoxHotcueColors->setCurrentText(QCoreApplication::translate( + "PredefinedColorPalettes", + qPrintable( + mixxx::PredefinedColorPalettes::kDefaultHotcueColorPalette + .getName()))); + comboBoxTrackColors->setCurrentText(QCoreApplication::translate( + "PredefinedColorPalettes", + qPrintable(mixxx::PredefinedColorPalettes::kDefaultTrackColorPalette + .getName()))); + comboBoxKeyColors->setCurrentText(QCoreApplication::translate( + "PredefinedColorPalettes", + qPrintable(mixxx::PredefinedColorPalettes::kDefaultKeyColorPalette + .getName()))); comboBoxHotcueDefaultColor->setCurrentIndex( mixxx::PredefinedColorPalettes::kDefaultTrackColorPalette.size()); comboBoxLoopDefaultColor->setCurrentIndex( @@ -465,8 +473,10 @@ void DlgPrefColors::restoreComboBoxes( const QString& trackColors, int defaultHotcueColor, int defaultLoopColor) { - comboBoxHotcueColors->setCurrentText(tr(qPrintable(hotcueColors))); - comboBoxTrackColors->setCurrentText(tr(qPrintable(trackColors))); + comboBoxHotcueColors->setCurrentText(QCoreApplication::translate( + "PredefinedColorPalettes", qPrintable(hotcueColors))); + comboBoxTrackColors->setCurrentText(QCoreApplication::translate( + "PredefinedColorPalettes", qPrintable(trackColors))); if (comboBoxHotcueDefaultColor->count() > defaultHotcueColor) { comboBoxHotcueDefaultColor->setCurrentIndex(defaultHotcueColor); } else {