Skip to content

Commit 910ffb5

Browse files
authored
Merge branch 'master' into Xiaomi-Content-Helper
2 parents 8212fcb + 4bb9d55 commit 910ffb5

67 files changed

Lines changed: 248270 additions & 5445 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ jobs:
143143
144144
- name: Build
145145
run: |
146+
lrelease src/qdomyos-zwift.pri
146147
qmake
147148
make -j8
148149
cd src/debug
@@ -165,11 +166,12 @@ jobs:
165166
cp ../../adb/* adb/
166167
cd ..
167168
cd appx
168-
#../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz
169+
#../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz
169170
if: matrix.config.python
170-
171+
171172
- name: Build without python
172173
run: |
174+
lrelease src/qdomyos-zwift.pri
173175
qmake
174176
make -j8
175177
cd src/debug
@@ -555,7 +557,7 @@ jobs:
555557
git submodule update --init --recursive
556558
557559
- name: Install packages required to run QZ inside workflow
558-
run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
560+
run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qttools5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
559561

560562
# - name: Test Peloton API
561563
# if: github.event_name == 'push' || github.event_name == 'schedule'
@@ -709,6 +711,7 @@ jobs:
709711
710712
- name: Build QZ for Android (4 ABIs)
711713
run: |
714+
lrelease src/qdomyos-zwift.pri
712715
qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.4.7075529' && make -j4 && make INSTALL_ROOT=${{ github.workspace }}/output/android/ install
713716
sed -i '1s|{|{\n "android-extra-libs": "${{ github.workspace }}/android_openssl/no-asm/latest/arm/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libssl_1_1.so",|' src/android-qdomyos-zwift-deployment-settings.json
714717
cat src/android-qdomyos-zwift-deployment-settings.json
@@ -1169,6 +1172,7 @@ jobs:
11691172

11701173
- name: Build
11711174
run: |
1175+
lrelease src/qdomyos-zwift.pri
11721176
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
11731177
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
11741178
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
@@ -1197,10 +1201,11 @@ jobs:
11971201

11981202
- name: Build without python
11991203
run: |
1204+
lrelease src/qdomyos-zwift.pri
12001205
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
12011206
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
12021207
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
1203-
qmake
1208+
qmake
12041209
nmake
12051210
cd src/debug
12061211
mkdir output
@@ -1372,6 +1377,7 @@ jobs:
13721377

13731378
- name: Build
13741379
run: |
1380+
lrelease src/qdomyos-zwift.pri
13751381
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
13761382
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
13771383
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
@@ -1756,10 +1762,11 @@ jobs:
17561762

17571763
- name: Build
17581764
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
1759-
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
1765+
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
17601766
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
17611767
run: |
1762-
qmake
1768+
lrelease src/qdomyos-zwift.pri
1769+
qmake
17631770
nmake
17641771
cd src/debug
17651772
mkdir output
@@ -1785,10 +1792,11 @@ jobs:
17851792

17861793
- name: Build without python
17871794
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
1788-
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
1789-
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
1790-
run: |
1791-
qmake
1795+
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
1796+
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
1797+
run: |
1798+
lrelease src/qdomyos-zwift.pri
1799+
qmake
17921800
nmake
17931801
cd src/debug
17941802
mkdir output
@@ -1965,6 +1973,7 @@ jobs:
19651973

19661974
- name: Build
19671975
run: |
1976+
lrelease src/qdomyos-zwift.pri
19681977
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
19691978
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
19701979
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
@@ -1993,6 +2002,7 @@ jobs:
19932002

19942003
- name: Build without python
19952004
run: |
2005+
lrelease src/qdomyos-zwift.pri
19962006
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
19972007
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
19982008
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
name: Update Translations
2+
3+
on:
4+
workflow_dispatch: # Manual trigger
5+
schedule:
6+
- cron: '0 0 * * 0' # Weekly on Sunday at midnight
7+
pull_request: # Run on every PR commit for testing
8+
paths:
9+
- 'src/**/*.cpp'
10+
- 'src/**/*.h'
11+
- 'src/**/*.qml'
12+
- 'src/**/*.ui'
13+
- 'src/**/*.ts'
14+
push: # Run on push to PR branches
15+
branches:
16+
- 'claude/**' # All Claude Code branches
17+
- 'translations/**' # Translation-specific branches
18+
19+
jobs:
20+
update-translations:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Install Qt Linguist Tools
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y qtbase5-dev qttools5-dev-tools
34+
35+
- name: Detect workflow context
36+
id: context
37+
run: |
38+
if [ "${{ github.event_name }}" = "pull_request" ] || [ "${{ github.event_name }}" = "push" ]; then
39+
echo "mode=testing" >> $GITHUB_OUTPUT
40+
echo "🧪 Running in TESTING mode (PR/push to branch)"
41+
else
42+
echo "mode=production" >> $GITHUB_OUTPUT
43+
echo "🚀 Running in PRODUCTION mode (scheduled/manual)"
44+
fi
45+
46+
- name: Update translation files
47+
run: |
48+
echo "Extracting translatable strings from source code..."
49+
echo "Updating 30 language files..."
50+
51+
# lupdate will create/update all .ts files defined in TRANSLATIONS
52+
lupdate src/qdomyos-zwift.pri
53+
54+
- name: Compile translation binaries (.qm)
55+
run: |
56+
echo "Compiling .ts files into .qm binaries..."
57+
lrelease src/qdomyos-zwift.pri
58+
59+
- name: Verify generated .qm files
60+
run: |
61+
echo "Checking compiled translation files..."
62+
ls -1 src/translations/*.qm
63+
64+
- name: Check for translation changes
65+
run: |
66+
echo ""
67+
echo "Checking for changes..."
68+
69+
# Check if there are changes in translations folder
70+
if git diff --quiet src/translations/; then
71+
echo "✅ No translation updates needed - files are up to date"
72+
echo "HAS_CHANGES=false" >> $GITHUB_ENV
73+
else
74+
echo "📝 Translation files have been updated with new/modified strings"
75+
echo "HAS_CHANGES=true" >> $GITHUB_ENV
76+
77+
# Show diff stats
78+
echo ""
79+
echo "Changes summary:"
80+
git diff --stat src/translations/
81+
82+
echo ""
83+
echo "Files modified:"
84+
git diff --name-only src/translations/
85+
fi
86+
87+
- name: Commit and push changes (Testing Mode)
88+
if: env.HAS_CHANGES == 'true' && steps.context.outputs.mode == 'testing' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
89+
env:
90+
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
91+
run: |
92+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
93+
git config --local user.name "github-actions[bot]"
94+
95+
# Commit updated translation source files only
96+
git add src/translations/*.ts
97+
git commit -m "chore: update translation strings [automated]
98+
99+
Automatic update of translatable strings extracted from source code.
100+
Updated 30 language files in src/translations/
101+
102+
- Updated by GitHub Actions (Testing Mode)
103+
- Triggered by: ${{ github.event_name }}
104+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")"
105+
106+
# Push to remote branch explicitly (works also in detached HEAD on pull_request events)
107+
git push origin HEAD:refs/heads/${TARGET_BRANCH}
108+
109+
echo "✅ Changes committed and pushed to current branch"
110+
111+
- name: Commit and push changes (Production Mode)
112+
if: env.HAS_CHANGES == 'true' && steps.context.outputs.mode == 'production'
113+
run: |
114+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
115+
git config --local user.name "github-actions[bot]"
116+
117+
# Create a new branch for production updates
118+
BRANCH_NAME="translations/auto-update-$(date +%Y%m%d-%H%M%S)"
119+
git checkout -b "$BRANCH_NAME"
120+
121+
# Add updated translation source files only
122+
git add src/translations/*.ts
123+
git commit -m "chore: update translation strings
124+
125+
Automatic update of translatable strings extracted from source code.
126+
Updated 30 language files in src/translations/
127+
128+
- Updated by GitHub Actions (Scheduled)
129+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")"
130+
131+
# Push the branch
132+
git push origin "$BRANCH_NAME"
133+
134+
# Store branch name for PR creation
135+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
136+
echo "✅ Changes pushed to new branch: $BRANCH_NAME"
137+
138+
- name: Create Pull Request (Production Mode Only)
139+
if: env.HAS_CHANGES == 'true' && steps.context.outputs.mode == 'production'
140+
uses: peter-evans/create-pull-request@v5
141+
with:
142+
token: ${{ secrets.GITHUB_TOKEN }}
143+
branch: ${{ env.BRANCH_NAME }}
144+
title: "🌍 Update translation strings"
145+
body: |
146+
## Translation Update
147+
148+
This PR updates the translation file with new strings extracted from the source code.
149+
150+
### Changes
151+
- Extracted new translatable strings using `lupdate`
152+
- Updated 30 language files in `src/translations/`
153+
- Languages: Italian, German, French, Spanish, Portuguese, Russian, Chinese, Japanese, Korean, Arabic, Hindi, and 19 more
154+
155+
### What to do next
156+
1. Review the new strings in `src/translations/qdomyos-zwift_*.ts`
157+
2. Contributors can now create PRs to add translations in their language
158+
3. Edit the `.ts` file for your language and add translations in `<translation>` tags
159+
4. Merge this PR to make new strings available
160+
161+
### Translation Files
162+
- Location: `src/translations/`
163+
- Format: `qdomyos-zwift_LOCALE.ts` (e.g., `qdomyos-zwift_it.ts` for Italian)
164+
- 30 languages supported
165+
166+
**Note:** Strings marked as `<translation type="unfinished">` need translation.
167+
168+
---
169+
*Generated automatically by GitHub Actions*
170+
labels: |
171+
translations
172+
automation
173+
174+
- name: Summary
175+
if: always()
176+
run: |
177+
echo ""
178+
echo "============================================"
179+
echo "Translation Workflow Summary"
180+
echo "============================================"
181+
echo "Mode: ${{ steps.context.outputs.mode }}"
182+
echo "Event: ${{ github.event_name }}"
183+
echo "Has changes: ${{ env.HAS_CHANGES }}"
184+
echo "============================================"
185+
186+
if [ "${{ env.HAS_CHANGES }}" = "true" ]; then
187+
if [ "${{ steps.context.outputs.mode }}" = "testing" ]; then
188+
echo "✅ Translation files updated in current branch"
189+
echo " Review changes in: src/translations/"
190+
else
191+
echo "✅ Translation files updated and PR created"
192+
echo " Branch: ${{ env.BRANCH_NAME }}"
193+
fi
194+
else
195+
echo "ℹ️ No updates needed - translation files are current"
196+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ src/inner_templates/googlemaps/cesium-key.js
5454
src/inner_templates/googlemaps/cesium-key.js
5555
src/qdomyos-zwift.pro.user.49de507
5656
/.vs
57+
src/translations/*.qm
5758
/tools/__pycache__

0 commit comments

Comments
 (0)