Merge pull request #1645 from xiaoyifang/opt/rtl-layout

opt: layout according to the language
This commit is contained in:
xiaoyifang 2024-07-06 17:56:53 +08:00 committed by GitHub
commit 6cb7be70ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -556,6 +556,8 @@ int main( int argc, char ** argv )
QLocale locale( localeName ); QLocale locale( localeName );
QLocale::setDefault( locale ); QLocale::setDefault( locale );
QApplication::setLayoutDirection( locale.textDirection() );
if ( !qtTranslator.load( "qt_extra_" + localeName, Config::getLocDir() ) ) { if ( !qtTranslator.load( "qt_extra_" + localeName, Config::getLocDir() ) ) {
qtTranslator.load( "qt_extra_" + localeName, QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ); qtTranslator.load( "qt_extra_" + localeName, QLibraryInfo::location( QLibraryInfo::TranslationsPath ) );
app.installTranslator( &qtTranslator ); app.installTranslator( &qtTranslator );