Skip to content

Commit 1c42b54

Browse files
authored
Merge branch '3.10' into library/functions
2 parents e3022eb + 2c6caba commit 1c42b54

24 files changed

+1616
-504
lines changed

.github/workflows/get-changes.py

+16
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.github.com/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_branch.yml

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

.github/workflows/wrap.yml renamed to .github/workflows/wrap_pr.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: "Wrap"
1+
name: "Wrap changed files in pull requests"
22

33
on:
4-
pull_request:
4+
pull_request:
55
branches: [ "**" ]
66

7-
jobs:
8-
test:
7+
jobs:
8+
wrap:
99
runs-on: ubuntu-latest
1010

1111
strategy:
@@ -19,6 +19,7 @@ jobs:
1919
uses: actions/checkout@v2
2020
with:
2121
fetch-depth: 0
22+
ref: ${{ github.event.pull_request.head.ref }}
2223

2324
# Setup which version of Python to use
2425
- name: Set Up Python ${{ matrix.python-version }}
@@ -44,7 +45,7 @@ jobs:
4445

4546
# Detect changed files
4647
- name: Detect changed files
47-
run: echo "CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }} | tr '\n' ' ')" >> $GITHUB_ENV
48+
run: echo "CHANGED_FILES=$(python .github/workflows/get-changes.py --pull ${{ github.event.pull_request.number }} | tr '\n' ' ')" >> $GITHUB_ENV
4849

4950
# Wrap changed files
5051
- name: Wrap
@@ -89,4 +90,4 @@ jobs:
8990
uses: ad-m/github-push-action@master
9091
with:
9192
github_token: ${{ secrets.GITHUB_TOKEN }}
92-
branch: ${{ github.event.pull_request.head.ref }}
93+
branch: ${{ github.event.pull_request.head.ref }}

.gitignore

+3-1
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
#
44
msgid ""
55
msgstr ""
6-
"Project-Id-Version: Python 3\n"
6+
"Project-Id-Version: Python 3.10\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2021-12-17 23:20+0300\n"
99
"PO-Revision-Date: 2021-12-17 21:04+0300\n"
1010
"Last-Translator: \n"
11-
"Language-Team: TURKISH\n"
12-
"Language: tr_TR\n"
11+
"Language-Team: TURKISH <python.docs.tr@gmail.com>\n"
12+
"Language: tr\n"
1313
"MIME-Version: 1.0\n"
1414
"Content-Type: text/plain; charset=UTF-8\n"
1515
"Content-Transfer-Encoding: 8bit\n"
@@ -18,7 +18,7 @@ msgstr ""
1818

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

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

bugs.po

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
#
44
msgid ""
55
msgstr ""
6-
"Project-Id-Version: Python 3\n"
6+
"Project-Id-Version: Python 3.10\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2021-12-17 23:20+0300\n"
99
"PO-Revision-Date: 2021-12-17 22:58+0300\n"
1010
"Last-Translator: \n"
11-
"Language-Team: TURKISH\n"
12-
"Language: tr_TR\n"
11+
"Language-Team: TURKISH <python.docs.tr@gmail.com>\n"
12+
"Language: tr\n"
1313
"MIME-Version: 1.0\n"
1414
"Content-Type: text/plain; charset=UTF-8\n"
1515
"Content-Transfer-Encoding: 8bit\n"
@@ -168,7 +168,7 @@ msgstr ""
168168
"Gönderim formunda bir dizi alanlar vardır. \"Başlık\" alanı için, sorunun "
169169
"*çok* kısa açıklamasını girin; 10 kelimeden az olması iyidir. \"Tür\" "
170170
"alanında, sorununuzun türünü seçin; ayrıca hatanın ilişkili olduğu \"Bileşen"
171-
"\" ve \"Sürümler\"i seçin."
171+
"\" ve \"Sürümler\" 'i seçin."
172172

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

copyright.po

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ msgstr ""
4747
msgid ""
4848
"Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved."
4949
msgstr ""
50-
"Telif Hakkı © 1991-1995 Stichting Mathematisch Centrum. Tüm hakları "
51-
"saklıdır."
50+
"Telif Hakkı © 1991-1995 Stichting Mathematisch Centrum. Tüm hakları saklıdır."
5251

5352
#: copyright.rst:18
5453
msgid ""

0 commit comments

Comments
 (0)