diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 477f87e56..5cf155e8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ 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 }} @@ -40,16 +40,18 @@ jobs: 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 @@ -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/ diff --git a/.github/workflows/compendium.yml b/.github/workflows/compendium.yml index cb66d1484..35675300f 100644 --- a/.github/workflows/compendium.yml +++ b/.github/workflows/compendium.yml @@ -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 @@ -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 diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 223fe1e07..beb9ad12f 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/library/2to3.po b/library/2to3.po index 36eeb11e1..20e4b70f9 100644 --- a/library/2to3.po +++ b/library/2to3.po @@ -8,6 +8,7 @@ # Sheila Gomes , 2021 # Claudio Rogerio Carvalho Filho , 2021 # Octavio von Sydow , 2021 +# Loyanne Cristine , 2022 # #, fuzzy msgid "" @@ -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 , 2021\n" +"Last-Translator: Loyanne Cristine , 2022\n" "Language-Team: Portuguese (Brazil) (https://www.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" "MIME-Version: 1.0\n" @@ -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." @@ -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 "" diff --git a/library/_thread.po b/library/_thread.po index 98425768e..01903b90e 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -10,6 +10,7 @@ # Marcos Jurach , 2021 # Fabio Aragao , 2021 # Rafael Fontenelle , 2021 +# Loyanne Cristine , 2022 # #, fuzzy msgid "" @@ -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 , 2021\n" +"Last-Translator: Loyanne Cristine , 2022\n" "Language-Team: Portuguese (Brazil) (https://www.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" "MIME-Version: 1.0\n" @@ -114,22 +115,29 @@ 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 "" @@ -137,6 +145,9 @@ msgid "" "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 "" diff --git a/requirements.txt b/requirements.txt index c3212d3ac..92be5591c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -sphinx-intl +git+https://github.com/sphinx-doc/sphinx-intl@6b3913fea5a8c9b819818b9b28b6d0d0b6f022b3 powrap pomerge diff --git a/scripts/build.sh b/scripts/build.sh index ed7696ee9..c32e98671 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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 diff --git a/scripts/update.sh b/scripts/update.sh index 2e8eca3c2..d3b149078 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -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 @@ -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|/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