diff --git a/gui/cppcheck_de.ts b/gui/cppcheck_de.ts
index 683491e2e..b2aa0aff4 100644
--- a/gui/cppcheck_de.ts
+++ b/gui/cppcheck_de.ts
@@ -18,7 +18,7 @@
-
+
@@ -116,10 +116,10 @@ kate -l(line) (file)
MainWindow
-
-
-
-
+
+
+
+
@@ -284,59 +284,59 @@ kate -l(line) (file)
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
%1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
QObject
@@ -356,13 +381,15 @@ Stop the checking before exiting.
-
-
+
+
+ Language file %1.qm not found!
-
+
+ Failed to load translation for language %1 from file %2.qm
diff --git a/gui/cppcheck_en.ts b/gui/cppcheck_en.ts
index 71843de9b..8ddee44eb 100644
--- a/gui/cppcheck_en.ts
+++ b/gui/cppcheck_en.ts
@@ -18,7 +18,7 @@
Cppcheck - A tool for static C/C++ code analysis.
-
+
Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.
@@ -129,10 +129,10 @@ kate -l(line) (file)
MainWindow
-
-
-
-
+
+
+
+
Cppcheck
@@ -297,22 +297,22 @@ kate -l(line) (file)
&Help
-
+
Select files to check
-
+
Select directory to check
-
+
No suitable files found to check!
-
+
@@ -321,37 +321,37 @@ Stop the checking before exiting.
Stop the checking before exiting.
-
+
License
-
+
Authors
-
+
XML files (*.xml);;Text files (*.txt)
-
+
Save the report file
-
+
XML files (*.xml)
-
+
Cppcheck - %1
-
+
+
+
+
+ Finnish
+
+
+
+
+ English
+
+
+
+
+ Swedish
+
+
+
+
+ German
+
+
+
+
+ Russian
+
QObject
-
-
- English
-
-
-
- Finnish
-
-
-
- Swedish
-
-
-
- German
-
-
-
- Russian
-
Incorrect language specified!
-
-
-
+
+
+ Language file %1.qm not found!
+ Could not find the file: %1!
-
- Failed to load language from file %1
+
+ Failed to load translation for language %1 from file %2.qm
+ Failed to load translation for language %1 from file %2
@@ -453,7 +460,7 @@ Stop the checking before exiting.
You can open this error by specifying applications in program's settings.
- You can open this error by specifying applications in program's settings.
+ You can open this error by specifying applications in program's settings.
diff --git a/gui/cppcheck_fi.ts b/gui/cppcheck_fi.ts
index 1f327b6f1..361ba3f91 100644
--- a/gui/cppcheck_fi.ts
+++ b/gui/cppcheck_fi.ts
@@ -18,7 +18,7 @@
Cppcheck - Työkalu C/C++ koodin staattiseen analysointiin.
-
+
Copyright (C) 2007-2009 Daniel Marjamäki ja cppcheck tiimi.
@@ -131,10 +131,10 @@ kate -l(line) (file)
MainWindow
-
-
-
-
+
+
+
+
Cppcheck
@@ -299,22 +299,22 @@ kate -l(line) (file)
&Ohje
-
+
Valitse tarkistettavat tiedostot
-
+
Valitse tarkistettava hakemisto
-
+
Tarkistettavaksi sopivia tiedostoja ei löytynyt!
-
+
@@ -323,37 +323,37 @@ Stop the checking before exiting.
Lopeta tarkistus ennen ohjelman sammuttamista.
-
+
Lisenssi
-
+
Tekijät
-
+
XML-tiedostot (*.xml);;Tekstitiedostot (*.txt)
-
+
Tallenna raportti
-
+
XML-tiedostot (*xml)
-
+
Cppcheck - %1
-
+
+
+
+
+ Suomi
+
+
+
+
+ Englanti
+
+
+
+
+ Ruotsi
+
+
+
+
+ Saksa
+
+
+
+
+ Venäjä
QObject
-
-
- Englanti
-
-
-
- Suomi
-
-
-
- Ruotsi
-
-
-
- Saksa
-
-
-
- Venäjä
-
Virheellinen kieli valittu!
-
-
-
+
+
+ Language file %1.qm not found!
+ Käännöstiedostoa %1 ei löytynyt!
-
- Kielen lataaminen tiedostosta %1 epäonnistui
+
+ Failed to load translation for language %1 from file %2.qm
+ Käänöksen lataaminen kielelle %1 tiedostosta %2 epäonnistui
@@ -453,7 +464,7 @@ Lopeta tarkistus ennen ohjelman sammuttamista.
You can open this error by specifying applications in program's settings.
- Voit asetuksista määritellä muita ohjelmia joilla avata tämän virheen sisältävän tiedoston.
+ Voit asetuksista määritellä muita ohjelmia joilla avata tämän virheen sisältävän tiedoston.
diff --git a/gui/cppcheck_ru.ts b/gui/cppcheck_ru.ts
index 58d74a3c7..15be0f364 100644
--- a/gui/cppcheck_ru.ts
+++ b/gui/cppcheck_ru.ts
@@ -18,7 +18,7 @@
-
+
@@ -118,10 +118,10 @@ kate -l(line) (file)
MainWindow
-
-
-
-
+
+
+
+
@@ -286,59 +286,59 @@ kate -l(line) (file)
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
%1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
QObject
@@ -358,13 +383,15 @@ Stop the checking before exiting.
-
-
+
+
+ Language file %1.qm not found!
-
+
+ Failed to load translation for language %1 from file %2.qm
diff --git a/gui/cppcheck_se.ts b/gui/cppcheck_se.ts
index 58d74a3c7..15be0f364 100644
--- a/gui/cppcheck_se.ts
+++ b/gui/cppcheck_se.ts
@@ -18,7 +18,7 @@
-
+
@@ -118,10 +118,10 @@ kate -l(line) (file)
MainWindow
-
-
-
-
+
+
+
+
@@ -286,59 +286,59 @@ kate -l(line) (file)
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
%1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
QObject
@@ -358,13 +383,15 @@ Stop the checking before exiting.
-
-
+
+
+ Language file %1.qm not found!
-
+
+ Failed to load translation for language %1 from file %2.qm
diff --git a/gui/translationhandler.cpp b/gui/translationhandler.cpp
index 5c52346b4..d1c758f9a 100644
--- a/gui/translationhandler.cpp
+++ b/gui/translationhandler.cpp
@@ -28,11 +28,11 @@ TranslationHandler::TranslationHandler(QObject *parent) :
mTranslator(new QTranslator(this))
{
//Add our default languages
- mNames << "English"
- << "Finnish"
- << "Swedish"
- << "German"
- << "Russian";
+ mNames << QT_TRANSLATE_NOOP("MainWindow","English")
+ << QT_TRANSLATE_NOOP("MainWindow","Finnish")
+ << QT_TRANSLATE_NOOP("MainWindow","Swedish")
+ << QT_TRANSLATE_NOOP("MainWindow","German")
+ << QT_TRANSLATE_NOOP("MainWindow","Russian");
mFiles << "cppcheck_en"
<< "cppcheck_fi"
@@ -92,8 +92,18 @@ bool TranslationHandler::SetLanguage(const int index, QString &error)
//Load the new language
if (!mTranslator->load(mFiles[index]))
{
- error = QObject::tr("Failed to load language from file %1");
- error = error.arg(mFiles[index]);
+ //If it failed, lets check if the default file exists
+ if (!QFile::exists(mFiles[index]+".qm"))
+ {
+ error = QObject::tr("Language file %1 not found!");
+ error = error.arg(mFiles[index]+".qm");
+ return false;
+ }
+
+ //If file exists, there's something wrong with it
+ error = QObject::tr("Failed to load translation for language %1 from file %2");
+ error = error.arg(mNames[index]);
+ error = error.arg(mFiles[index]+".qm");
return false;
}