mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
fix:a regression .ctrl+c on article right context menu ,translation lost .
This commit is contained in:
parent
e85c719577
commit
4648d95b94
14
config.cc
14
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()
|
||||
|
|
|
@ -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).
|
||||
|
|
2
main.cc
2
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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue