| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,11 +57,26 @@ jobs: | |||
| 57 | 57 | --repo ${{ github.repository }} \ | |
| 58 | 58 | 2>/dev/null || true | |
| 59 | 59 | ||
| 60 | - - name: Open issue for fuzzy strings | ||
| 60 | + - name: Open issue for new and fuzzy strings | ||
| 61 | 61 | env: | |
| 62 | 62 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| 63 | 63 | run: | | |
| 64 | 64 | tmpfile=$(mktemp) | |
| 65 | + | ||
| 66 | + # --- New PO files (untracked, since nothing is staged yet) --- | ||
| 67 | + new_files=$(git ls-files --others --exclude-standard -- '*.po' \ | ||
| 68 | + ':(exclude).cpython-src' ':(exclude).pot-templates') | ||
| 69 | + if [ -n "$new_files" ]; then | ||
| 70 | + new_count=$(echo "$new_files" | wc -l) | ||
| 71 | + { | ||
| 72 | + echo "## 🆕 New PO files ($new_count)" | ||
| 73 | + echo "$new_files" | sed 's/^/- `/; s/$/`/' | ||
| 74 | + echo "" | ||
| 75 | + } >> "$tmpfile" | ||
| 76 | + fi | ||
| 77 | + | ||
| 78 | + # --- Fuzzy strings --- | ||
| 79 | + fuzzy_out=$(mktemp) | ||
| 65 | 80 | while IFS= read -r f; do | |
| 66 | 81 | fuzzy=$(msgattrib --only-fuzzy --no-obsolete "$f" 2>/dev/null) | |
| 67 | 82 | if [ -n "$fuzzy" ]; then | |
@@ -80,27 +95,35 @@ jobs: | |||
| 80 | 95 | next | |
| 81 | 96 | } | |
| 82 | 97 | ') | |
| 83 | - count=$(echo "$entries" | grep -c '^- ' || echo 0) | ||
| 84 | - if [ "$count" -gt 0 ]; then | ||
| 85 | - echo "### $f ($count fuzzy)" >> "$tmpfile" | ||
| 86 | - echo "$entries" | head -20 >> "$tmpfile" | ||
| 87 | - echo "" >> "$tmpfile" | ||
| 98 | + count=$(echo "$entries" | grep -c '^- ' || true) | ||
| 99 | + if [ "${count:-0}" -gt 0 ]; then | ||
| 100 | + echo "### $f ($count fuzzy)" >> "$fuzzy_out" | ||
| 101 | + echo "$entries" | head -20 >> "$fuzzy_out" | ||
| 102 | + echo "" >> "$fuzzy_out" | ||
| 88 | 103 | fi | |
| 89 | 104 | fi | |
| 90 | 105 | done < <(find . -name "*.po" \ | |
| 91 | 106 | -not -path "./.git/*" \ | |
| 92 | 107 | -not -path "./.cpython-src/*" \ | |
| 93 | 108 | -not -path "./.pot-templates/*") | |
| 109 | + | ||
| 110 | + if [ -s "$fuzzy_out" ]; then | ||
| 111 | + { | ||
| 112 | + echo "## 🔍 Fuzzy strings" | ||
| 113 | + cat "$fuzzy_out" | ||
| 114 | + } >> "$tmpfile" | ||
| 115 | + fi | ||
| 116 | + | ||
| 117 | + # --- One issue for both --- | ||
| 94 | 118 | if [ -s "$tmpfile" ]; then | |
| 119 | + echo "Triggered by sync with \`$CPYTHON_TAG\`." >> "$tmpfile" | ||
| 95 | 120 | gh issue create \ | |
| 96 | - --title "🔍 Fuzzy strings need review after CPython sync ($(date +%Y-%m-%d))" \ | ||
| 97 | - --body "$(cat "$tmpfile") | ||
| 98 | - | ||
| 99 | - Triggered by sync with \`$CPYTHON_TAG\`." \ | ||
| 121 | + --title "🔍 Translation review needed after CPython sync ($(date +%Y-%m-%d))" \ | ||
| 122 | + --body-file "$tmpfile" \ | ||
| 100 | 123 | --label "translation" \ | |
| 101 | 124 | --repo ${{ github.repository }} | |
| 102 | 125 | fi | |
| 103 | - rm -f "$tmpfile" | ||
| 126 | + rm -f "$tmpfile" "$fuzzy_out" | ||
| 104 | 127 | ||
| 105 | 128 | - name: Stage changes | |
| 106 | 129 | run: git add --all | |
| Back | FazBrowse Home | New Git URL |
0 commit comments