summaryrefslogtreecommitdiffabout
path: root/korganizer/koprefs.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koprefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index f3231ff..042046e 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -400,22 +400,26 @@ void KOPrefs::usrReadConfig()
mLocaleDict->insert( fw, new QString (germanwords[i] [1] ));
++i;
fw = germanwords[i] [0];
}
setLocaleDict( mLocaleDict );
- }
- if ( mPreferredLanguage == 3 ) {
- QString fileName = MainWindow::resourcePath()+"usertranslation.txt";
+ } else {
+ QString fileName ;
+ if ( mPreferredLanguage == 3 )
+ fileName = MainWindow::resourcePath()+"usertranslation.txt";
+ else if ( mPreferredLanguage == 2 )
+ fileName = MainWindow::resourcePath()+"frenchtranslation.txt";
+ else return;
QFile file( fileName );
if (file.open( IO_ReadOnly ) ) {
QTextStream ts( &file );
ts.setCodec( QTextCodec::codecForLocale() );
QString text = ts.read();
file.close();
-
+ text.replace( QRegExp("\\\\n"), "\n" );
QString line;
QString we;
QString wt;
int br = 0;
int nbr;
nbr = text.find ( "},", br );
@@ -439,15 +443,16 @@ void KOPrefs::usrReadConfig()
br = nbr+1;
}
//qDebug("end *%s* ", end.latin1());
setLocaleDict( mLocaleDict );
} else {
- qDebug("KO: Cannot find translation file usertranslation.txt");
+ qDebug("KO: Cannot find translation file %s",fileName.latin1() );
}
- }
+
+}
config()->setGroup("General");
mCustomCategories = config()->readListEntry("Custom Categories");
if ( KOPrefs::instance()->mLanguageChanged ) {
mLocationDefaults.clear();
mEventSummaryUser.clear();