From e73946fc06be26ca261bb0a605e7c26d8c63244f Mon Sep 17 00:00:00 2001 From: lordmulder Date: Thu, 30 Dec 2010 17:34:19 +0100 Subject: [PATCH] More internationalization and localization... (again) --- etc/Translation/LameXP_DE.ts | 154 +++++++++++++++++++++------------- gui/DropBox.ui | 4 +- res/localization/LameXP_DE.qm | Bin 3550 -> 3883 bytes src/Config.h | 2 +- src/Dialog_DropBox.cpp | 21 +++++ src/Dialog_DropBox.h | 2 + src/Dialog_MainWindow.cpp | 71 +++++++++------- src/Dialog_MainWindow.h | 2 +- 8 files changed, 160 insertions(+), 96 deletions(-) diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 413c4886..566f8689 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -8,9 +8,17 @@ - <b>LameXP DropBox</b><br><nobr>You can add files to LameXP via Drag&amp;Drop here!</nobr><br><nobr>(Right-click to close the DropBox)</nobr> + LameXP DropBox + + You can add files to LameXP via Drag&amp;Drop here! + Sie könner hier Dateien per Drag&amp;Drop hinzufügen! + + + (Right-click to close the DropBox) + (Rechts-klicken um die DropBox zu schließen) + LogViewDialog @@ -306,7 +314,7 @@ RUN\DOS\RUN You can drop in audio files here! - Sie können hier Audio-Dateien per Drag&Drop einfügen! + Sie können hier Audio-Dateien hinein ziehen! Open File in External Application @@ -369,50 +377,14 @@ LameXP is free software and release versions won't expire. Postpone - - <nobr>LameXP detected that your version of the Nero AAC encoder is outdated!<br> - - - - The current version available is %1 (or later), but you still have version %2 installed.<br><br> - - - - You can download the latest version of the Nero AAC encoder from the Nero website at:<br> - - AAC Encoder Outdated - - <nobr>The Nero AAC encoder could not be found. AAC encoding support will be disabled.<br> - - - - Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory!<br><br> - - - - Your LameXP directory is located here:<br> - - - - You can download the Nero AAC encoder for free from the official Nero website at:<br> - - AAC Support Disabled - - <nobr>LameXP has detected that the WMA File Decoder component is not currently installed on your system.<br> - - - - You won't be able to process WMA files as input unless the WMA File Decoder component is installed!</nobr> - - WMA Decoder Missing @@ -429,10 +401,6 @@ LameXP is free software and release versions won't expire. Low Diskspace Warning - - <nobr>There are less than %1 GB of free diskspace available on your system's TEMP folder.</nobr><br><nobr>It is highly recommend to free up more diskspace before proceeding with the encode!</nobr><br><br>Your TEMP folder is located at: - - Abort Encoding Process @@ -457,10 +425,6 @@ LameXP is free software and release versions won't expire. Sorry, an unsupported encoder has been chosen! - - Cannot write to the selected output directory.<br><nobr>%1</nobr><br><br>Please choose a different directory! - - Add file(s) @@ -481,10 +445,6 @@ LameXP is free software and release versions won't expire. Failed to create folder - - The new folder could not be created:<br><nobr>%1</nobr><br><br>Drive is read-only or insufficient access rights! - - Already running @@ -513,10 +473,6 @@ LameXP is free software and release versions won't expire. Update Reminder - - The update reminder has been disabled.<br>Please remember to check for updates at regular intervals! - - The update reminder has been re-enabled. @@ -621,16 +577,96 @@ LameXP is free software and release versions won't expire. Access Denied - - <nobr>%1 file(s) have been rejected, because read access was not granted!<br>This usually means the file is locked by another process.</nobr> - - Files Rejected - <nobr>%1 file(s) have been rejected, because the file format could not be recognized!<br>This usually means the file is damaged or the file format is not supported.</nobr> + LameXP detected that your version of the Nero AAC encoder is outdated! + + + + The current version available is %1 (or later), but you still have version %2 installed. + + + + You can download the latest version of the Nero AAC encoder from the Nero website at: + + + + The Nero AAC encoder could not be found. AAC encoding support will be disabled. + + + + Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory! + + + + Your LameXP directory is located here: + + + + You can download the Nero AAC encoder for free from the official Nero website at: + + + + LameXP has detected that the WMA File Decoder component is not currently installed on your system. + + + + You won't be able to process WMA files as input unless the WMA File Decoder component is installed! + + + + Cannot write to the selected output directory. + + + + Please choose a different directory! + + + + The new folder could not be created: + + + + Drive is read-only or insufficient access rights! + + + + There are less than %1 GB of free diskspace available on your system's TEMP folder. + + + + It is highly recommend to free up more diskspace before proceeding with the encode! + + + + Your TEMP folder is located at: + + + + %1 file(s) have been rejected, because read access was not granted! + + + + This usually means the file is locked by another process. + + + + %1 file(s) have been rejected, because the file format could not be recognized! + + + + This usually means the file is damaged or the file format is not supported. + + + + The update reminder has been disabled. + + + + Please remember to check for updates at regular intervals! diff --git a/gui/DropBox.ui b/gui/DropBox.ui index c828b1f1..f89b2c9e 100644 --- a/gui/DropBox.ui +++ b/gui/DropBox.ui @@ -25,9 +25,6 @@ - - <b>LameXP DropBox</b><br><nobr>You can add files to LameXP via Drag&amp;Drop here!</nobr><br><nobr>(Right-click to close the DropBox)</nobr> - 0 @@ -54,6 +51,7 @@ + diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index 741f4828dabfa82b964903b301e009a008ce8c67..c5c0faaaf304ee40ec2f0799954f913018c81920 100644 GIT binary patch delta 733 zcmYk2T}TvR6o%j3o!K4TKawIs-NvGF34_pxScEVM60y>P&4QSAXPs?lf7qYUsMbuo z5-PUDtBUAG!i(CAplFF~dGbmG$cOD07!})VGTLR_km_2mAKgI={F9%SYQe=`)a5!jdd5$}`EVYy-*; zNoTx20r`$JIynHiHpq>?#sKSPd2r_x2NmQiU#$duB9Cu*N}o@DyCcPc!}d?wU;46+ z*Y8FBw6d*goceC1?bZ(heNcMmH?iKJ^sin9U`V-i@h0+cJufqJrvO`XdBbmw1Bc5; z4qvAs;_Uah_y^ye;}s(`!1*m802SBNOa76q$Fp_UB;##QU$p={>$zM}B=CS|_T4n| zSKj?AGj!R#Js14+6}b-gHSP#O)S?|aLNM~kB7-`_U?NH(MmYf$ImCH}sp*W(NF#|9 zns|0IKhC;J9|x3tI^L9genoKF`K_sKk9HZ^x{w(S#nfz44VlS|u4WBgZB8dsP04P* zgKdtw#mpkOj-q4n!5HRJoYA2LcRZw0@5ZC)c<3V|i4g?gd{6~R2ZN+>l;DD?-D zIW?puR4p77YY$MIQ<#DE{BZ^buH_6~+D!}$ z%*6~5CyxNds~MsW0M&81GeoBu1L<-`A690dye#95dq8!pXPFi_WHK-??PXdkC&|FT zv6<m&@ zDir5#;o|`+T+02?8t5SQojgZx0)4=w#b@q$7)WREHOU@eU|=-ongJ0~UEGXWlVkX7C;Kr8iMlWpG2}B8FeosjGGsF3 PF{Cm4VMw36j;|H~JlJ7Q diff --git a/src/Config.h b/src/Config.h index fd4e5be5..ccbbbbfa 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 200 +#define VER_LAMEXP_BUILD 201 #define VER_LAMEXP_SUFFIX TechPreview /* diff --git a/src/Dialog_DropBox.cpp b/src/Dialog_DropBox.cpp index 258e4a2c..0ca3b7f5 100644 --- a/src/Dialog_DropBox.cpp +++ b/src/Dialog_DropBox.cpp @@ -62,6 +62,9 @@ DropBox::DropBox(QWidget *parent, QAbstractItemModel *model, SettingsModel *sett //Make transparent setWindowOpacity(0.8); + + //Translate UI + retranslateUi(this); } //////////////////////////////////////////////////////////// @@ -76,6 +79,11 @@ DropBox::~DropBox(void) // PUBLIC SLOTS //////////////////////////////////////////////////////////// +void DropBox::doRetranslate(void) +{ + retranslateUi(this); +} + void DropBox::modelChanged(void) { if(m_model) @@ -88,6 +96,19 @@ void DropBox::modelChanged(void) // EVENTS //////////////////////////////////////////////////////////// +/* + * Re-translate the UI + */ +void DropBox::changeEvent(QEvent *e) +{ + if(e->type() == QEvent::LanguageChange) + { + Ui::DropBox::retranslateUi(this); + dropBoxLabel->setToolTip(QString("%1
%2
%3").arg(tr("LameXP DropBox"), tr("You can add files to LameXP via Drag&Drop here!"), tr("(Right-click to close the DropBox)"))); + } +} + + void DropBox::showEvent(QShowEvent *event) { QRect screenGeometry = QApplication::desktop()->availableGeometry(); diff --git a/src/Dialog_DropBox.h b/src/Dialog_DropBox.h index 52563384..a9b1b532 100644 --- a/src/Dialog_DropBox.h +++ b/src/Dialog_DropBox.h @@ -60,8 +60,10 @@ protected: void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); + void changeEvent(QEvent *e); public slots: void modelChanged(void); + void doRetranslate(void); void showToolTip(void); }; diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index e743ba5d..59e2c297 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -293,7 +293,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S connect(m_fileListModel, SIGNAL(modelReset()), m_dropBox, SLOT(modelChanged())); connect(m_fileListModel, SIGNAL(rowsInserted(QModelIndex,int,int)), m_dropBox, SLOT(modelChanged())); connect(m_fileListModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), m_dropBox, SLOT(modelChanged())); - + //Create message handler thread m_messageHandler = new MessageHandlerThread(); m_delayedFileList = new QStringList(); @@ -304,10 +304,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S connect(m_delayedFileTimer, SIGNAL(timeout()), this, SLOT(handleDelayedFiles())); m_messageHandler->start(); - //Enable Drag & Drop - this->setAcceptDrops(true); - - //Load translation & re-translate + //Load translation & re-translate UI QList languageActions = m_languageActionGroup->actions(); while(!languageActions.isEmpty()) { @@ -318,6 +315,15 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S languageActionActivated(currentLanguage); } } + if(m_languageActionGroup->checkedAction() == NULL) + { + qWarning("No langauge is currently selected, going to select FIRST one!"); + m_languageActionGroup->actions().first()->setChecked(true); + languageActionActivated(m_languageActionGroup->actions().first()); + } + + //Enable Drag & Drop + this->setAcceptDrops(true); } //////////////////////////////////////////////////////////// @@ -362,25 +368,6 @@ MainWindow::~MainWindow(void) // PRIVATE FUNCTIONS //////////////////////////////////////////////////////////// -/* - * Re-translate the UI - */ -void MainWindow::retranslateUi(QMainWindow *MainWindow) -{ - Ui::MainWindow::retranslateUi(MainWindow); - - if(lamexp_version_demo()) - { - setWindowTitle(QString("%1 [%2]").arg(windowTitle(), tr("DEMO VERSION"))); - } - - m_dropNoteLabel->setText(QString("» %1 «").arg(tr("You can drop in audio files here!"))); - m_showDetailsContextAction->setText(tr("Show Details")); - m_previewContextAction->setText(tr("Open File in External Application")); - m_findFileContextAction->setText(tr("Browse File Location")); - m_showFolderContextAction->setText(tr("Browse Selected Folder")); -} - /* * Add file to source list */ @@ -401,11 +388,11 @@ void MainWindow::addFiles(const QStringList &files) if(analyzer->filesDenied()) { - QMessageBox::warning(this, tr("Access Denied"), tr("%1 file(s) have been rejected, because read access was not granted!
This usually means the file is locked by another process.
").arg(analyzer->filesDenied())); + QMessageBox::warning(this, tr("Access Denied"), QString("%1
%2
").arg(tr("%1 file(s) have been rejected, because read access was not granted!").arg(analyzer->filesDenied()), tr("This usually means the file is locked by another process."))); } if(analyzer->filesRejected()) { - QMessageBox::warning(this, tr("Files Rejected"), tr("%1 file(s) have been rejected, because the file format could not be recognized!
This usually means the file is damaged or the file format is not supported.
").arg(analyzer->filesRejected())); + QMessageBox::warning(this, tr("Files Rejected"), QString("%1
%2
").arg(tr("%1 file(s) have been rejected, because the file format could not be recognized!").arg(analyzer->filesRejected()), tr("This usually means the file is damaged or the file format is not supported."))); } LAMEXP_DELETE(analyzer); @@ -441,6 +428,28 @@ void MainWindow::showEvent(QShowEvent *event) } } +/* + * Re-translate the UI + */ +void MainWindow::changeEvent(QEvent *e) +{ + if(e->type() == QEvent::LanguageChange) + { + Ui::MainWindow::retranslateUi(this); + + if(lamexp_version_demo()) + { + setWindowTitle(QString("%1 [%2]").arg(windowTitle(), tr("DEMO VERSION"))); + } + + m_dropNoteLabel->setText(QString("» %1 «").arg(tr("You can drop in audio files here!"))); + m_showDetailsContextAction->setText(tr("Show Details")); + m_previewContextAction->setText(tr("Open File in External Application")); + m_findFileContextAction->setText(tr("Browse File Location")); + m_showFolderContextAction->setText(tr("Browse Selected Folder")); + } +} + /* * File dragged over window */ @@ -730,7 +739,7 @@ void MainWindow::encodeButtonClicked(void) QStringList tempFolderParts = lamexp_temp_folder().split("/", QString::SkipEmptyParts, Qt::CaseInsensitive); tempFolderParts.takeLast(); if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); - switch(QMessageBox::warning(this, tr("Low Diskspace Warning"), tr("There are less than %1 GB of free diskspace available on your system's TEMP folder.
It is highly recommend to free up more diskspace before proceeding with the encode!

Your TEMP folder is located at:").append("
%3
").arg(QString::number(minimumFreeDiskspaceMultiplier), tempFolderParts.join("\\")), tr("Abort Encoding Process"), tr("Clean Disk Now"), tr("Ignore"))) + switch(QMessageBox::warning(this, tr("Low Diskspace Warning"), QString("%1
%2

%3").arg(tr("There are less than %1 GB of free diskspace available on your system's TEMP folder.").arg(QString::number(minimumFreeDiskspaceMultiplier)), tr("It is highly recommend to free up more diskspace before proceeding with the encode!"), tr("Your TEMP folder is located at:")).append("
%3
").arg(tempFolderParts.join("\\")), tr("Abort Encoding Process"), tr("Clean Disk Now"), tr("Ignore"))) { case 1: QProcess::startDetached(QString("%1/cleanmgr.exe").arg(lamexp_known_folder(lamexp_folder_systemfolder)), QStringList() << "/D" << tempFolderParts.first()); @@ -762,7 +771,7 @@ void MainWindow::encodeButtonClicked(void) QFile writeTest(QString("%1/~%2.txt").arg(m_settings->outputDir(), QUuid::createUuid().toString())); if(!writeTest.open(QIODevice::ReadWrite)) { - QMessageBox::warning(this, tr("LameXP"), tr("Cannot write to the selected output directory.
%1

Please choose a different directory!").arg(m_settings->outputDir())); + QMessageBox::warning(this, tr("LameXP"), QString("%1
%2

%3").arg(tr("Cannot write to the selected output directory."), m_settings->outputDir(), tr("Please choose a different directory!"))); tabWidget->setCurrentIndex(1); return; } @@ -973,8 +982,6 @@ void MainWindow::languageActionActivated(QAction *action) { m_settings->currentLanguage(langId); } - - retranslateUi(this); } /* @@ -1149,7 +1156,7 @@ void MainWindow::makeFolderButtonClicked(void) } else { - QMessageBox::warning(this, tr("Failed to create folder"), tr("The new folder could not be created:
%1

Drive is read-only or insufficient access rights!").arg(basePath.absoluteFilePath(newFolder))); + QMessageBox::warning(this, tr("Failed to create folder"), QString("%1
%2

%3").arg(tr("The new folder could not be created:"), basePath.absoluteFilePath(newFolder), tr("Drive is read-only or insufficient access rights!"))); } } break; @@ -1604,7 +1611,7 @@ void MainWindow::disableUpdateReminderActionTriggered(bool checked) { if(QMessageBox::Yes == QMessageBox::question(this, tr("Disable Update Reminder"), tr("Do you really want to disable the update reminder?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) { - QMessageBox::information(this, tr("Update Reminder"), tr("The update reminder has been disabled.
Please remember to check for updates at regular intervals!")); + QMessageBox::information(this, tr("Update Reminder"), QString("%1
%2").arg(tr("The update reminder has been disabled."), tr("Please remember to check for updates at regular intervals!"))); m_settings->autoUpdateEnabled(false); } else diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h index 602ea7cc..c8fd2f51 100644 --- a/src/Dialog_MainWindow.h +++ b/src/Dialog_MainWindow.h @@ -103,7 +103,7 @@ protected: void closeEvent(QCloseEvent *event); void resizeEvent(QResizeEvent *event); bool eventFilter(QObject *obj, QEvent *event); - void retranslateUi(QMainWindow *MainWindow); + void changeEvent(QEvent *e); private: void addFiles(const QStringList &files);