diff --git a/config.cc b/config.cc index 1139a2c3..113a3304 100644 --- a/config.cc +++ b/config.cc @@ -2285,13 +2285,17 @@ QString getProgramDataDir() throw() #endif } -QString getLocDir() throw() +QString getEmbedLocDir() throw() { return ":/locale"; -// if ( QDir( getProgramDataDir() ).cd( "locale" ) ) -// return getProgramDataDir() + "/locale"; -// else -// return QCoreApplication::applicationDirPath() + "/locale"; +} + +QString getLocDir() throw() +{ + if ( QDir( getProgramDataDir() ).cd( "locale" ) ) + return getProgramDataDir() + "/locale"; + else + return QCoreApplication::applicationDirPath() + "/locale"; } QString getHelpDir() throw() diff --git a/config.hh b/config.hh index 87e718b0..117478f9 100644 --- a/config.hh +++ b/config.hh @@ -801,6 +801,7 @@ QString getUserQtCssFileName() ; QString getProgramDataDir() throw(); /// Returns the directory storing program localizized files (.qm). +QString getEmbedLocDir() throw(); QString getLocDir() throw(); /// Returns the directory storing program help files (.qch). diff --git a/main.cc b/main.cc index 731e8864..1adf5097 100644 --- a/main.cc +++ b/main.cc @@ -396,7 +396,7 @@ int main( int argc, char ** argv ) app.installTranslator( &qtTranslator ); } - translator.load( Config::getLocDir() + "/" + localeName ); + translator.load( Config::getEmbedLocDir() + "/" + localeName ); app.installTranslator( &translator ); QTranslator webengineTs; diff --git a/preferences.cc b/preferences.cc index f2bb9bb3..8ec85622 100644 --- a/preferences.cc +++ b/preferences.cc @@ -63,7 +63,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ): // See which other translations do we have - QStringList availLocs = QDir( Config::getLocDir() ).entryList( QStringList( "*.qm" ), + QStringList availLocs = QDir( Config::getEmbedLocDir() ).entryList( QStringList( "*.qm" ), QDir::Files ); // We need to sort by language name -- otherwise list looks really weird