From 37305972fccd1da923f9e5b0fffe46e4c813db41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 12 Feb 2012 02:55:48 +0100 Subject: [PATCH] GUI: Removed translations for english. There is no reason to translate a string from english to english. --- gui/cppcheck_en.ts | 1533 ------------------------------------ gui/gui.pro | 1 - gui/translationhandler.cpp | 17 +- 3 files changed, 7 insertions(+), 1544 deletions(-) delete mode 100644 gui/cppcheck_en.ts diff --git a/gui/cppcheck_en.ts b/gui/cppcheck_en.ts deleted file mode 100644 index c5ade2d77..000000000 --- a/gui/cppcheck_en.ts +++ /dev/null @@ -1,1533 +0,0 @@ - - - - - About - - - About Cppcheck - About Cppcheck - - - - Version %1 - Version %1 - - - - Cppcheck - A tool for static C/C++ code analysis. - Cppcheck - A tool for static C/C++ code analysis. - - - - Copyright © 2007-2011 Daniel Marjamäki and cppcheck team. - Copyright © 2007-2010 Daniel Marjamäki and cppcheck team. - Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team. - - - - This program is licensed under the terms -of the GNU General Public License version 3 - This program is licensed under the terms -of the GNU General Public License version 3 - - - - Visit Cppcheck homepage at %1 - Visit Cppcheck homepage at %1 - - - - ApplicationDialog - - - Add an application - Add a new application - - - - Here you can add an application that can open error files. Specify a name for the application, the application executable and command line parameters for the application. - -The following texts in parameters are replaced with appropriate values when application is executed: -(file) - Filename containing the error -(line) - Line number containing the error -(message) - Error message -(severity) - Error severity - -Example opening a file with Kate and make Kate scroll to the correct line: -Executable: kate -Parameters: -l(line) (file) - - - - - &Name: - - - - - &Executable: - - - - - &Parameters: - - - - - Browse - Browse - - - - Executable files (*.exe);;All files(*.*) - Executable files (*.exe);;All files(*.*) - - - - Select viewer application - Select viewer application - - - - Cppcheck - Cppcheck - - - - You must specify a name, a path and parameters for the application! - - - - - FileViewDialog - - - Could not find the file: %1 - Could not find the file: - - Could not find the file: %1 - - - - - Cppcheck - Cppcheck - - - - Could not read the file: %1 - Could not read the file: %1 - - - - LogView - - - Checking Log - - - - - &Save - - - - - Clear - - - - - Close - - - - - Save Log - - - - - Text files (*.txt *.log);;All files (*.*) - - - - - Cppcheck - Cppcheck - - - - Could not open file for writing: "%1" - - - - - MainWindow - - - - - - - - - - - - - Cppcheck - Cppcheck - - - - Standard - Standard - - - - &File - &File - - - - &View - &View - - - - &Toolbars - - - - - &Check - &Check - - - - &Edit - &Edit - - - - &License... - &License... - - - - A&uthors... - A&uthors... - - - - &About... - &About... - - - - &Files... - &Files... - - - - - Check files - - - - - Ctrl+F - Ctrl+F - - - - &Directory... - &Directory... - - - - - Check directory - - - - - Ctrl+D - Ctrl+D - - - - &Recheck files - &Recheck files - - - - Ctrl+R - Ctrl+R - - - - &Stop - &Stop - - - - - Stop checking - - - - - Esc - Esc - - - - &Save results to file... - &Save results to file... - - - - Ctrl+S - Ctrl+S - - - - &Quit - &Quit - - - - &Clear results - &Clear results - - - - &Preferences - &Preferences - - - - Errors - - - - - - Show errors - - - - - Warnings - - - - - - Show warnings - - - - - Performance warnings - - - - - - Show performance warnings - - - - - Show &hidden - - - - - Information - - - - - Show information messages - - - - - Portability - - - - - Show portability warnings - - - - - &Filter - - - - - Filter results - - - - - Project MRU placeholder - - - - - Windows 32-bit ANSI - - - - - Windows 32-bit Unicode - - - - - Unix 32-bit - - - - - Unix 64-bit - - - - - Windows 64-bit - - - - - Platforms - - - - - C++11 - - - - - C99 - - - - - Posix - - - - - &Check all - &Check all - - - - Filter - - - - - &Uncheck all - &Uncheck all - - - - Collapse &all - Collapse &all - - - - &Expand all - &Expand all - - - - &Standard - - - - - Standard items - - - - - Toolbar - - - - - &Categories - - - - - Error categories - - - - - &Open XML... - - - - - Open P&roject File... - - - - - &New Project File... - - - - - &Log View - - - - - Log View - - - - - C&lose Project File - - - - - &Edit Project File... - - - - - &Statistics - - - - - &Contents - - - - - Categories - - - - - Style warnings - - - - - - Show style warnings - - - - - Open the help contents - - - - - F1 - - - - - &Help - &Help - - - Select files to check - Select files to check - - - - Select directory to check - Select directory to check - - - - No suitable files found to check! - No suitable files found to check! - - - - Quick Filter: - - - - - Found project file: %1 - -Do you want to load this project file instead? - - - - - Found project files from the directory. - -Do you want to proceed checking without using any of these project files? - - - - - License - License - - - - Authors - Authors - - - - XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) - XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) - XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) - - - - Save the report file - Save the report file - - - - XML files (*.xml) - XML files (*.xml) - - - - There was a problem with loading the editor application settings. - -This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - - - - - You must close the project file before selecting new files or directories! - - - - - Open the report file - - - - - Checking is running. - -Do you want to stop the checking and exit Cppcheck?. - - - - - XML files version 1 (*.xml) - - - - - XML files version 2 (*.xml) - - - - - Text files (*.txt) - Text files (*.txt) - - - - CSV files (*.csv) - - - - - Cppcheck - %1 - Cppcheck - %1 - - - - Failed to change the user interface language: - -%1 - -The user interface language has been reset to English. Open the Preferences-dialog to select any of the available languages. - - - - - - Project files (*.cppcheck);;All files(*.*) - - - - - Select Project File - - - - - - Project: - - - - - Select Project Filename - - - - - No project file loaded - - - - - The project file - -%1 - - could not be found! - -Do you want to remove the file from the recently used projects -list? - - - - - Finnish - Finnish - - - - English - English - - - - Dutch - - - - - French - - - - - Spanish - - - - - Swedish - Swedish - - - - German - German - - - - Russian - Russian - - - - Polish - Polish - - - - Japanese - Japanease - - - - - Serbian - Serbian - - - - Platforms - - - Build-in - - - - - Unix 32-bit - - - - - Unix 64-bit - - - - - Windows 32-bit ANSI - - - - - Windows 32-bit Unicode - - - - - Windows 64-bit - - - - - Project - - - - Cppcheck - Cppcheck - - - - Could not read the project file. - - - - - Could not write the project file. - - - - - ProjectFile - - - Project File - - - - - Project - - - - - Root: - - - - - - Paths: - - - - - - - Add... - - - - - - - Edit - - - - - - - Remove - - - - - Includes - - - - - Include directories: - - - - - Up - - - - - Down - - - - - Exclude - - - - - Defines: - - - - - ProjectFileDialog - - - Project file: %1 - - - - - Select include directory - - - - - Select a directory to check - - - - - Select directory to ignore - - - - - QObject - - - Unknown language specified! - - - - - Language file %1 not found! - Language file %1.qm not found! - Could not find the file: %1! - - - - Failed to load translation for language %1 from file %2 - Failed to load translation for language %1 from file %2.qm - Failed to load translation for language %1 from file %2 - - - - ResultsTree - - - - File - File - - - - - Severity - Severity - - - - - Line - Line - - - - - Summary - - - - - Undefined file - Undefined file - - - - - [Inconclusive] - - - - - debug - - - - - Copy filename - Copy filename - - - - Copy full path - Copy full path - - - - Copy message - - - - - Hide - - - - - - Cppcheck - Cppcheck - - - - No editor application configured. - -Configure the editor application for Cppcheck in preferences/Applications. - Configure the text file viewer program in Cppcheck preferences/Applications. - You can open this error by specifying applications in program's settings. - - - - No default editor application selected. - -Please select the default editor application in preferences/Applications. - - - - - Could not find the file! - - - - - Could not start %1 - -Please check the application path and parameters are correct. - Could not start %1 - -Please check the application path and parameters are correct. - - - - Could not find file: -%1 -Please select the directory where file is located. - - - - - Select Directory - - - - - style - Style - - - - error - Error - - - - warning - - - - - performance - - - - - portability - - - - - information - - - - - ResultsView - - - %p% (%1 of %2 files checked) - - - - - - Cppcheck - Cppcheck - - - - No errors found. - No errors found. - - - - Errors were found, but they are configured to be hidden. -To toggle what kind of errors are shown, open view menu. - Errors were found, but they are configured to be hidden. -To toggle what kind of errors are shown, open view menu. - - - - - - Failed to read the report. - - - - - Summary - - - - - Message - - - - - No errors found, nothing to save. - No errors found, nothing to save. - - - - - Failed to save the report. - Failed to save the report. - - - - Results - Results - - - - SelectFilesDialog - - - Select files to check - Select files to check - - - - Check - - - - - Settings - - - Preferences - Preferences - - - - General - General - - - - Include paths: - - - - - - Add... - - - - - Number of threads: - Number of threads: - - - - Ideal count: - - - - - TextLabel - - - - - Force checking all #ifdef configurations - Check all #ifdef configurations - Check all #ifdef configurations - - - - Show full path of files - Show full path of files - - - - Show "No errors found" message when no errors found - Show "No errors found" message when no errors found - - - - Enable inline suppressions - - - - - Paths - - - - - Edit - - - - - - Remove - - - - - Applications - Applications - - - - Edit... - - - - - Set as default - - - - - Reports - Reports - - - - Save all errors when creating report - Save all errors when creating report - - - - Save full path to files in reports - Save full path to files in reports - - - - Language - - - - - Advanced - - - - - &Show inconclusive errors - - - - - S&how internal warnings in log - - - - - SettingsDialog - - - N/A - - - - - Add a new application - Add a new application - - - - Modify an application - Modify an application - - - - [Default] - - - - - Select include directory - - - - - StatsDialog - - - - - Statistics - - - - - - Project - - - - - Project: - - - - - Paths: - - - - - Include paths: - - - - - Defines: - - - - - - Previous Scan - - - - - Path Selected: - - - - - Number of Files Scanned: - - - - - Scan Duration: - - - - - Errors: - - - - - Warnings: - - - - - Stylistic warnings: - - - - - Portability warnings: - - - - - - TextLabel - - - - - Performance issues: - - - - - Information messages: - - - - - Copy to Clipboard - - - - - 1 day - - - - - %1 days - - - - - 1 hour - - - - - %1 hours - - - - - 1 minute - - - - - %1 minutes - - - - - 1 second - - - - - %1 seconds - - - - - 0.%1 seconds - - - - - and - - - - - Project Settings - - - - - Paths - - - - - Include paths - - - - - Defines - - - - - Path selected - - - - - Number of files scanned - - - - - Scan duration - - - - - Errors - - - - - Warnings - - - - - Style warnings - - - - - Portability warnings - - - - - Performance warnings - - - - - Information messages - - - - - ThreadResult - - - %1 of %2 files checked - - - - - TxtReport - - - inconclusive - - - - diff --git a/gui/gui.pro b/gui/gui.pro index c97579827..d10ebe86a 100644 --- a/gui/gui.pro +++ b/gui/gui.pro @@ -34,7 +34,6 @@ FORMS = about.ui \ selectfilesdialog.ui TRANSLATIONS = cppcheck_de.ts \ - cppcheck_en.ts \ cppcheck_es.ts \ cppcheck_fi.ts \ cppcheck_fr.ts \ diff --git a/gui/translationhandler.cpp b/gui/translationhandler.cpp index 9c83c4fb5..eb541b930 100644 --- a/gui/translationhandler.cpp +++ b/gui/translationhandler.cpp @@ -25,7 +25,7 @@ TranslationHandler::TranslationHandler(QObject *parent) : QObject(parent), mCurrentLanguage("en"), - mTranslator(new QTranslator(this)) + mTranslator(NULL) { // Add our available languages // Keep this list sorted @@ -40,15 +40,6 @@ TranslationHandler::TranslationHandler(QObject *parent) : AddTranslation(QT_TRANSLATE_NOOP("MainWindow", "Serbian"), "cppcheck_sr"); AddTranslation(QT_TRANSLATE_NOOP("MainWindow", "Spanish"), "cppcheck_es"); AddTranslation(QT_TRANSLATE_NOOP("MainWindow", "Swedish"), "cppcheck_sv"); - - //Load English as a fallback language - QTranslator *english = new QTranslator(); - if (english->load("cppcheck_en")) { - qApp->installTranslator(english); - } else { - qDebug() << "Failed to load English translation!"; - delete english; - } } TranslationHandler::~TranslationHandler() @@ -71,6 +62,8 @@ bool TranslationHandler::SetLanguage(const QString &code, QString &error) //Just remove all extra translators if (mTranslator) { qApp->removeTranslator(mTranslator); + delete mTranslator; + mTranslator = NULL; } mCurrentLanguage = code; @@ -84,6 +77,10 @@ bool TranslationHandler::SetLanguage(const QString &code, QString &error) return false; } + // Make sure there is a translator + if (!mTranslator) + mTranslator = new QTranslator(this); + //Load the new language if (!mTranslator->load(mTranslations[index].mFilename)) { //If it failed, lets check if the default file exists