Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Keeps README translations synchronized #1432

Merged
merged 13 commits into from
Dec 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(workflow): improve translation saving process by escaping special…
… characters to ensure correct file creation
0xJord4n committed Dec 24, 2024
commit 2cc9e684b27e97854353991cd15c6d7310b77de9
10 changes: 9 additions & 1 deletion .github/workflows/generate-readme-translations.yml
Original file line number Diff line number Diff line change
@@ -72,7 +72,15 @@ jobs:

- name: Save translation
run: |
mv translated.md README_${{ matrix.language.code }}.md
# Create a temporary variable with the translation
translation='${{ steps.aixion.outputs.text }}'
# Escape any quotes and special characters
translation="${translation//\"/\\\"}"
translation="${translation//'%'/'%25'}"
translation="${translation//$'\n'/'%0A'}"
translation="${translation//$'\r'/'%0D'}"
# Write the escaped content to file
echo "$translation" > README_${{ matrix.language.code }}.md

- name: List README translations
run: ls README_*.md || echo "No translation files found"