-
Notifications
You must be signed in to change notification settings - Fork 72
587 lines (509 loc) Β· 26.2 KB
/
Copy pathai-translation.yml
File metadata and controls
587 lines (509 loc) Β· 26.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
name: AI GUI translation
on:
push:
branches:
- master
paths:
- '**/*.py'
- '!tests/**'
workflow_dispatch:
# prevent race conditions
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
extract_strings:
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
runs-on: ubuntu-latest
outputs:
po-files-changed: ${{ steps.check-changes.outputs.po-files-changed }}
translations-to-process: ${{ steps.prepare-translations.outputs.translations-to-process }}
translation-matrix: ${{ steps.prepare-translations.outputs.translation-matrix }}
env:
PYGETTEXT_DOMAIN: ardupilot_methodic_configurator
PYGETTEXT_LOCALEDIR: ardupilot_methodic_configurator/locale
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Cache apt packages
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: |
/var/cache/apt/archives/*.deb
/var/lib/apt/lists/*
key: ${{ runner.os }}-apt-gettext-ubuntu2204
restore-keys: |
${{ runner.os }}-apt-gettext-
${{ runner.os }}-apt-
- name: Install apt gettext package
run: |
sudo apt-get update
sudo apt-get install -y gettext=0.21-14ubuntu2
- name: Install python-gettext requirement
id: install_deps
continue-on-error: true
run: |
WARNINGS=0
export PIP_VERSION=$(grep -oP 'pip\s*==\s*\K[0-9]+(\.[0-9]+)*' pyproject.toml || echo '')
export PYTHON_GETTEXT_VERSION=$(grep -oP 'python-gettext\s*==\s*\K[0-9]+(\.[0-9]+)*' pyproject.toml || echo '')
if [ -z "$PIP_VERSION" ]; then
echo "::warning::Could not detect pip version in pyproject.toml; falling back to latest."
PIP_INSTALL="pip"
WARNINGS=1
else
echo "Will install pip version $PIP_VERSION."
PIP_INSTALL="pip==$PIP_VERSION"
fi
if [ -z "$PYTHON_GETTEXT_VERSION" ]; then
echo "::warning::Could not detect python-gettext version in pyproject.toml; falling back to 5.0."
PYTHON_GETTEXT_INSTALL="python-gettext==5.0"
WARNINGS=1
else
echo "Will install python-gettext version $PYTHON_GETTEXT_VERSION."
PYTHON_GETTEXT_INSTALL="python-gettext==$PYTHON_GETTEXT_VERSION"
fi
python -m pip install "$PIP_INSTALL" "$PYTHON_GETTEXT_INSTALL"
echo "warnings=$WARNINGS" >> $GITHUB_OUTPUT
if [ "$WARNINGS" -eq 1 ]; then
exit 1
fi
- name: Extract strings
run: |
python create_pot_file.py
- name: Stage changes and check for updates
id: check-changes
run: |
git add $PYGETTEXT_LOCALEDIR/$PYGETTEXT_DOMAIN.pot
if [ -n "$(git status --porcelain)" ]; then
CHANGED_LINES=$(git diff --staged | grep -E "^[\+\-]" | wc -l)
if [ $CHANGED_LINES -gt 4 ]; then
python merge_pot_file.py
# Check if any .po files were modified
git add $PYGETTEXT_LOCALEDIR/**/$PYGETTEXT_DOMAIN.po
PO_CHANGES=$(git status --porcelain | grep -E "\.po$" | wc -l)
if [ $PO_CHANGES -gt 0 ]; then
echo "po-files-changed=true" >> $GITHUB_OUTPUT
echo "β
PO files have been updated with new strings"
else
echo "po-files-changed=false" >> $GITHUB_OUTPUT
echo "No PO file changes detected"
fi
else
echo "po-files-changed=false" >> $GITHUB_OUTPUT
echo "Not enough changes to commit (only $CHANGED_LINES lines changed)"
fi
else
echo "po-files-changed=false" >> $GITHUB_OUTPUT
echo "No changes to commit"
fi
- name: Prepare translation matrix
id: prepare-translations
if: steps.check-changes.outputs.po-files-changed == 'true'
run: |
python extract_missing_translations.py --lang-code all --max-translations 25 --max-characters 4500
# Check if any missing translation files were created
if ls missing_translations_*.txt 1> /dev/null 2>&1; then
echo "translations-to-process=true" >> $GITHUB_OUTPUT
echo "β
Found missing translation files to process with AI"
# Create matrix configuration for all translation files
matrix_entries="["
first_entry=true
for file in missing_translations_*.txt; do
if [ -f "$file" ]; then
# Extract language code and file number from filename
base_name=$(basename "$file" .txt)
if [[ "$base_name" =~ missing_translations_([a-zA-Z_]+)(_[0-9]+)?$ ]]; then
lang_code="${BASH_REMATCH[1]}"
file_suffix="${BASH_REMATCH[2]:-}"
# Define language name for better context
case $lang_code in
"pt") language="Portuguese (Portugal)";;
"de") language="German";;
"it") language="Italian";;
"ja") language="Japanese";;
"zh_CN") language="Chinese (Simplified)";;
*) language="$lang_code";;
esac
if [ "$first_entry" = true ]; then
first_entry=false
else
matrix_entries+=","
fi
matrix_entries+="{\"lang_code\":\"$lang_code\",\"language\":\"$language\",\"file\":\"$file\",\"suffix\":\"$file_suffix\"}"
fi
fi
done
matrix_entries+="]"
echo "translation-matrix=$matrix_entries" >> $GITHUB_OUTPUT
echo "Matrix configuration: $matrix_entries"
else
echo "translations-to-process=false" >> $GITHUB_OUTPUT
echo "translation-matrix=[]" >> $GITHUB_OUTPUT
echo "No missing translations found"
fi
- name: Upload translation files as artifacts
if: steps.prepare-translations.outputs.translations-to-process == 'true'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: translation-files
path: |
missing_translations_*.txt
retention-days: 1
# Matrix job to process translations in parallel for all languages and numbered files
# This approach scales to handle large translation batches by:
# 1. Splitting translations into chunks of 50 strings per file (configurable in extract_missing_translations.py)
# 2. Processing each chunk in parallel using GitHub Actions matrix strategy
# 3. Using consistent terminology guidelines across all chunks for the same language
# 4. Properly escaping YAML content to avoid parsing issues with colons in translation strings
ai_translate:
needs: extract_strings
if: needs.extract_strings.outputs.translations-to-process == 'true'
permissions:
actions: read # needed for downloading artifacts
contents: read # required by checkout
models: read # for AI inference
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJson(needs.extract_strings.outputs.translation-matrix) }}
fail-fast: false # Continue processing other languages even if one fails
max-parallel: 5 # Limit concurrent AI requests
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download translation files
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: translation-files
- name: Validate translation file exists
run: |
translation_file="${{ matrix.file }}"
echo "π Validating translation file: $translation_file"
if [ ! -f "$translation_file" ]; then
echo "β Error: Translation file '$translation_file' not found"
exit 1
fi
file_size=$(wc -c < "$translation_file")
echo "π Translation file size: $file_size bytes"
echo "β
Translation file validation completed successfully"
- name: Run AI translation
id: ai_translate
uses: actions/ai-inference@334892bb203895caaed82ec52d23c1ed9385151e # v2.0.4
with:
system-prompt-file: .github/prompts/ai-translation-system.prompt.yml
prompt-file: .github/prompts/ai-translation-user.prompt.yml
input: |
language: ${{ matrix.language }}
lang_code: ${{ matrix.lang_code }}
translation_file: ${{ matrix.file }}
file_input: |
translation_content: ${{ matrix.file }}
enable-github-mcp: true
github-mcp-toolsets: "context,repos"
model: openai/gpt-4.1
max-tokens: 8000
token: ${{ secrets.AMC_COPILOT_TOKEN_CLASSIC }}
continue-on-error: true
- name: Check AI translation success
id: check_translation
run: |
# Check if the AI translation step succeeded
if [ "${{ steps.ai_translate.outcome }}" != "success" ]; then
echo "β AI translation step failed for ${{ matrix.file }}"
echo "Step outcome: ${{ steps.ai_translate.outcome }}"
echo "Step conclusion: ${{ steps.ai_translate.conclusion }}"
echo "Language: ${{ matrix.language }} (${{ matrix.lang_code }})"
echo "File: ${{ matrix.file }}"
echo "Suffix: ${{ matrix.suffix }}"
# Check if prompt file exists for debugging
prompt_file="translate_${{ matrix.lang_code }}${{ matrix.suffix }}.prompt.yml"
if [ -f "$prompt_file" ]; then
echo "β
Prompt file exists and is $(wc -c < "$prompt_file") bytes"
else
echo "β Prompt file missing: $prompt_file"
fi
echo "translation_successful=false" >> $GITHUB_OUTPUT
exit 0 # Don't fail the workflow, just mark as unsuccessful
fi
# Debug: Show available outputs
echo "π Available AI action outputs:"
echo "Response file output: '${{ steps.ai_translate.outputs.response-file }}'"
echo "Response output exists: ${{ steps.ai_translate.outputs.response != '' }}"
# Check if we have any usable output
if [ -n "${{ steps.ai_translate.outputs.response-file }}" ] && [ -f "${{ steps.ai_translate.outputs.response-file }}" ]; then
echo "β
Response file found: ${{ steps.ai_translate.outputs.response-file }}"
echo "translation_successful=true" >> $GITHUB_OUTPUT
echo "output_method=file" >> $GITHUB_OUTPUT
elif [ -n "${{ steps.ai_translate.outputs.response }}" ]; then
response_length=$(echo "${{ steps.ai_translate.outputs.response }}" | wc -c)
echo "β
Response content found (length: ${response_length})"
echo "translation_successful=true" >> $GITHUB_OUTPUT
echo "output_method=content" >> $GITHUB_OUTPUT
else
echo "β No usable AI response found for ${{ matrix.file }}"
echo "Available outputs:"
echo " - response-file: '${{ steps.ai_translate.outputs.response-file }}'"
echo " - response: '${{ steps.ai_translate.outputs.response }}'"
echo "translation_successful=false" >> $GITHUB_OUTPUT
fi
- name: Save translation result
if: steps.check_translation.outputs.translation_successful == 'true'
run: |
# Save the AI response back to the original translation file
if [ "${{ steps.check_translation.outputs.output_method }}" = "file" ]; then
echo "π Using response file: ${{ steps.ai_translate.outputs.response-file }}"
cp "${{ steps.ai_translate.outputs.response-file }}" "${{ matrix.file }}"
elif [ "${{ steps.check_translation.outputs.output_method }}" = "content" ]; then
echo "π Using response content"
echo "${{ steps.ai_translate.outputs.response }}" > "${{ matrix.file }}"
else
echo "β Unexpected output method: ${{ steps.check_translation.outputs.output_method }}"
exit 1
fi
# Validate the saved file
if [ -f "${{ matrix.file }}" ] && [ -s "${{ matrix.file }}" ]; then
echo "β
AI translation saved successfully for ${{ matrix.language }} (${{ matrix.file }})"
echo "π File size: $(wc -c < "${{ matrix.file }}") bytes"
echo "π Line count: $(wc -l < "${{ matrix.file }}") lines"
else
echo "β Translation file is empty or missing: ${{ matrix.file }}"
exit 1
fi
- name: Handle translation failure
if: steps.check_translation.outputs.translation_successful != 'true'
run: |
echo "β οΈ AI translation failed for ${{ matrix.language }} (${{ matrix.file }})"
echo "Language: ${{ matrix.language }} (code: ${{ matrix.lang_code }})"
echo "File chunk: ${{ matrix.file }}${{ matrix.suffix }}"
echo "Creating placeholder file to avoid breaking the workflow"
touch "${{ matrix.file }}"
echo "# Translation failed for ${{ matrix.language }} (chunk${{ matrix.suffix }})" > "${{ matrix.file }}"
echo "# File: ${{ matrix.file }}" >> "${{ matrix.file }}"
echo "# Please translate manually or retry the workflow" >> "${{ matrix.file }}"
echo "# This was part of a chunked translation batch for scalability" >> "${{ matrix.file }}"
- name: Upload translated file
if: always() # Upload even if translation failed, for debugging
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: translated-${{ matrix.lang_code }}${{ matrix.suffix }}
path: ${{ matrix.file }}
retention-days: 1
- name: Report translation status
if: always()
run: |
if [ "${{ steps.check_translation.outputs.translation_successful }}" = "true" ]; then
echo "β
Successfully translated ${{ matrix.file }} for ${{ matrix.language }}"
echo "π Chunk: ${{ matrix.suffix || 'single file' }}"
else
echo "β Failed to translate ${{ matrix.file }} for ${{ matrix.language }}"
echo "π Chunk: ${{ matrix.suffix || 'single file' }}"
echo "::warning::AI translation failed for ${{ matrix.language }}${{ matrix.suffix }}. Manual translation may be required."
fi
# Job to collect all translations and create the final PR
finalize_translations:
needs: [extract_strings, ai_translate]
if: needs.extract_strings.outputs.po-files-changed == 'true'
permissions:
actions: read # needed for downloading translated artifacts
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
runs-on: ubuntu-latest
env:
PYGETTEXT_DOMAIN: ardupilot_methodic_configurator
PYGETTEXT_LOCALEDIR: ardupilot_methodic_configurator/locale
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Cache apt packages
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: |
/var/cache/apt/archives/*.deb
/var/lib/apt/lists/*
key: ${{ runner.os }}-apt-gettext-ubuntu2204
restore-keys: |
${{ runner.os }}-apt-gettext-
${{ runner.os }}-apt-
- name: Install apt gettext package
run: |
sudo apt-get update
sudo apt-get install -y gettext=0.21-14ubuntu2
- name: Install python-gettext requirement
continue-on-error: true
run: |
export PIP_VERSION=$(grep -oP 'pip\s*==\s*\K[0-9]+(\.[0-9]+)*' pyproject.toml || echo '')
export PYTHON_GETTEXT_VERSION=$(grep -oP 'python-gettext\s*==\s*\K[0-9]+(\.[0-9]+)*' pyproject.toml || echo '')
if [ -z "$PIP_VERSION" ]; then
echo "::warning::Could not detect pip version in pyproject.toml; falling back to latest."
PIP_INSTALL="pip"
else
echo "Will install pip version $PIP_VERSION."
PIP_INSTALL="pip==$PIP_VERSION"
fi
if [ -z "$PYTHON_GETTEXT_VERSION" ]; then
echo "::warning::Could not detect python-gettext version in pyproject.toml; falling back to 5.0."
PYTHON_GETTEXT_INSTALL="python-gettext==5.0"
else
echo "Will install python-gettext version $PYTHON_GETTEXT_VERSION."
PYTHON_GETTEXT_INSTALL="python-gettext==$PYTHON_GETTEXT_VERSION"
fi
python -m pip install "$PIP_INSTALL" "$PYTHON_GETTEXT_INSTALL"
- name: Download all translated files
if: needs.extract_strings.outputs.translations-to-process == 'true'
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
pattern: translated-*
merge-multiple: true
- name: Insert AI translations into .po files
if: needs.extract_strings.outputs.translations-to-process == 'true'
run: |
# Check if we have any translated files
if ls missing_translations_*.txt 1> /dev/null 2>&1; then
echo "π₯ Processing AI translations..."
# Check for failed translations (files with failure markers)
failed_translations=0
successful_translations=0
for file in missing_translations_*.txt; do
if [ -f "$file" ]; then
if grep -q "# Translation failed" "$file" 2>/dev/null; then
echo "β οΈ Found failed translation: $file"
((failed_translations++))
# Remove failed translation files so they don't get processed
rm "$file"
else
echo "β
Found successful translation: $file"
((successful_translations++))
fi
fi
done
echo "π Translation summary:"
echo " - Successful: $successful_translations"
echo " - Failed: $failed_translations"
if [ $successful_translations -gt 0 ]; then
echo "π Processing successful translations with insert_missing_translations.py"
python insert_missing_translations.py
echo "β
AI translations inserted into .po files"
else
echo "β οΈ No successful translations to process"
fi
if [ $failed_translations -gt 0 ]; then
echo "::warning::$failed_translations translation(s) failed and will need manual translation"
fi
else
echo "βΉοΈ No AI translations to process"
fi
- name: Compile .mo files
run: |
python create_mo_files.py
echo "β
.mo files compiled successfully"
- name: Stage all changes
run: |
git add $PYGETTEXT_LOCALEDIR/$PYGETTEXT_DOMAIN.pot
git add $PYGETTEXT_LOCALEDIR/**/$PYGETTEXT_DOMAIN.po
git add $PYGETTEXT_LOCALEDIR/**/$PYGETTEXT_DOMAIN.mo
- name: Prepare PR summary
id: pr_summary
run: |
# Count successful and failed translations from job artifacts metadata
total_files=0
successful_files=0
failed_files=0
# Count translation files that were processed
if ls missing_translations_*.txt 1> /dev/null 2>&1; then
total_files=$(ls missing_translations_*.txt 2>/dev/null | wc -l)
successful_files=$total_files # Since failed ones were removed earlier
fi
# Calculate failed files based on matrix jobs (this is approximate)
# In a real scenario, you'd want to pass this info through job outputs
echo "translation_summary<<EOF" >> $GITHUB_OUTPUT
echo "## π Translation Processing Summary" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "- **Total translation files processed**: $total_files" >> $GITHUB_OUTPUT
echo "- **Successfully translated**: $successful_files" >> $GITHUB_OUTPUT
echo "- **Failed translations**: $failed_files" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
if [ $failed_files -gt 0 ]; then
echo "β οΈ **Note**: Some translations failed and will need manual review." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
fi
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
labels: i18n, automated-pr
token: ${{ secrets.GITHUB_TOKEN }}
branch: merge-i18n-po-strings
title: "Merge new un-translated string(s) to existing .po files with AI translations"
commit-message: "chore(translations): merge new un-translated string(s) to existing .po files with AI translations"
body: |
Update .pot file with new un-translated string(s) from the source code
Merge .pot file strings into existing .po files
π€ **AI-Powered Translation Applied with Enhanced Matrix Processing**:
- Automatically extracted missing translations using `extract_missing_translations.py`
- Used GitHub Actions matrix strategy to process numbered files in parallel
- Applied AI-powered translations using GitHub Models (GPT-4o) for multiple languages
- **GITHUB PROMPT.YML FORMAT**: Using official GitHub prompt.yml template format with separated files
- **SEPARATED PROMPT.YML FILES**: Organized in .github/prompts/ directory for better structure
- **CLEAN ORGANIZATION**: ai-translation-system.prompt.yml and ai-translation-user.prompt.yml separated from workflows
- **PERSONAL ACCESS TOKEN**: Using amilcarlucas PAT for GitHub MCP access instead of GITHUB_TOKEN
- **GITHUB MCP ENABLED**: AI can read translation files directly from repository using Model Context Protocol
- **FILE-BASED PROMPTS**: AI reads translation files directly instead of embedding content in YAML prompts
- Supports processing unlimited translations per language with automatic chunking
- Inserted translated strings into .po files using `insert_missing_translations.py`
- Compiled binary .mo files for immediate use
${{ steps.pr_summary.outputs.translation_summary }}
**Languages processed**: Portuguese (pt), German (de), Italian (it), Japanese (ja), Chinese Simplified (zh_CN)
**Enhanced Matrix Processing & Scaling**:
- β
**Parallel processing** of translation files for better performance
- β
**Automatic chunking** when >50 strings per language (configurable)
- β
**Robust error handling** for failed AI translation requests with detailed debugging
- β
**File validation** before and after AI processing
- β
**Consistent terminology** guidelines applied across all chunks for each language
- Robust error handling for failed AI translation requests
**Technical Improvements Made**:
- π§ **Organized prompt structure**: Moved prompt files to .github/prompts/ directory to avoid confusion with workflows
- π§ **GitHub MCP enabled**: AI can read translation files directly from repository using Model Context Protocol
- π§ **Separated prompt architecture**: System prompt and user prompt in separate files for better maintainability
- π§ **File-based AI prompts**: AI reads translation files directly, eliminating YAML content embedding issues
- π§ **Reusable system prompts**: System prompt can be reused across different translation tasks
- π§ **Enhanced reliability**: No more YAML syntax issues from embedded content with special characters
- π§ **Better scalability**: File-based approach handles large translation batches without prompt size limits
- π§ **403 error fix**: Enabled GitHub MCP to resolve permission issues when reading repository files
**Translation Guidelines Applied**:
- Technical aviation/drone context preservation
- Formal register for technical documentation
- Language-specific conventions (e.g., European Portuguese, formal German)
- Consistent terminology maintenance across chunks
- Placeholder preservation ({variable_name} patterns)
**Quality Assurance**:
- Validation of AI action outputs before processing
- Graceful handling of AI service failures
- File size and content validation after translation
- Comprehensive error reporting and debugging information
Please review the AI-generated translations for accuracy and cultural appropriateness before merging.
delete-branch: true