Skip to content

Commit

Permalink
fix load qt's language file
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaYen-Kan committed Aug 12, 2024
1 parent 14a86d9 commit 744df2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ jobs:
cp -rf build/lang/ ./dist/
- name: Deploy - Qt
run: |
windeployqt --no-opengl-sw --no-angle --no-system-d3d-compiler --no-translations --force ./dist/QuiteRSS.exe
- name: Deploy - Qt language file
run: |
cp $MSYSTEM_PREFIX/share/qt5/translations/qtbase_* ./dist/lang
windeployqt --no-opengl-sw --no-angle --no-system-d3d-compiler --force ./dist/QuiteRSS.exe
- name: Deploy - mingw
run: |
cp $MSYSTEM_PREFIX/bin/libcrypto-*.dll ./dist/
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/qmake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ jobs:
run: make release -j$(grep -c ^processor /proc/cpuinfo)
- name: Deploy - Qt
run: |
windeployqt --no-opengl-sw --no-angle --no-system-d3d-compiler --no-translations --force ./release/target/QuiteRSS.exe
- name: Deploy - Qt language file
run: |
cp $MSYSTEM_PREFIX/share/qt5/translations/qtbase_* ./release/target/lang
windeployqt --no-opengl-sw --no-angle --no-system-d3d-compiler --force ./release/target/QuiteRSS.exe
- name: Deploy - mingw
run: |
cp $MSYSTEM_PREFIX/bin/libcrypto-*.dll ./release/target/
Expand Down
4 changes: 3 additions & 1 deletion src/application/mainapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,10 @@ void MainApplication::setTranslateApplication()
if (!qt_translator_)
qt_translator_ = new QTranslator(this);
removeTranslator(qt_translator_);
#ifdef HAVE_X11
#if defined(HAVE_X11)
qt_translator_->load(QLibraryInfo::location (QLibraryInfo::TranslationsPath) + "/qtbase_" + langFileName_);
#elif defined(Q_OS_WIN)
qt_translator_->load(resourcesDir() + "/translations/qt_" + langFileName_);
#else
qt_translator_->load(resourcesDir() + "/lang/qtbase_" + langFileName_);
#endif
Expand Down

0 comments on commit 744df2d

Please sign in to comment.