Skip to content

Commit

Permalink
Add translations for Qt modules to installer (#1887)
Browse files Browse the repository at this point in the history
* Add translations to installer for Qt modules

* Add French translations for Qt modules to installer

* Change the path to search for translations from /translations to /resources/translations
  • Loading branch information
MinyazevR authored Jan 10, 2025
1 parent 4843a86 commit b86d55e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/windows_build_with_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
version: '${{matrix.qt-version}}'
arch: win${{ matrix.mingw-bitness }}_mingw${{matrix.mingw-short-version}}
modules: 'qtscript'
archives: 'qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats qtwinextras'
archives: 'qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats qtwinextras qttranslations'
tools: 'tools_mingw,qt.tools.win${{ matrix.mingw-bitness }}_mingw${{matrix.mingw-short-version}}0 tools_ifw'
add-tools-to-path: true
cache: true
Expand Down
2 changes: 1 addition & 1 deletion buildScripts/github/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ case "$(uname)" in
sudo yum install -y --setopt=install_weak_deps=False libX11-xcb libXext libxkbcommon-x11 fontconfig freetype libXrender
#libQt5WaylandCompositor.so.5.15: libQt5Quick.so.5 libQt5Qml.so.5 libQt5QmlModels.so.5
modules=("qtscript" "qtwaylandcompositor")
archives=("qtbase" "qtmultimedia" "qtsvg" "qtscript" "qttools" "qtserialport" "qtimageformats" "icu" "qtwayland" "qtdeclarative")
archives=("qtbase" "qtmultimedia" "qtsvg" "qtscript" "qttools" "qtserialport" "qtimageformats" "icu" "qtwayland" "qtdeclarative" "qttranslations")
install_qt linux desktop "$TRIK_QT_VERSION" "$HOME/Qt" $modules $archives
QT_ROOT_DIR=$(ls -1d "$HOME"/Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1)
echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH
Expand Down
1 change: 1 addition & 0 deletions installer/build-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ esac
export QT_LIB=$(cygpath -u $("$QT_DIR"/qmake -query "$qt_query_key"))

export QT_PLUGINS=$(cygpath -u $("$QT_DIR"/qmake -query QT_INSTALL_PLUGINS))
export QT_TRANSLATIONS=$(cygpath -u $("$QT_DIR"/qmake -query QT_INSTALL_TRANSLATIONS))
export QTIFW_DIR=$(realpath $(cygpath -u "$2"))
export PRODUCT="$3"
export OS="$OSTYPE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ cd "$(dirname "$0")"

mkdir -p "$PWD"/../data/translations
rsync -a "$BIN_DIR"/translations/fr "$PWD"/../data/translations
ls "$QT_TRANSLATIONS"
rsync -a "$QT_TRANSLATIONS"/*fr.qm "$PWD"/../data/translations
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ cd "$(dirname "$0")"

mkdir -p "$PWD"/../data/translations
rsync -a "$BIN_DIR"/translations/ru "$PWD"/../data/translations
ls "$QT_TRANSLATIONS"
rsync -a "$QT_TRANSLATIONS"/*ru.qm "$PWD"/../data/translations
2 changes: 1 addition & 1 deletion qrgui/mainWindow/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void loadTranslators(QLocale &locale)
{
/// Load Qt's system translations before application translations
static const QStringList qtModules {"qtbase", "qtmultimedia", "qtserialport", "qtxmlpatterns", "qtscript" };
static const auto qtAppsTranslationsDir = QLibraryInfo::location(QLibraryInfo::LibraryLocation::TranslationsPath);
static const auto qtAppsTranslationsDir = PlatformInfo::invariantSettingsPath("pathToTranslations");

for (auto &&module: qtModules) {
auto *t = new QTranslator(qApp);
Expand Down

0 comments on commit b86d55e

Please sign in to comment.