diff --git a/.github/prompts/ai-translation-user.prompt.yml b/.github/prompts/ai-translation-user.prompt.yml index a55dafc4a..13748c26e 100644 --- a/.github/prompts/ai-translation-user.prompt.yml +++ b/.github/prompts/ai-translation-user.prompt.yml @@ -5,6 +5,8 @@ messages: Language code: {{lang_code}} Translation file: {{translation_file}} - Please read the translation file "{{translation_file}}" and translate all the strings from English to {{language}}. + Please read the content of the file "{{translation_file}}" and translate all the strings from English to {{language}}. The file contains strings in the format "line_number:English text" - please translate only the text after the colon while preserving the exact line number and colon format. + + Respond with ONLY the translated content in the same format, one line per string. diff --git a/.github/workflows/ai-translation.yml b/.github/workflows/ai-translation.yml index 4093eb24f..ee961fca7 100644 --- a/.github/workflows/ai-translation.yml +++ b/.github/workflows/ai-translation.yml @@ -220,19 +220,24 @@ jobs: with: name: translation-files - - name: Validate translation file exists + - name: Read translation file content + id: read_translation run: | translation_file="${{ matrix.file }}" - echo "🔍 Validating translation file: $translation_file" + echo "� Reading 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" + # Read file content and escape for YAML + content=$(cat "$translation_file" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed 's/$/\\n/g' | tr -d '\n') + echo "translation_content<> $GITHUB_OUTPUT + echo "$content" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + echo "✅ Translation file content read successfully" - name: Run AI translation id: ai_translate @@ -244,8 +249,7 @@ jobs: language: ${{ matrix.language }} lang_code: ${{ matrix.lang_code }} translation_file: ${{ matrix.file }} - file_input: | - translation_content: ${{ matrix.file }} + file_input: ${{ matrix.file }} enable-github-mcp: false model: openai/gpt-4.1 max-tokens: 8000