-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize: add qtwebengine zh_CN support
- Loading branch information
1 parent
edf8c8d
commit df7fb33
Showing
5 changed files
with
493 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* This file is (c) 2008-2012 Konstantin Isakov <[email protected]> | ||
/* This file is (c) 2008-2012 Konstantin Isakov <[email protected]> | ||
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */ | ||
|
||
#include <stdio.h> | ||
|
@@ -385,31 +385,23 @@ int main( int argc, char ** argv ) | |
if( !cfg.preferences.interfaceLanguage.isEmpty() && localeName != cfg.preferences.interfaceLanguage ) | ||
{ | ||
localeName = cfg.preferences.interfaceLanguage; | ||
QLocale locale( localeName ); | ||
QLocale::setDefault( locale ); | ||
if( !qtTranslator.load( "qt_" + localeName, Config::getLocDir() ) ) | ||
{ | ||
qtTranslator.load( "qt_" + localeName, QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ); | ||
app.installTranslator( &qtTranslator ); | ||
} | ||
|
||
translator.load( Config::getLocDir() + "/" + localeName ); | ||
app.installTranslator( &translator ); | ||
} | ||
else | ||
{ | ||
QString localeName = QLocale::system().name(); | ||
|
||
|
||
if( !qtTranslator.load( "qt_" + localeName, Config::getLocDir() ) ) | ||
{ | ||
qtTranslator.load( "qt_" + localeName, QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ); | ||
QLocale locale( localeName ); | ||
QLocale::setDefault( locale ); | ||
if( !qtTranslator.load( "qt_" + localeName, Config::getLocDir() ) ) | ||
{ | ||
qtTranslator.load( "qt_" + localeName, QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ); | ||
app.installTranslator( &qtTranslator ); | ||
} | ||
|
||
app.installTranslator( &qtTranslator ); | ||
} | ||
translator.load( Config::getLocDir() + "/" + localeName ); | ||
app.installTranslator( &translator ); | ||
|
||
translator.load( Config::getLocDir() + "/" + localeName ); | ||
app.installTranslator( &translator ); | ||
QTranslator webengineTs; | ||
if( webengineTs.load( "qtwebengine_" + localeName, Config::getLocDir() ) ) | ||
{ | ||
app.installTranslator( &webengineTs ); | ||
} | ||
|
||
// Prevent app from quitting spontaneously when it works with scan popup | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
qt webengine lacks the translation of chinese . | ||
this file is a compilation of this qwebengine_zh_CN.ts | ||
(https://codereview.qt-project.org/c/qt/qttranslations/+/399180) . | ||
|
||
provided as a temporarily way to support zh_CN. | ||
|
||
|
Binary file not shown.
Oops, something went wrong.