Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out ${{ github.repository }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
- run: echo ${{ inputs.was-called }}
- if: ${{ inputs.was-called }} == 'yes'
run: |
git pull --rebase
- name: Check out CPython
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: python/cpython
persist-credentials: false
ref: ${{ env.CPYTHON_BRANCH }}
path: cpython
- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: |
sudo apt update -y && sudo apt install gettext -y
Expand Down Expand Up @@ -87,7 +89,7 @@ jobs:
path: cpython/Doc/build/html
- name: Upload artifact - logs
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-logs
path: logs/
10 changes: 5 additions & 5 deletions .github/workflows/compendium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out ${{ github.repository }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
- if: github.event_name == 'workflow_call'
run: |
git pull --rebase
- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt update -y && sudo apt install gettext -y
Expand All @@ -33,7 +33,7 @@ jobs:
run: |
pocompendium --correct compendium.po *.po **/*.po
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: compendium
path: compendium.po
30 changes: 20 additions & 10 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out ${{ github.repository }}
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check out CPython
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: python/cpython
persist-credentials: false
ref: ${{ env.CPYTHON_BRANCH }}
path: cpython
- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install Transifex CLI
run: |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
mv tx /usr/local/bin/tx
working-directory: /usr/local/bin
- name: Install dependencies
run: |
sudo apt update -y && sudo apt install gettext -y
Expand All @@ -56,7 +58,9 @@ jobs:
run: |
powrap --modified
- name: Commit and push changes
if: github.repository == 'python/python-docs-pt-br'
if: |
github.repository == 'python/python-docs-pt-br' &&
! github.event_name == 'pull_request'
run: |
git config user.name github-actions
git config user.email github-actions@github.com
Expand Down Expand Up @@ -85,15 +89,19 @@ jobs:
run:
echo "CURRENT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Check out source branch (${{ env.CURRENT_BRANCH }})
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ${{ env.CURRENT_BRANCH }}
persist-credentials: false
- name: Check out target branch (${{ matrix.branch }})
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
path: ${{ matrix.branch }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt update -y && sudo apt install gettext -y
Expand All @@ -110,7 +118,9 @@ jobs:
run: |
powrap --modified -C ${{ matrix.branch }}
- name: Commit and push changes
if: github.repository == 'python/python-docs-pt-br'
if: |
github.repository == 'python/python-docs-pt-br' &&
! github.event_name == 'pull_request'
run: |
cd ${{ matrix.branch }}
git config user.name github-actions
Expand All @@ -123,7 +133,7 @@ jobs:
# Call the build workflow after updating
name: call
needs: [update]
uses: python/python-docs-pt-br/.github/workflows/build.yml@3.10
uses: ./.github/workflows/build.yml
with:
was-called: yes
secrets:
Expand All @@ -134,4 +144,4 @@ jobs:
# Call the compendium workflow after updating
name: call
needs: [update]
uses: python/python-docs-pt-br/.github/workflows/compendium.yml@3.10
uses: ./.github/workflows/compendium.yml
14 changes: 13 additions & 1 deletion library/2to3.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Sheila Gomes <sheilagomes1@gmail.com>, 2021
# Claudio Rogerio Carvalho Filho <excriptbrasil@gmail.com>, 2021
# Octavio von Sydow <ocvs00@gmail.com>, 2021
# Loyanne Cristine <loyanne.cristine@gmail.com>, 2022
#
#, fuzzy
msgid ""
Expand All @@ -16,7 +17,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-16 06:28+0000\n"
"PO-Revision-Date: 2021-06-28 00:54+0000\n"
"Last-Translator: Octavio von Sydow <ocvs00@gmail.com>, 2021\n"
"Last-Translator: Loyanne Cristine <loyanne.cristine@gmail.com>, 2022\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/python-doc/"
"teams/5390/pt_BR/)\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -572,6 +573,8 @@ msgid ""
"Renames definitions of methods called :meth:`__nonzero__` to :meth:`~object."
"__bool__`."
msgstr ""
"Renomeia as definições de métodos chamados :meth:`__nonzero__` para :meth:"
"`~object.__bool__`."

#: ../../library/2to3.rst:341
msgid "Converts octal literals into the new syntax."
Expand Down Expand Up @@ -788,6 +791,15 @@ msgid ""
"library in Python 3.13. Consider third-party alternatives such as `LibCST`_ "
"or `parso`_."
msgstr ""
"Python 3.9 mudou para um analisador GASE (veja :pep:`617`) enquanto lib2to3 "
"está usando um analisador LL(1) menos flexível. Python 3.10 inclui uma nova "
"sintaxe de linguagem não analisável pelo analisador LL(1) da lib2to3 (veja :"
"pep:`634`). O módulo ``lib2to3``foi marcado como pendente para "
"descontinuação na versão Python 3.9 (aumentando :exc:"
"`PendingDeprecationWarning` na importação) e totalmente obsoleto na versão "
"Python 3.11 (aumentando :exc:`DeprecationWarning`). Ele será removido da "
"biblioteca padrão na versão Python 3.13. Considere alternativas de terceiros "
"como `LibCST`_ ou `parso`_."

#: ../../library/2to3.rst:480
msgid ""
Expand Down
15 changes: 13 additions & 2 deletions library/_thread.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Marcos Jurach <marcosvjurach@gmail.com>, 2021
# Fabio Aragao <fabio_aragao@yahoo.com.br>, 2021
# Rafael Fontenelle <rffontenelle@gmail.com>, 2021
# Loyanne Cristine <loyanne.cristine@gmail.com>, 2022
#
#, fuzzy
msgid ""
Expand All @@ -18,7 +19,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-16 06:28+0000\n"
"PO-Revision-Date: 2021-06-28 00:54+0000\n"
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2021\n"
"Last-Translator: Loyanne Cristine <loyanne.cristine@gmail.com>, 2022\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/python-doc/"
"teams/5390/pt_BR/)\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -114,29 +115,39 @@ msgid ""
"use this function to interrupt the main thread, though there is no guarantee "
"that the interruption will happen immediately."
msgstr ""
"Simule o efeito de um sinal chegando na thread principal. Uma thread pode "
"usar esta função para interromper a thread principal, embora não haja "
"garantia de que a interrupção ocorrerá imediatamente."

#: ../../library/_thread.rst:70
msgid ""
"If given, *signum* is the number of the signal to simulate. If *signum* is "
"not given, :data:`signal.SIGINT` is simulated."
msgstr ""
"Se fornecido, *signum* é o número do sinal a ser simulado. Se *signum* não "
"for fornecido, :data:`signal.SIGINT` será simulado."

#: ../../library/_thread.rst:73
msgid ""
"If the given signal isn't handled by Python (it was set to :data:`signal."
"SIG_DFL` or :data:`signal.SIG_IGN`), this function does nothing."
msgstr ""
"Se o sinal fornecido não for tratado por Python (foi definido como :data:"
"`signal.SIG_DFL` ou :data:`signal.SIG_IGN`), esta função não faz nada."

#: ../../library/_thread.rst:77
msgid "The *signum* argument is added to customize the signal number."
msgstr ""
msgstr "O argumento *signum* é adicionado para personalizar o sinal de número."

#: ../../library/_thread.rst:81
msgid ""
"This does not emit the corresponding signal but schedules a call to the "
"associated handler (if it exists). If you want to truly emit the signal, "
"use :func:`signal.raise_signal`."
msgstr ""
"Isso não emite o sinal correspondente, mas agenda uma chamada para o "
"tratador associado (se existir). Se você quer realmente emitir o sinal, use :"
"func:`signal.raise_signal`."

#: ../../library/_thread.rst:88
msgid ""
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx-intl
git+https://github.com/sphinx-doc/sphinx-intl@6b3913fea5a8c9b819818b9b28b6d0d0b6f022b3
powrap
pomerge
18 changes: 9 additions & 9 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ LANGUAGE=${1:-pt_BR}

ROOTDIR="$(dirname $0)/.."

cd ${ROOTDIR}
cd "${ROOTDIR}"

test -f cpython/Doc/conf.py || ( echo Unable to find proper CPython Doc folder; exit 1; )

pofiles=$(find . -maxdepth 2 -name '*.po' | sort -u)
if ! test -f cpython/Doc/conf.py; then
echo Unable to find proper CPython Doc folder
exit 1
fi

for po in ${pofiles}; do
for po in $(find . -type f -name '*.po' | sort | sed 's|^\./||'); do
install -Dm644 ${po} "cpython/Doc/locales/${LANGUAGE}/LC_MESSAGES/${po}"
done

sphinx-build -b html -d build/doctrees -q --keep-going -jauto -D locale_dirs=locales -D language=pt_BR -D gettext_compact=0 -D latex_engine=xelatex -D latex_elements.inputenc= -D latex_elements.fontenc= -W cpython/Doc cpython/Doc/build/html
sphinx-build -b html -d build/doctrees -a --keep-going -jauto -D locale_dirs=locales -D language=pt_BR -D gettext_compact=0 -D latex_engine=xelatex -D latex_elements.inputenc= -D latex_elements.fontenc= -W cpython/Doc cpython/Doc/build/html

if [ -z "$GITHUB_ACTIONS" ]; then
echo "See file:/$(realpath ${ROOTDIR})/cpython/Doc/build/html/index.html"
echo "or serve it in http://localhost:8080 by running:"
echo "python3 cpython/Tools/scripts/serve.py cpython/Doc/build/html"
echo 'See the built documentation by running the following command:'
echo 'python3 -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('cpython/Doc/build/html/index.html'))""'
fi
29 changes: 15 additions & 14 deletions scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ set -e
# Allow language being passed as 1st argument, defaults to pt_BR
LANGUAGE=${1:-pt_BR}

ROOTDIR=$(dirname $0)/..
ROOTDIR=$(realpath "$(dirname $0)/..")

cd ${ROOTDIR}

test -f cpython/Doc/conf.py || ( echo Unable to find proper CPython Doc folder; exit 1; )
if ! test -f cpython/Doc/conf.py; then
echo Unable to find proper CPython Doc folder
exit 1
fi

# Create POT Files
cd cpython/Doc
Expand All @@ -20,15 +23,13 @@ sphinx-build -E -b gettext -D gettext_compact=0 -d build/.doctrees . locales/pot
# Update CPython's .tx/config
cd locales
sphinx-intl create-txconfig
sphinx-intl update-txconfig-resources -p pot -d . --transifex-project-name python-newest

# Update the translation project's .tx/config
cd ../../.. # back to $ROOTDIR
mkdir -p .tx
sed cpython/Doc/locales/.tx/config \
-e '/^source_file/d' \
-e 's|<lang>/LC_MESSAGES/||' \
-e "s|^file_filter|trans.${LANGUAGE}|" \
> .tx/config

tx pull --languages ${LANGUAGE} --translations --use-git-timestamps --parallel
sphinx-intl update-txconfig-resources -p pot -d . --transifex-organization-name python-doc --transifex-project-name python-newest

# Pull translations into cpython/Doc/locales/LANGUAGE/LC_MESSAGES/
tx pull -l ${LANGUAGE} -t --use-git-timestamps -f

# Finally, move downloaded translation files to the language's repository
cd "${LANGUAGE}/LC_MESSAGES/"
for po in $(find . -type f -name '*.po' | sort | sed 's|^\./||'); do
install -Dm644 ${po} "${ROOTDIR}/${po}"
done