summaryrefslogtreecommitdiffabout
path: root/microkde/kdecore
Side-by-side diff
Diffstat (limited to 'microkde/kdecore') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/klocale.cpp44
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
@@ -6,6 +6,8 @@
#include "klocale.h"
+#include <qstringlist.h>
+QStringList missingTrans;
QDict<QString> *mLocaleDict = 0;
void setLocaleDict( QDict<QString> * dict )
@@ -13,18 +15,56 @@ void setLocaleDict( QDict<QString> * dict )
mLocaleDict = 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 {
QString* ret = mLocaleDict->find(QString(text)) ;
if ( ret == 0 ) {
+ addMissing( text );
return QString( text );
}
else {
- if ( (*ret).isEmpty() )
+ if ( (*ret).isEmpty() ) {
+ addMissing( text );
return QString( text );
+ }
else
return (*ret);
}