mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getLocDir() throw()
|
QString getEmbedLocDir() throw()
|
||||||
{
|
{
|
||||||
return ":/locale";
|
return ":/locale";
|
||||||
// if ( QDir( getProgramDataDir() ).cd( "locale" ) )
|
}
|
||||||
// return getProgramDataDir() + "/locale";
|
|
||||||
// else
|
QString getLocDir() throw()
|
||||||
// return QCoreApplication::applicationDirPath() + "/locale";
|
{
|
||||||
|
if ( QDir( getProgramDataDir() ).cd( "locale" ) )
|
||||||
|
return getProgramDataDir() + "/locale";
|
||||||
|
else
|
||||||
|
return QCoreApplication::applicationDirPath() + "/locale";
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getHelpDir() throw()
|
QString getHelpDir() throw()
|
||||||
|
|
|
@ -801,6 +801,7 @@ QString getUserQtCssFileName() ;
|
||||||
QString getProgramDataDir() throw();
|
QString getProgramDataDir() throw();
|
||||||
|
|
||||||
/// Returns the directory storing program localizized files (.qm).
|
/// Returns the directory storing program localizized files (.qm).
|
||||||
|
QString getEmbedLocDir() throw();
|
||||||
QString getLocDir() throw();
|
QString getLocDir() throw();
|
||||||
|
|
||||||
/// Returns the directory storing program help files (.qch).
|
/// 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 );
|
app.installTranslator( &qtTranslator );
|
||||||
}
|
}
|
||||||
|
|
||||||
translator.load( Config::getLocDir() + "/" + localeName );
|
translator.load( Config::getEmbedLocDir() + "/" + localeName );
|
||||||
app.installTranslator( &translator );
|
app.installTranslator( &translator );
|
||||||
|
|
||||||
QTranslator webengineTs;
|
QTranslator webengineTs;
|
||||||
|
|
|
@ -63,7 +63,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
|
||||||
|
|
||||||
// See which other translations do we have
|
// 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 );
|
QDir::Files );
|
||||||
|
|
||||||
// We need to sort by language name -- otherwise list looks really weird
|
// We need to sort by language name -- otherwise list looks really weird
|
||||||
|
|
Loading…
Reference in a new issue