[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/lib/kross
From:       Cyrille Berger <cyb () lepi ! org>
Date:       2006-03-21 23:42:34
Message-ID: 1142984554.894640.2351.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 521233 by berger:

fix untranslatable error messages in kross
CC:kde-i18n-doc@kde.org
BUG:122104


 M  +9 -8      api/variant.cpp  
 M  +4 -2      main/manager.cpp  
 M  +7 -5      main/scriptcontainer.cpp  


--- trunk/koffice/lib/kross/api/variant.cpp #521232:521233
@@ -20,6 +20,7 @@
 #include "variant.h"
 #include "list.h"
 
+#include <klocale.h>
 #include <kdebug.h>
 
 using namespace Kross::Api;
@@ -84,7 +85,7 @@
 {
     const QVariant& variant = toVariant(object);
     if(! variant.canCast(QVariant::String))
-        throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::String \
expected, but got %1.").arg(variant.typeName()).latin1()) ); +        throw \
Exception::Ptr( new Exception(QString(i18n("Kross::Api::Variant::String expected, but \
got %1.")).arg(variant.typeName()).latin1()) );  return variant.toString();
 }
 
@@ -92,7 +93,7 @@
 {
     const QVariant& variant = toVariant(object);
     if(! variant.canCast(QVariant::Int))
-        throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::Int \
expected, but got %1.").arg(variant.typeName()).latin1()) ); +        throw \
Exception::Ptr( new Exception(QString(i18n("Kross::Api::Variant::Int expected, but \
got %1.")).arg(variant.typeName()).latin1()) );  return variant.toInt();
 }
 
@@ -100,7 +101,7 @@
 {
     const QVariant& variant = toVariant(object);
     if(! variant.canCast(QVariant::UInt))
-        throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::UInt \
expected, but got %1.").arg(variant.typeName()).latin1()) ); +        throw \
Exception::Ptr( new Exception(QString(i18n("Kross::Api::Variant::UInt expected, but \
got %1.")).arg(variant.typeName()).latin1()) );  return variant.toUInt();
 }
 
@@ -108,7 +109,7 @@
 {
     const QVariant& variant = toVariant(object);
     if(! variant.canCast(QVariant::Double))
-        throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::Double \
expected, but got %1.").arg(variant.typeName()).latin1()) ); +        throw \
Exception::Ptr( new Exception(QString(i18n("Kross::Api::Variant::Double expected, but \
got %1.")).arg(variant.typeName()).latin1()) );  return variant.toDouble();
 }
 
@@ -116,7 +117,7 @@
 {
     const QVariant& variant = toVariant(object);
     if(! variant.canCast(QVariant::LongLong))
-        throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::LLONG \
expected, but got %1.").arg(variant.typeName()).latin1()) ); +        throw \
Exception::Ptr( new Exception(QString(i18n("Kross::Api::Variant::LLONG expected, but \
got %1.")).arg(variant.typeName()).latin1()) );  return variant.toLongLong();
 }
 
@@ -124,7 +125,7 @@
 {
     const QVariant& variant = toVariant(object);
     if(! variant.canCast(QVariant::ULongLong))
-        throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::ULLONG \
expected, but got %1.").arg(variant.typeName()).latin1()) ); +        throw \
Exception::Ptr( new Exception(QString(i18n("Kross::Api::Variant::ULLONG expected, but \
got %1.")).arg(variant.typeName()).latin1()) );  return variant.toULongLong();
 }
 
@@ -132,7 +133,7 @@
 {
     const QVariant& variant = toVariant(object);
     if(! variant.canCast(QVariant::Bool))
-        throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::Bool \
expected, but got %1.").arg(variant.typeName()).latin1()) ); +        throw \
Exception::Ptr( new Exception(QString(i18n("Kross::Api::Variant::Bool expected, but \
got %1.")).arg(variant.typeName()).latin1()) );  return variant.toBool();
 }
 
@@ -147,6 +148,6 @@
     }
     const QVariant& variant = toVariant(object);
     if(! variant.canCast(QVariant::List))
-        throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::List \
expected, but got '%1'.").arg(variant.typeName()).latin1()) ); +        throw \
Exception::Ptr( new Exception(QString(i18n("Kross::Api::Variant::List expected, but \
got '%1'.")).arg(variant.typeName()).latin1()) );  return variant.toList();
 }
--- trunk/koffice/lib/kross/main/manager.cpp #521232:521233
@@ -31,9 +31,11 @@
 #include <qobject.h>
 #include <qfile.h>
 #include <qregexp.h>
+
 #include <kdebug.h>
+#include <klibloader.h>
+#include <klocale.h>
 #include <kstaticdeleter.h>
-#include <klibloader.h>
 
 extern "C"
 {
@@ -176,7 +178,7 @@
     setException(0); // clear previous exceptions
 
     if(! d->interpreterinfos.contains(interpretername)) {
-        setException( new Exception(QString("No such interpreter \
'%1'").arg(interpretername)) ); +        setException( new Exception(QString(i18n("No \
such interpreter '%1'")).arg(interpretername)) );  return 0;
     }
 
--- trunk/koffice/lib/kross/main/scriptcontainer.cpp #521232:521233
@@ -27,6 +27,8 @@
 
 #include <qfile.h>
 
+#include <klocale.h>
+
 using namespace Kross::Api;
 
 namespace Kross { namespace Api {
@@ -200,7 +202,7 @@
         return 0;
 
     if(functionname.isEmpty()) {
-        setException( new Exception(QString("No functionname defined for \
ScriptContainer::callFunction().")) ); +        setException( new \
Exception(QString(i18n("No functionname defined for \
ScriptContainer::callFunction()."))) );  finalize();
         return 0;
     }
@@ -247,14 +249,14 @@
         if(d->interpretername.isNull()) {
             d->interpretername = \
Manager::scriptManager()->getInterpreternameForFile( d->scriptfile );  \
                if(d->interpretername.isNull()) {
-                setException( new Exception(QString("Failed to determinate \
interpreter for scriptfile '%1'").arg(d->scriptfile)) ); +                \
setException( new Exception(QString(i18n("Failed to determinate interpreter for \
scriptfile '%1'")).arg(d->scriptfile)) );  return false;
             }
         }
 
         QFile f( d->scriptfile );
         if(! f.open(IO_ReadOnly)) {
-            setException( new Exception(QString("Failed to open scriptfile \
'%1'").arg(d->scriptfile)) ); +            setException( new \
Exception(QString(i18n("Failed to open scriptfile '%1'")).arg(d->scriptfile)) );  \
return false;  }
         d->code = QString( f.readAll() );
@@ -263,13 +265,13 @@
 
     Interpreter* interpreter = \
Manager::scriptManager()->getInterpreter(d->interpretername);  if(! interpreter) {
-        setException( new Exception(QString("Unknown interpreter \
'%1'").arg(d->interpretername)) ); +        setException( new \
Exception(QString(i18n("Unknown interpreter '%1'")).arg(d->interpretername)) );  \
return false;  }
 
     d->script = interpreter->createScript(this);
     if(! d->script) {
-        setException( new Exception(QString("Failed to create script for interpreter \
'%1'").arg(d->interpretername)) ); +        setException( new \
Exception(QString(i18n("Failed to create script for interpreter \
'%1'")).arg(d->interpretername)) );  return false;
     }
     if(d->script->hadException()) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic