CVS commit by ariya: as suggested by Nicolas, no translation for the test framework (since it won't be visible to users). however using already-used strings that are introduced somewhere else, e.g. "True", should be OK M +9 -8 testrunner.cc 1.4 M +7 -8 value_tester.cc 1.2 --- koffice/kspread/tests/testrunner.cc #1.3:1.4 @@ -27,5 +27,4 @@ #include #include -#include #include @@ -51,5 +50,5 @@ using namespace KSpread; TestRunner::TestRunner(): - KDialogBase( KDialogBase::Plain, i18n( "Internal Tests"), KDialogBase::Close, + KDialogBase( KDialogBase::Plain, "Internal Tests", KDialogBase::Close, KDialogBase::Close ) { @@ -60,5 +59,5 @@ TestRunner::TestRunner(): setMinimumSize( 360, 230 ); - QLabel* typeLabel = new QLabel( i18n("Type of Test:"), mainWidget ); + QLabel* typeLabel = new QLabel( "Type of Test:", mainWidget ); layout->addWidget( typeLabel, 0, 0 ); @@ -69,5 +68,5 @@ TestRunner::TestRunner(): layout->addItem( spacerItem, 0, 2 ); - d->runButton = new KPushButton( i18n("Run"), mainWidget ); + d->runButton = new KPushButton( "Run", mainWidget ); layout->addWidget( d->runButton, 0, 3 ); @@ -103,10 +102,10 @@ void TestRunner::runTest() { d->logView->clear(); - d->logView->append( i18n("Test: %1").arg( testName ) ); + d->logView->append( QString("Test: %1").arg( testName ) ); tester->run(); QStringList errorList = tester->errors(); if( tester->failed() ) { - d->logView->append( i18n( "1 test, %1 failed.", "%n tests, %1 failed.", tester->count() ). + d->logView->append( QString( "%1 tests, %2 failed.").arg( tester->count() ). arg( tester->failed() ) ); for( unsigned k = 0; k < errorList.count(); k++ ) @@ -114,6 +113,7 @@ void TestRunner::runTest() } else - d->logView->append( i18n( "1 test, everything is OK.", "%n tests, everything is OK.", tester->count() ) ); - d->logView->append( i18n("Test finished.") ); + d->logView->append( QString( "%1 tests, everything is OK." ).arg( tester->count() ) ); + + d->logView->append( "Test finished." ); } } --- koffice/kspread/tests/value_tester.cc #1.1:1.2 @@ -23,5 +23,4 @@ #include -#include #include @@ -36,5 +35,5 @@ ValueTester::ValueTester(): Tester() QString ValueTester::name() { - return i18n("Value"); + return QString("Value"); } @@ -47,8 +46,8 @@ void ValueTester::check( const char* msg QString msg; QTextStream ts( &msg, IO_WriteOnly ); - ts << i18n("Result:" ); + ts << "Result:"; ts << result; ts << ", "; - ts << i18n("Expected:" ); + ts << "Expected:"; ts << expected; fail( __FILE__, __LINE__, msg ); @@ -63,9 +62,9 @@ void ValueTester::check( const char* msg QString msg; QTextStream ts( &msg, IO_WriteOnly ); - ts << i18n("Result:" ); - if( result ) ts << i18n("True"); else i18n("False"); + ts << "Result: "; + if( result ) ts << "True"; else "False"; ts << ", "; - ts << i18n("Expected:" ); - if( expected ) ts << i18n("True"); else i18n("False"); + ts << "Expected: "; + if( expected ) ts << "True"; else "False"; fail( __FILE__, __LINE__, msg ); }