Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pofmt hook to format PO files #72

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,20 @@ jobs:
cd docs
make gettext
sphinx-intl update -p _build/gettext
cd ..

- name: Check and Commit
run: |
pip install pre-commit
git add docs/
pre-commit run pofmt
git add docs/ src/
git commit -m "Update po files by GitHub Actions"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main

- name: Create issue
shell: python
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ repos:
- id: fix-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/frostming/pofmt
rev: "0.3.0"
hooks:
- id: pofmt
additional_dependencies: ["pangu"]
17 changes: 8 additions & 9 deletions docs/locales/zh_CN/LC_MESSAGES/advanced_foreword.po
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ msgid ""
"One of the design decisions in Flask was that simple tasks should be "
"simple; they should not take a lot of code and yet they should not limit "
"you. Because of that, Flask has a few design choices that some people "
"might find surprising or unorthodox. For example, Flask uses thread-local"
" objects internally so that you don’t have to pass objects around from "
"might find surprising or unorthodox. For example, Flask uses thread-local "
"objects internally so that you don’t have to pass objects around from "
"function to function within a request in order to stay threadsafe. This "
"approach is convenient, but requires a valid request context for "
"dependency injection or when attempting to reuse code which uses a value "
"pegged to the request. The Flask project is honest about thread-locals, "
"does not hide them, and calls out in the code and documentation where "
"they are used."
"does not hide them, and calls out in the code and documentation where they"
" are used."
msgstr ""

#: ../../advanced_foreword.rst:20
Expand All @@ -52,8 +52,8 @@ msgstr ""
msgid ""
"If you write a web application, you are probably allowing users to "
"register and leave their data on your server. The users are entrusting "
"you with data. And even if you are the only user that might leave data in"
" your application, you still want that data to be stored securely."
"you with data. And even if you are the only user that might leave data in "
"your application, you still want that data to be stored securely."
msgstr ""

#: ../../advanced_foreword.rst:29
Expand All @@ -70,8 +70,8 @@ msgstr ""
msgid ""
"The documentation will warn you about aspects of web development that "
"require attention to security. Some of these security concerns are far "
"more complex than one might think, and we all sometimes underestimate the"
" likelihood that a vulnerability will be exploited - until a clever "
"more complex than one might think, and we all sometimes underestimate the "
"likelihood that a vulnerability will be exploited - until a clever "
"attacker figures out a way to exploit our applications. And don't think "
"that your application is not important enough to attract an attacker. "
"Depending on the kind of attack, chances are that automated bots are "
Expand All @@ -85,4 +85,3 @@ msgid ""
"must build with caution, watching for exploits when building to your "
"requirements."
msgstr ""

Loading