-rw-r--r-- | microkde/kdecore/klocale.cpp | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp index 3674f28..21e6937 100644 --- a/microkde/kdecore/klocale.cpp +++ b/microkde/kdecore/klocale.cpp @@ -8,2 +8,4 @@ +#include <qstringlist.h> +QStringList missingTrans; @@ -15,6 +17,41 @@ void setLocaleDict( QDict<QString> * dict ) } +void addMissing(const char *text) +{ + return; + QString mis ( text ); + if ( !missingTrans.contains( mis ) ) + missingTrans.append(mis); + +} + +#include <qfile.h> +#include <qtextstream.h> +#include <qtextcodec.h> +void dumpMissing() +{ + return; + QString fileName = "/tmp/usertrans.txt"; + QFile file( fileName ); + if (!file.open( IO_WriteOnly ) ) { + return ; + } + QTextStream ts( &file ); + ts.setCodec( QTextCodec::codecForName("utf8") ); + + int i; + for ( i = 0; i< missingTrans.count(); ++i ) { + + QString text = missingTrans[i].replace( QRegExp("\n"),"\\n" ); + ts << "{ \""<<text<< "\",\""<< text <<"\" },\n"; + + } + file.close(); +} + QString i18n(const char *text) { - if ( ! mLocaleDict ) + if ( ! mLocaleDict ) { + addMissing( text ); return QString( text ); + } else { @@ -22,2 +59,3 @@ QString i18n(const char *text) if ( ret == 0 ) { + addMissing( text ); return QString( text ); @@ -25,4 +63,6 @@ QString i18n(const char *text) else { - if ( (*ret).isEmpty() ) + if ( (*ret).isEmpty() ) { + addMissing( text ); return QString( text ); + } else |