-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #276 from freakboy3742/translations
Add tooling for translations
- Loading branch information
Showing
77 changed files
with
10,242 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Update pre-commit | ||
|
||
on: | ||
schedule: | ||
- cron: "0 20 * * SUN" # Sunday @ 2000 UTC | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pre-commit-update: | ||
name: Update pre-commit | ||
uses: beeware/.github/.github/workflows/pre-commit-update.yml@main | ||
secrets: inherit | ||
with: | ||
pre-commit-source: pre-commit | ||
create-changenote: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Update Translations | ||
on: | ||
push: | ||
branches: | ||
main | ||
|
||
# Cancel active CI runs for a PR before starting another run | ||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash # https://github.com/beeware/briefcase/pull/912 | ||
|
||
env: | ||
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
update-translations: | ||
name: Update Translations | ||
if: github.actor != 'brutus[bot]' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
fetch-depth: 1 | ||
token: ${{ secrets.BRUTUS_PAT_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4.7.1 | ||
with: | ||
python-version: "3.X" | ||
cache: pip | ||
cache-dependency-path: | | ||
**/pyproject.toml | ||
.pre-commit-config.yaml | ||
- name: Update pip | ||
run: python -m pip install -U pip | ||
|
||
- name: Install tox | ||
run: python -m pip install .[dev] | ||
|
||
- name: Configure git | ||
run: | | ||
git config --local user.email "$(git log --pretty='%ae' -1)" | ||
git config --local user.name "brutus[bot]" | ||
- name: Regenerate PO files | ||
run: | | ||
tox -e docs-translate | ||
- name: Update Needed? | ||
id: updated | ||
run: | | ||
if [[ $(git status --porcelain) ]]; then | ||
echo "updated=true" >> ${GITHUB_OUTPUT} | ||
else | ||
echo "updated=false" >> ${GITHUB_OUTPUT} | ||
fi | ||
- name: Commit updated translations | ||
if: steps.updated.outputs.updated == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
# Commit the updated PO files. | ||
git add docs/locale | ||
git commit -m "Update translations." | ||
git push origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: end-of-file-fixer | ||
# PO files may not have a trailing EOL, as they are tool generated | ||
exclude: "docs/locales" | ||
- id: trailing-whitespace | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.15.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py38-plus] | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.12.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.6 | ||
hooks: | ||
- id: codespell | ||
# remove toml extra once Python 3.10 is no longer supported | ||
additional_dependencies: ['.[toml]'] | ||
# Can't spell check a file that isn't in english... | ||
exclude: "docs/locales" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.