From 57d3486ffe2c7d77e71bb08c22aba9242ad133d8 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Fri, 17 Jan 2025 21:53:29 -0300 Subject: [PATCH 1/9] scripts: get branch name from cpython --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 6be5c8028..e34cd151d 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,7 +15,7 @@ mkdir -p logs # This confval is not needed since 3.12. # In 3.13, its presence messes 3.13's syntax checking (?) opts="-D language=${PYDOC_LANGUAGE} --keep-going -w ../../logs/sphinxwarnings.txt" -minor_version=$(git branch --show-current | sed 's|^3\.||') +minor_version=$(git -C cpython/Doc branch --show-current | sed 's|^3\.||') if [ $minor_version -lt 12 ]; then opts += '-D gettext_compact=False' fi From b2146d2f95c686bddea7c64d2475b08e19989992 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 21 Jan 2025 16:41:07 -0300 Subject: [PATCH 2/9] Fix variable definition in build.sh --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index e34cd151d..f42759c41 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -17,7 +17,7 @@ mkdir -p logs opts="-D language=${PYDOC_LANGUAGE} --keep-going -w ../../logs/sphinxwarnings.txt" minor_version=$(git -C cpython/Doc branch --show-current | sed 's|^3\.||') if [ $minor_version -lt 12 ]; then - opts += '-D gettext_compact=False' + opts+='-D gettext_compact=False' fi make -C cpython/Doc html SPHINXOPTS="${opts}" From 4bf908dbd3ed0fddabc0eb72873c721f2801ff7e Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Thu, 23 Jan 2025 23:11:23 -0300 Subject: [PATCH 3/9] Another take on variable from build.sh --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index f42759c41..ee338368e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -17,7 +17,7 @@ mkdir -p logs opts="-D language=${PYDOC_LANGUAGE} --keep-going -w ../../logs/sphinxwarnings.txt" minor_version=$(git -C cpython/Doc branch --show-current | sed 's|^3\.||') if [ $minor_version -lt 12 ]; then - opts+='-D gettext_compact=False' + opts="$opts -D gettext_compact=False" fi make -C cpython/Doc html SPHINXOPTS="${opts}" From b86b9c50a36abb90e7b074d0b5903ae756303e8e Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Sun, 26 Jan 2025 00:01:26 -0300 Subject: [PATCH 4/9] Get translation stats from local PO files (#256) * Get translation stats from local PO files * Add percentage sign --- .github/workflows/sync.yml | 8 +++--- README.rst | 28 +++++++++---------- scripts/stats.py | 55 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 19 deletions(-) create mode 100755 scripts/stats.py diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 034084f00..7ff462ff2 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -38,7 +38,7 @@ jobs: repository: 'python/cpython' ref: ${{ env.PYDOC_VERSION }} path: cpython - + - name: Set language dir variable run: echo "LANGUAGE_DIR=cpython/Doc/locales/${{ env.PYDOC_LANGUAGE }}/LC_MESSAGES" >> $GITHUB_ENV @@ -113,12 +113,10 @@ jobs: powrap *.po **/*.po - name: Update statistics - if: always() && steps.secret-check.outputs.available == 'true' + if: always() run: | - python ./scripts/tx_stats.py > ./${{ env.LANGUAGE_DIR }}/stats.json + ./scripts/stats.py git -C ./${{ env.LANGUAGE_DIR }} diff stats.json - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - name: Update potodo.md if: always() diff --git a/README.rst b/README.rst index c114af9ee..608bd9b34 100644 --- a/README.rst +++ b/README.rst @@ -29,46 +29,46 @@ Maintained versions: * - `3.13 `_ - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-313/badge.svg :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-313 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.13%2Fstats.json&query=translation&label=pt_BR + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.13%2Fstats.json&query=completion&label=pt_BR :alt: Brazilian Portuguese translation status for Python 3.13 :target: https://app.transifex.com/python-doc/python-newest/ - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.13%2Fstats.json&query=total&label=3.13 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.13%2Fstats.json&query=entries&label=3.13 :alt: Total strings for Python 3.13 :target: https://app.transifex.com/python-doc/python-newest/ * - `3.12 `_ - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-312/badge.svg :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-312 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.12%2Fstats.json&query=translation&label=pt_BR + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.12%2Fstats.json&query=completion&label=pt_BR :alt: Brazilian Portuguese translation status for Python 3.12 :target: https://app.transifex.com/python-doc/python-312/ - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.12%2Fstats.json&query=total&label=3.12 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.12%2Fstats.json&query=entries&label=3.12 :alt: Total strings for Python 3.12 :target: https://app.transifex.com/python-doc/python-312/ * - `3.11 `_ - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-311/badge.svg :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-311 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.11%2Fstats.json&query=translation&label=pt_BR + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.11%2Fstats.json&query=completion&label=pt_BR :alt: Brazilian Portuguese translation status for Python 3.11 :target: https://app.transifex.com/python-doc/python-311/ - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.11%2Fstats.json&query=total&label=3.11 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.11%2Fstats.json&query=entries&label=3.11 :alt: Total strings for Python 3.11 :target: https://app.transifex.com/python-doc/python-311/ * - `3.10 `_ - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-310/badge.svg :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-310 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.10%2Fstats.json&query=translation&label=pt_BR + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.10%2Fstats.json&query=completion&label=pt_BR :alt: Brazilian Portuguese translation status for Python 3.10 :target: https://app.transifex.com/python-doc/python-310/ - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.10%2Fstats.json&query=total&label=3.10 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.10%2Fstats.json&query=entries&label=3.10 :alt: Total strings for Python 3.10 :target: https://app.transifex.com/python-doc/python-310/ * - `3.9 `_ - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-39/badge.svg :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-39 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.9%2Fstats.json&query=translation&label=pt_BR + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.9%2Fstats.json&query=completion&label=pt_BR :alt: Brazilian Portuguese translation status for Python 3.9 :target: https://app.transifex.com/python-doc/python-39/ - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.9%2Fstats.json&query=total&label=3.9 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.9%2Fstats.json&query=entries&label=3.9 :alt: Total strings for Python 3.9 :target: https://app.transifex.com/python-doc/python-39/ @@ -87,19 +87,19 @@ EOL versions: * - `3.8 `_ - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-38/badge.svg :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-38 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.8%2Fstats.json&query=translation&label=pt_BR + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.8%2Fstats.json&query=completion&label=pt_BR :alt: Brazilian Portuguese translation status for Python 3.8 :target: https://app.transifex.com/python-doc/python-38/ - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.8%2Fstats.json&query=total&label=3.8 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.8%2Fstats.json&query=entries&label=3.8 :alt: Total strings for Python 3.8 :target: https://app.transifex.com/python-doc/python-38/ * - `3.7 `_ - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-37/badge.svg :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-37 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.7%2Fstats.json&query=translation&label=pt_BR + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.7%2Fstats.json&query=completion&label=pt_BR :alt: Brazilian Portuguese translation status for Python 3.7 :target: https://app.transifex.com/python-doc/python-37/ - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.7%2Fstats.json&query=total&label=3.7 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.7%2Fstats.json&query=entries&label=3.7 :alt: Total strings for Python 3.7 :target: https://app.transifex.com/python-doc/python-37/ diff --git a/scripts/stats.py b/scripts/stats.py new file mode 100755 index 000000000..ec2e7e285 --- /dev/null +++ b/scripts/stats.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +""" +Obtain translation stats from the PO files directory and +store it with JSON format into 'stats.json'. +""" + +import json +import os +import logging +from datetime import datetime, timezone +from pathlib import Path + +from potodo.potodo import scan_path + +logging.basicConfig(level=logging.INFO) + + +def main() -> None: + """Main function to generate translation stats.""" + language = os.environ.get("PYDOC_LANGUAGE") + if not language: + raise ValueError("Environment variable PYDOC_LANGUAGE is not set.") + + pofiles_path = Path(f"cpython/Doc/locales/{language}/LC_MESSAGES") + if not pofiles_path.exists(): + raise FileNotFoundError(f"Path does not exist: {pofiles_path}") + + # Check for PO files inside the pofiles_path + if not list(pofiles_path.rglob("*.po")): + raise FileNotFoundError(f"No PO files found in {pofiles_path}") + + stats = scan_path(pofiles_path, no_cache=True, hide_reserved=False, api_url="") + + stats_data = { + "completion": str(round(stats.completion, 2)) + "%", + "translated": stats.translated, + "entries": stats.entries, + "updated_at": datetime.now(timezone.utc).isoformat(timespec="seconds") + "Z", + } + + stats_json = pofiles_path / "stats.json" + try: + with stats_json.open("w") as output_file: + json.dump(stats_data, output_file) + logging.info(f"Content written to {stats_json}") + except IOError as e: + logging.error(f"Failed to write to {stats_json}: {e}") + raise + + +if __name__ == "__main__": + try: + main() + except Exception as e: + logging.error(f"An error occurred: {e}") From 9db8afd5e5cdb14d6f9f9dbf5c47a1638c5faa5f Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Wed, 30 Apr 2025 20:25:20 -0300 Subject: [PATCH 5/9] lint: Remove disabling step of literal blocks (#260) --- scripts/lint.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/lint.sh b/scripts/lint.sh index 721790e5d..0682d29df 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -20,14 +20,10 @@ touch logs/sphinxlint.txt cd cpython/Doc -# If version is 3.12 or newer, then generate POT disabling literal blocks and -# update translations with fresh POT files. If version 3.11 or older, -# disable new 'unnecessary-parentheses' check, not fixed before these versions. +# If version 3.11 or older, disable new 'unnecessary-parentheses' check, +# not fixed before 3.12. minor_version=$(git branch --show-current | sed 's|^3\.||') -if [ $minor_version -ge 12 ]; then - make gettext SPHINXOPTS='-q -Dgettext_additional_targets=["index"]' - sphinx-intl update -p build/gettext -l ${PYDOC_LANGUAGE} > /dev/null -else +if [ $minor_version -le 11 ]; then alias sphinx-lint='sphinx-lint --disable unnecessary-parentheses' fi From 044c6c11cda37292363b45bc221392950252cd99 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Thu, 8 May 2025 10:28:04 -0300 Subject: [PATCH 6/9] Add 3.14 to table in README.rst --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index 608bd9b34..ad2bb91ec 100644 --- a/README.rst +++ b/README.rst @@ -26,6 +26,15 @@ Maintained versions: - Sync status - Translation progress - Total strings + * - `3.14 `_ + - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-314/badge.svg + :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-314 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.14%2Fstats.json&query=completion&label=pt_BR + :alt: Brazilian Portuguese translation status for Python 3.14 + :target: https://app.transifex.com/python-doc/python-newest/ + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.14%2Fstats.json&query=entries&label=3.14 + :alt: Total strings for Python 3.14 + :target: https://app.transifex.com/python-doc/python-newest/ * - `3.13 `_ - .. image:: https://github.com/python/python-docs-pt-br/workflows/python-313/badge.svg :target: https://github.com/python/python-docs-pt-br/actions?workflow=python-313 From 96febca62194a7f0fc4e590ad8cf567c6cf61e5e Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Thu, 8 May 2025 10:32:01 -0300 Subject: [PATCH 7/9] Add Python 3.14 workflow as python-newest --- .github/workflows/python-310.yml | 2 +- .github/workflows/python-311.yml | 2 +- .github/workflows/python-312.yml | 8 +------- .github/workflows/python-313.yml | 6 +++--- .github/workflows/python-314.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/python-39.yml | 2 +- 6 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/python-314.yml diff --git a/.github/workflows/python-310.yml b/.github/workflows/python-310.yml index da24a35e1..528e1d252 100644 --- a/.github/workflows/python-310.yml +++ b/.github/workflows/python-310.yml @@ -3,7 +3,7 @@ name: python-310 on: workflow_dispatch: schedule: - - cron: '45 23 * * *' + - cron: '0 0 * * *' jobs: sync: diff --git a/.github/workflows/python-311.yml b/.github/workflows/python-311.yml index ec56ea095..d94ec6867 100644 --- a/.github/workflows/python-311.yml +++ b/.github/workflows/python-311.yml @@ -3,7 +3,7 @@ name: python-311 on: workflow_dispatch: schedule: - - cron: '30 23 * * *' + - cron: '45 23 * * *' jobs: sync: diff --git a/.github/workflows/python-312.yml b/.github/workflows/python-312.yml index b7f747c44..84e24aa4d 100644 --- a/.github/workflows/python-312.yml +++ b/.github/workflows/python-312.yml @@ -2,14 +2,8 @@ name: python-312 on: workflow_dispatch: - pull_request: - branches: - - '3.12' - push: - branches: - - '3.12' schedule: - - cron: '15 23 * * *' + - cron: '30 23 * * *' jobs: sync: diff --git a/.github/workflows/python-313.yml b/.github/workflows/python-313.yml index 60cd85f37..38a259863 100644 --- a/.github/workflows/python-313.yml +++ b/.github/workflows/python-313.yml @@ -11,19 +11,19 @@ on: - main - '3.13' schedule: - - cron: '0 23 * * *' + - cron: '15 23 * * *' jobs: sync: uses: ./.github/workflows/sync.yml with: - tx_project: python-newest + tx_project: ${{ github.workflow }} version: 3.13 secrets: inherit check: uses: ./.github/workflows/check.yml needs: sync with: - tx_project: python-newest + tx_project: ${{ github.workflow }} version: 3.13 secrets: inherit diff --git a/.github/workflows/python-314.yml b/.github/workflows/python-314.yml new file mode 100644 index 000000000..23be47ade --- /dev/null +++ b/.github/workflows/python-314.yml @@ -0,0 +1,29 @@ +name: python-314 + +on: + workflow_dispatch: + pull_request: + branches: + - main + - '3.14' + push: + branches: + - main + - '3.13' + schedule: + - cron: '0 23 * * *' + +jobs: + sync: + uses: ./.github/workflows/sync.yml + with: + tx_project: python-newest + version: 3.14 + secrets: inherit + check: + uses: ./.github/workflows/check.yml + needs: sync + with: + tx_project: python-newest + version: 3.14 + secrets: inherit diff --git a/.github/workflows/python-39.yml b/.github/workflows/python-39.yml index 8dd0a67ad..cc05cc004 100644 --- a/.github/workflows/python-39.yml +++ b/.github/workflows/python-39.yml @@ -3,7 +3,7 @@ name: python-39 on: workflow_dispatch: schedule: - - cron: '0 0 * * *' + - cron: '15 0 * * *' jobs: sync: From 34d2ec74293c01cbdfc14d532f1e16ecec0105e6 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Thu, 8 May 2025 10:33:41 -0300 Subject: [PATCH 8/9] Reorder trigger events in CI --- .github/workflows/python-313.yml | 4 ++-- .github/workflows/python-314.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-313.yml b/.github/workflows/python-313.yml index 38a259863..65672876b 100644 --- a/.github/workflows/python-313.yml +++ b/.github/workflows/python-313.yml @@ -2,6 +2,8 @@ name: python-313 on: workflow_dispatch: + schedule: + - cron: '15 23 * * *' pull_request: branches: - main @@ -10,8 +12,6 @@ on: branches: - main - '3.13' - schedule: - - cron: '15 23 * * *' jobs: sync: diff --git a/.github/workflows/python-314.yml b/.github/workflows/python-314.yml index 23be47ade..1e78d0cf1 100644 --- a/.github/workflows/python-314.yml +++ b/.github/workflows/python-314.yml @@ -2,6 +2,8 @@ name: python-314 on: workflow_dispatch: + schedule: + - cron: '0 23 * * *' pull_request: branches: - main @@ -10,8 +12,6 @@ on: branches: - main - '3.13' - schedule: - - cron: '0 23 * * *' jobs: sync: From 06403be1df09460c47c66a5ab9fe5d4427cbf9fb Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Mon, 19 May 2025 00:38:02 -0300 Subject: [PATCH 9/9] Add more header exceptions to commit.sh (#262) Reduce noise in commits --- scripts/commit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/commit.sh b/scripts/commit.sh index fb1b752e2..86c6d8f12 100755 --- a/scripts/commit.sh +++ b/scripts/commit.sh @@ -19,8 +19,8 @@ set -u # Set for removal the deleted obsolete PO files git status -s | grep '^ D ' | cut -d' ' -f3 | xargs -r git rm -# Add only updates that do not consist only of 'POT-Creation-Date' header change -git diff -I'^"POT-Creation-Date: ' -I'^"Language: pt_BR' --numstat *.po **/*.po | cut -f3 | xargs -r git add -v +# Add only updates that do not consist only of the following header lines +git diff -I'^# Copyright ' -I'^"Project-Id-Version: ' -I'^"POT-Creation-Date: ' -I'^"Language: ' --numstat *.po **/*.po | cut -f3 | xargs -r git add -v # Add currently untracked PO files, and update other helper files untracked_files=$(git ls-files -o --exclude-standard *.po **/*.po)