OSDN Git Service

More internationalization and localization... (again)
authorlordmulder <mulder2@gmx.de>
Thu, 30 Dec 2010 16:34:19 +0000 (17:34 +0100)
committerlordmulder <mulder2@gmx.de>
Thu, 30 Dec 2010 16:34:19 +0000 (17:34 +0100)
etc/Translation/LameXP_DE.ts
gui/DropBox.ui
res/localization/LameXP_DE.qm
src/Config.h
src/Dialog_DropBox.cpp
src/Dialog_DropBox.h
src/Dialog_MainWindow.cpp
src/Dialog_MainWindow.h

index 413c488..566f868 100644 (file)
@@ -8,9 +8,17 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&lt;b&gt;LameXP DropBox&lt;/b&gt;&lt;br&gt;&lt;nobr&gt;You can add files to LameXP via Drag&amp;amp;Drop here!&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;(Right-click to close the DropBox)&lt;/nobr&gt;</source>
+        <source>LameXP DropBox</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>You can add files to LameXP via Drag&amp;amp;Drop here!</source>
+        <translation type="unfinished">Sie könner hier Dateien per Drag&amp;amp;Drop hinzufügen!</translation>
+    </message>
+    <message>
+        <source>(Right-click to close the DropBox)</source>
+        <translation type="unfinished">(Rechts-klicken um die DropBox zu schließen)</translation>
+    </message>
 </context>
 <context>
     <name>LogViewDialog</name>
@@ -306,7 +314,7 @@ RUN\DOS\RUN
     </message>
     <message>
         <source>You can drop in audio files here!</source>
-        <translation type="unfinished">Sie können hier Audio-Dateien per Drag&amp;Drop einfügen!</translation>
+        <translation type="unfinished">Sie können hier Audio-Dateien hinein ziehen!</translation>
     </message>
     <message>
         <source>Open File in External Application</source>
@@ -370,50 +378,14 @@ LameXP is free software and release versions won&apos;t expire.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&lt;nobr&gt;LameXP detected that your version of the Nero AAC encoder is outdated!&lt;br&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The current version available is %1 (or later), but you still have version %2 installed.&lt;br&gt;&lt;br&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can download the latest version of the Nero AAC encoder from the Nero website at:&lt;br&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>AAC Encoder Outdated</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&lt;nobr&gt;The Nero AAC encoder could not be found. AAC encoding support will be disabled.&lt;br&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please put &apos;neroAacEnc.exe&apos;, &apos;neroAacDec.exe&apos; and &apos;neroAacTag.exe&apos; into the LameXP directory!&lt;br&gt;&lt;br&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your LameXP directory is located here:&lt;br&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can download the Nero AAC encoder for free from the official Nero website at:&lt;br&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>AAC Support Disabled</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&lt;nobr&gt;LameXP has detected that the WMA File Decoder component is not currently installed on your system.&lt;br&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You won&apos;t be able to process WMA files as input unless the WMA File Decoder component is installed!&lt;/nobr&gt;</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>WMA Decoder Missing</source>
         <translation type="unfinished"></translation>
     </message>
@@ -430,10 +402,6 @@ LameXP is free software and release versions won&apos;t expire.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&lt;nobr&gt;There are less than %1 GB of free diskspace available on your system&apos;s TEMP folder.&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;It is highly recommend to free up more diskspace before proceeding with the encode!&lt;/nobr&gt;&lt;br&gt;&lt;br&gt;Your TEMP folder is located at:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Abort Encoding Process</source>
         <translation type="unfinished"></translation>
     </message>
@@ -458,10 +426,6 @@ LameXP is free software and release versions won&apos;t expire.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot write to the selected output directory.&lt;br&gt;&lt;nobr&gt;%1&lt;/nobr&gt;&lt;br&gt;&lt;br&gt;Please choose a different directory!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Add file(s)</source>
         <translation type="unfinished"></translation>
     </message>
@@ -482,10 +446,6 @@ LameXP is free software and release versions won&apos;t expire.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The new folder could not be created:&lt;br&gt;&lt;nobr&gt;%1&lt;/nobr&gt;&lt;br&gt;&lt;br&gt;Drive is read-only or insufficient access rights!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Already running</source>
         <translation type="unfinished"></translation>
     </message>
@@ -514,10 +474,6 @@ LameXP is free software and release versions won&apos;t expire.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The update reminder has been disabled.&lt;br&gt;Please remember to check for updates at regular intervals!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>The update reminder has been re-enabled.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -622,15 +578,95 @@ LameXP is free software and release versions won&apos;t expire.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&lt;nobr&gt;%1 file(s) have been rejected, because read access was not granted!&lt;br&gt;This usually means the file is locked by another process.&lt;/nobr&gt;</source>
+        <source>Files Rejected</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Files Rejected</source>
+        <source>LameXP detected that your version of the Nero AAC encoder is outdated!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The current version available is %1 (or later), but you still have version %2 installed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You can download the latest version of the Nero AAC encoder from the Nero website at:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The Nero AAC encoder could not be found. AAC encoding support will be disabled.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please put &apos;neroAacEnc.exe&apos;, &apos;neroAacDec.exe&apos; and &apos;neroAacTag.exe&apos; into the LameXP directory!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Your LameXP directory is located here:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You can download the Nero AAC encoder for free from the official Nero website at:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>LameXP has detected that the WMA File Decoder component is not currently installed on your system.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You won&apos;t be able to process WMA files as input unless the WMA File Decoder component is installed!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot write to the selected output directory.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please choose a different directory!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The new folder could not be created:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Drive is read-only or insufficient access rights!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>There are less than %1 GB of free diskspace available on your system&apos;s TEMP folder.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>It is highly recommend to free up more diskspace before proceeding with the encode!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Your TEMP folder is located at:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 file(s) have been rejected, because read access was not granted!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>This usually means the file is locked by another process.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 file(s) have been rejected, because the file format could not be recognized!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>This usually means the file is damaged or the file format is not supported.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The update reminder has been disabled.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&lt;nobr&gt;%1 file(s) have been rejected, because the file format could not be recognized!&lt;br&gt;This usually means the file is damaged or the file format is not supported.&lt;/nobr&gt;</source>
+        <source>Please remember to check for updates at regular intervals!</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
index c828b1f..f89b2c9 100644 (file)
@@ -25,9 +25,6 @@
     <layout class="QGridLayout" name="gridLayout">
      <item row="0" column="1">
       <widget class="QLabel" name="dropBoxLabel">
-       <property name="toolTip">
-        <string>&lt;b&gt;LameXP DropBox&lt;/b&gt;&lt;br&gt;&lt;nobr&gt;You can add files to LameXP via Drag&amp;amp;Drop here!&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;(Right-click to close the DropBox)&lt;/nobr&gt;</string>
-       </property>
        <property name="lineWidth">
         <number>0</number>
        </property>
@@ -54,6 +51,7 @@
   <include location="../res/Images.qrc"/>
   <include location="../res/Images.qrc"/>
   <include location="../res/Images.qrc"/>
+  <include location="../res/Images.qrc"/>
  </resources>
  <connections/>
 </ui>
index 741f482..c5c0faa 100644 (file)
Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ
index fd4e5be..ccbbbbf 100644 (file)
@@ -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
 
 /*
index 258e4a2..0ca3b7f 100644 (file)
@@ -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("<b>%1</b><br><nobr>%2</nobr><br><nobr>%3</nobr>").arg(tr("LameXP DropBox"), tr("You can add files to LameXP via Drag&amp;Drop here!"), tr("(Right-click to close the DropBox)")));
+       }
+}
+
+
 void DropBox::showEvent(QShowEvent *event)
 {
        QRect screenGeometry = QApplication::desktop()->availableGeometry();
index 5256338..a9b1b53 100644 (file)
@@ -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);
 };
index e743ba5..59e2c29 100644 (file)
@@ -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<QAction*> 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);
 }
 
 ////////////////////////////////////////////////////////////
@@ -363,25 +369,6 @@ MainWindow::~MainWindow(void)
 ////////////////////////////////////////////////////////////
 
 /*
- * 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
  */
 void MainWindow::addFiles(const QStringList &files)
@@ -401,11 +388,11 @@ void MainWindow::addFiles(const QStringList &files)
 
        if(analyzer->filesDenied())
        {
-               QMessageBox::warning(this, tr("Access Denied"), tr("<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>").arg(analyzer->filesDenied()));
+               QMessageBox::warning(this, tr("Access Denied"), QString("<nobr>%1<br>%2</nobr>").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("<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>").arg(analyzer->filesRejected()));
+               QMessageBox::warning(this, tr("Files Rejected"), QString("<nobr>%1<br>%2</nobr>").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);
@@ -442,6 +429,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
  */
 void MainWindow::dragEnterEvent(QDragEnterEvent *event)
@@ -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("<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:").append("<br><nobr><i><a href=\"file:///%3\">%3</a></i></nobr><br>").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("<nobr>%1</nobr><br><nobr>%2</nobr><br><br>%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("<br><nobr><i><a href=\"file:///%3\">%3</a></i></nobr><br>").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.<br><nobr>%1</nobr><br><br>Please choose a different directory!").arg(m_settings->outputDir()));
+                       QMessageBox::warning(this, tr("LameXP"), QString("%1<br><nobr>%2</nobr><br><br>%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:<br><nobr>%1</nobr><br><br>Drive is read-only or insufficient access rights!").arg(basePath.absoluteFilePath(newFolder)));
+                               QMessageBox::warning(this, tr("Failed to create folder"), QString("%1<br><nobr>%2</nobr><br><br>%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.<br>Please remember to check for updates at regular intervals!"));
+                       QMessageBox::information(this, tr("Update Reminder"), QString("%1<br>%2").arg(tr("The update reminder has been disabled."), tr("Please remember to check for updates at regular intervals!")));
                        m_settings->autoUpdateEnabled(false);
                }
                else
index 602ea7c..c8fd2f5 100644 (file)
@@ -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);