Flask 文档中文翻译

Related tags

Flask flask-docs-zh
Overview

Flask 中文文档

这里是 Flask 文档中文翻译项目,欢迎参与!

  1. 在开始翻译之前,请务必阅读下面的 Contributing Guide 了解贡献流程,然后阅读这个 Issue 了解翻译要求,在这个 Discussion 投票选出你认为合适的翻译词汇,在这个 Discussion 投票选出你喜欢的 Logo。
  2. 需要强调的是,完成一章的翻译要提交两个 PR:第一个 PR 在对应的章节条目后添加自己的用户名以认领章节;第二个 PR 翻译对应的 .po 文件并勾选完成的章节条目。先认领,再翻译,一次只认领一章。
  3. 不要改动任何 ReStructuredText 标记、变量/类/函数/方法名称、URL 等。

如果有其他问题和相关想法,请创建 Discussion 发起讨论;如果对翻译流程和项目设置有改进建议,或是发现了翻译错误和笔误,请创建 Issue 反馈。

这个项目在后期会转移到 Flask Community Work Group 组织,并链接到 Flask 官方文档作为官方中文翻译。

Contributing Guide

Installation

  • Click the "Fork" button to fork this repository on GitHub.
  • Clone your fork repository locally (replace {username} with your username):
$ git clone https://github.com/{username}/flask-docs-zh
$ cd flask-docs-zh
$ git remote add upstream https://github.com/greyli/flask-docs-zh
  • Create a virtual environment and install requirements:

For Linux/macOS:

$ python3 -m venv env
$ source env/bin/activate
$ python -m pip install --upgrade pip setuptools
$ pip install -r requirements/dev.txt
$ pip install -e .
$ pre-commit install

For Windows:

> python -m venv env
> env\Scripts\activate
> python -m pip install --upgrade pip setuptools
> pip install -r .\requirements\dev.txt
> pip install -e .
> pre-commit install

Self-Assignment

  • Open your fork repository on GitHub.
  • Click the "Fetch upstream" button to update your fork.
  • Click the edit button (a pencil icon in the upper right corner of the README) to edit the README.
  • Find the "Translation To-do List" section, mark the chapter you want to translate in following format:
- [ ] example @your_username Your Name

You can link the username to your GitHub profile:

- [ ] example [@your_username](https://github.com/your_username) Your Name
  • Leave a commit message (e.g., "Assign example to @your_username"), then select "Create a new branch for this commit and start a pull request" and click the "Commit changes" button to create a PR.

Translation

  • When the self-assignment PR is merged, create a new branch locally (be sure to update the example branch name, for example, translate-cli):
$ git fetch upstream
$ git checkout -b your-branch-name upstream/main
  • Translate the .po file in the docs/locales/zh_CN/LC_MESSAGES directory.

An example of one such file, from docs/.../index.po, is given below.

#: ../../index.rst:4
msgid "Welcome to Flask"
msgstr "欢迎来到 Flask"

Another case, msgid is multi-line text and contains reStructuredText syntax:

#: ../../index.rst:11
msgid ""
"Welcome to Flask's documentation. Get started with :doc:`installation` "
"and then get an overview with the :doc:`quickstart`."
msgstr ""
"欢迎来到 Flask 的文档。你可以从 :doc:`installation` 入手"
"然后阅读 :doc:`quickstart` 来了解基本概念。"

Please be careful not to break reST notation. Most po-editors will help you with that.

  • Mark the chapter as finished (fill the checkbox with "x"):
- [x] example @your_username Your Name
  • Update the Last-Translator field at the top of the .po file.
  • Commit the changes:
$ git add docs/locales/zh_CN/LC_MESSAGES/example.po README.md
$ git commit -m "Translate docs/example"
  • Build the docs and preview the changes:

For Linux/macOS:

$ cd docs
$ make html

For Windows:

> cd docs
> .\make.bat html

Open {project_location}/docs/_build/html/index.html in your browser to view the docs.

  • If everything is working as expected, push the changes to GitHub:
$ git push origin your-branch-name
  • Open the home page of your forked repository, you will see a notice about the new branch. Click the "Compare & pull request" button to create a PR.
  • The translation coordinator will review your PR very soon. Thank you!

Translation To-do List

Be sure only mark one chapter at a time, mark another one when the former PR is created. Unless it's a long chapter, we may reset the assignment if you doesn't finish the translation in ten days.

docs/

  • advanced_foreword (reserved)
  • appcontext @rosekc rosekc
  • async-await
  • becomingbig
  • blueprints
  • changes
  • cli
  • config
  • contributing
  • debugging
  • design
  • errorhandling
  • extensiondev
  • extensions
  • foreword (reserved)
  • htmlfaq
  • index @greyli Grey Li
  • installation @greyli Grey Li
  • logging
  • quickstart (reserved)
  • reqcontext
  • security
  • server
  • shell
  • signals
  • templating
  • testing
  • views

docs/tutorial/ (reserved)

  • blog
  • database
  • deploy
  • factory
  • index @greyli Grey Li
  • install
  • layout
  • next
  • static
  • templates
  • tests
  • views

docs/deploying/

  • asgi
  • cgi
  • fastcgi
  • index @180909 180909
  • mod_wsgi
  • uwsgi
  • wsgi-standalone

docs/patterns/

  • appdispatch
  • appfactories
  • caching
  • celery
  • deferredcallbacks
  • distribute
  • fabric
  • favicon
  • fileuploads
  • flashing
  • index
  • jquery
  • lazyloading
  • methodoverrides
  • mongoengine
  • packages
  • requestchecksum
  • singlepageapplications
  • sqlalchemy
  • sqlite3
  • streaming
  • subclassing
  • templateinheritance
  • urlprocessors
  • viewdecorators
  • wtforms

docs/api

  • L0~L1000
  • L1000~L1500
  • L1500~L2000
  • L2000~L2500
  • L2500~L3000
  • L3000~L3500
  • L3500~L4000
  • L4000~L4500
  • L4500~L5000
  • L5000~L5500
  • L5500~L6000
  • L6000~L6500
Comments
  • Setup workflow to sync with upstream docs

    Setup workflow to sync with upstream docs

    This PR sets up a GitHub action to sync with upstream periodically(per hour) and generates translation files in case there are any changes with the docs/ folder.

    opened by frostming 6
  • 翻译 pattern/SQLAlchemy

    翻译 pattern/SQLAlchemy

    1. Engine 在这里应该指的只是那个变量的名字,翻译成引擎相当于徒增术语,没什么好翻的。
    2. 我不知道注释要不要翻,对我来说这些代码都很直接,如果需要翻就跟我说一下就行。
    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    • [x] 如果你是第一个翻译者,同时更新 .po 文件顶部的 FIRST AUTHOR <EMAIL@ADDRESS>,替换为你的名字和 Email 地址。
    opened by wnykuang 4
  • Translate docs/security

    Translate docs/security

    第一次翻译 & 提交,烦请指正。不知道提交之后为什么显示英文原文的每句长度有变化,我是用 Poedit 来编辑的,并没有改动英文原文。

    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    • [x] 如果你是第一个翻译者,同时更新 .po 文件顶部的 FIRST AUTHOR <EMAIL@ADDRESS>,替换为你的名字和 Email 地址。
    reviewing 
    opened by kylinbin 4
  • Translate reqcontext

    Translate reqcontext

    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    published 
    opened by rosekc 3
  • 仓库已重置,启用 Sphinx / gettext 翻译流程

    仓库已重置,启用 Sphinx / gettext 翻译流程

    基于 #21 的讨论,翻译流程改为使用 po 文件,而不是直接编辑源文件。

    因为原仓库删除了 Flask 仓库原有的 commit,所以为了能够和 Flask 仓库同步变动,重置了这个仓库。已经 fork 的话请删除重新创建仓库。另外相关 PR 已经关闭(#14、#17、#18、#22),请后续重新创建。抱歉!

    opened by greyli 3
  • 使用现有翻译流程还是迁移到 Sphinx / gettext / Transifex?

    使用现有翻译流程还是迁移到 Sphinx / gettext / Transifex?

    起初的翻译流程设想在 https://github.com/flaskcwg/meta/issues/1 。基本流程就是直接翻译英文文档源文件(参考 README),然后追踪 Flask 文档的变动并手动更新到译文。

    现在的问题是这个方式也许并不是合理的翻译流程。不过我对 Sphinx / gettext / Transifex 的工作流程还不够熟悉,需要进一步了解。欢迎评论指出两种方式的优缺点,以及后一种流程的基本运作方式,或是其他相关想法。

    Sphinx / gettext / Transifex 相关参考文档:https://www.sphinx-doc.org/en/master/usage/advanced/intl.html

    opened by greyli 3
  • Translate docs/views

    Translate docs/views

    分支名创建的时候叫错了, 这里在translate-async/await直接翻译了views的文档

    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    opened by labike 2
  • Translate advanced-foreword

    Translate advanced-foreword

    reopen #14

    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。

    Note:

    • 线程局部变量翻译采用自 #12,但原文中有提到 Thread-local Objects,线程局部对象是否更优?另据 https://werkzeug.palletsprojects.com/en/2.0.x/local/ thread locals 的全称为 thread-local data,但根据这里的上下文我还是倾向 线程局部对象 这个翻译
    published 
    opened by rosekc 2
  • Translate blueprints - frostming

    Translate blueprints - frostming

    • Error handler 采用了「错误处理器」的翻译
    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    published 
    opened by frostming 2
  • Bump sphinx-tabs from 3.0.0 to 3.1.0

    Bump sphinx-tabs from 3.0.0 to 3.1.0

    Bumps sphinx-tabs from 3.0.0 to 3.1.0.

    Release notes

    Sourced from sphinx-tabs's releases.

    Version 3.1.0

    See CHANGELOG.md

    Changelog

    Sourced from sphinx-tabs's changelog.

    3.1.0 - 2021-06-11

    Added

    • 👌 Added mew sphinx config sphinx_tabs_disable_css_loading option to disable css from loading
    Commits
    • d921af3 🚀 RELEASE: v3.1.0 (#125)
    • f4d1016 🧪 TESTS: Skip failing rinohtype tests (#124)
    • 5564197 🧪 TESTS: Add tests for disable_css_loading option
    • 54776a3 👌 IMPROVE: Add sphinx option to disable css from loading
    • 69f31ff 🧪 TESTS: Fix Jest version for JS testing (#119)
    • 41cdcd3 📚 DOCS: Add PDF format to the Read The Docs config (#116)
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump pip-tools from 6.1.0 to 6.2.0

    Bump pip-tools from 6.1.0 to 6.2.0

    Bumps pip-tools from 6.1.0 to 6.2.0.

    Release notes

    Sourced from pip-tools's releases.

    6.2.0

    Features:

    Bug Fixes:

    • Fix pip-compile package ordering (#1419). Thanks @​adamsol
    • Add --strip-extras option to pip-compile for producing constraint compatible output (#1404). Thanks @​ssbarnea
    • Fix click v7 version_option compatibility (#1410). Thanks @​FuegoFro
    • Pass package_name explicitly in click.version_option decorators for compatibility with click>=8.0 (#1400). Thanks @​nicoa

    Other Changes:

    Changelog

    Sourced from pip-tools's changelog.

    6.2.0 (2021-06-22)

    Features:

    Bug Fixes:

    • Fix pip-compile package ordering (#1419). Thanks @​adamsol
    • Add --strip-extras option to pip-compile for producing constraint compatible output (#1404). Thanks @​ssbarnea
    • Fix click v7 version_option compatibility (#1410). Thanks @​FuegoFro
    • Pass package_name explicitly in click.version_option decorators for compatibility with click>=8.0 (#1400). Thanks @​nicoa

    Other Changes:

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Translate docs/quickstart

    Translate docs/quickstart

    Progress: 20%

    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [ ] 在本地生成文档并预览输出,处理所有错误和异常。
    • [ ] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    • [x] 如果你是第一个翻译者,同时更新 .po 文件顶部的 FIRST AUTHOR <EMAIL@ADDRESS>,替换为你的名字和 Email 地址。
    opened by greyli 0
  • Translate docs/config

    Translate docs/config

    第一次参与项目翻译,有做的不好的地方还请原谅并指正 :)

    1. 我使用 Poedit 进行翻译,内部提示有一个错误 msgid 的错误,但是我在生成 HTML 的过程中暂时没有发现任何异常。
    2. 对 README 中我的名字进行了稍稍的修改,看起来更自然了。
    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    • [x] 如果你是第一个翻译者,同时更新 .po 文件顶部的 FIRST AUTHOR <EMAIL@ADDRESS>,替换为你的名字和 Email 地址。
    awaiting review 
    opened by guiqiqi 1
  • Translate patterns/sqlalchemy

    Translate patterns/sqlalchemy

    1. Engine 在这里应该指的只是那个变量的名字,翻译成引擎相当于徒增术语,没什么好翻的。
    2. 我不知道注释要不要翻,如果需要翻就跟我说一下就行。
    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    • [x] 如果你是第一个翻译者,同时更新 .po 文件顶部的 FIRST AUTHOR <EMAIL@ADDRESS>,替换为你的名字和 Email 地址。
    reviewing 这是你的 last dance 
    opened by wnykuang 0
  • 翻译审核流程

    翻译审核流程

    考虑实行下面的审核流程,欢迎提出改进建议。

    首先对一个翻译进行一个大概的质量判断,根据翻译准确度和行文流畅度,给翻译划分质量等级:

    • low:基本含义翻译错误,排版混乱,语句不通畅
    • medium:没有翻译错误,排版正确,语句基本通畅
    • high:没有翻译错误,排版正确,行文流畅

    分别使用对应的标签进行标记,并采取相应措施:

    • high:审核优先级高。鼓励翻译更多章节
    • medium:审核优先级中等。委婉建议优化和改进翻译后的措辞流畅度,比如不必完全直译
    • low:审核优先级低。不再接受后续翻译请求。如果质量非常差,而且给出审核意见后改进意愿很低,可以考虑关闭 PR

    P.S. 目前只有我和 @frostming 在做审核工作,如果你的英语足够好,欢迎帮忙审核已经提交的 PR。另外我也会尝试邀请翻译过旧版本 Flask 中文文档的作者。

    meta 
    opened by greyli 9
  • Translate docs/server

    Translate docs/server

    • fixes #
    • [x] 在 README.md 中勾选翻译的章节条目(把方括号里的空格替换为 x).
    • [x] 在本地生成文档并预览输出,处理所有错误和异常。
    • [x] 运行 pre-commit 钩子,处理所有问题。
    • [x] 更新 .po 文件顶部的 Last-Translator 字段。
    reviewing 我看好你哦 
    opened by LeeRnnGii 3
Owner
Grey Li
Web developer, member of @pallets, creator of @helloflask.
Grey Li
Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Flask-Bcrypt Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application. Due to the recent increased prevelance of

Max Countryman 310 Dec 14, 2022
Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.

Flask-Rebar Flask-Rebar combines flask, marshmallow, and swagger for robust REST services. Features Request and Response Validation - Flask-Rebar reli

PlanGrid 223 Dec 19, 2022
Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Flask-Bcrypt Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application. Due to the recent increased prevelance of

Max Countryman 282 Feb 11, 2021
Flask-Starter is a boilerplate starter template designed to help you quickstart your Flask web application development.

Flask-Starter Flask-Starter is a boilerplate starter template designed to help you quickstart your Flask web application development. It has all the r

Kundan Singh 259 Dec 26, 2022
Brandnew-flask is a CLI tool used to generate a powerful and mordern flask-app that supports the production environment.

Brandnew-flask is still in the initial stage and needs to be updated and improved continuously. Everyone is welcome to maintain and improve this CLI.

brandonye 4 Jul 17, 2022
Flask Project Template A full feature Flask project template.

Flask Project Template A full feature Flask project template. See also Python-Project-Template for a lean, low dependency Python app. HOW TO USE THIS

Bruno Rocha 96 Dec 23, 2022
A Fast API style support for Flask. Gives you MyPy types with the flexibility of flask

Flask-Fastx Flask-Fastx is a Fast API style support for Flask. It Gives you MyPy types with the flexibility of flask. Compatibility Flask-Fastx requir

Tactful.ai 18 Nov 26, 2022
Flask-app scaffold, generate flask restful backend

Flask-app scaffold, generate flask restful backend

jacksmile 1 Nov 24, 2021
Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure.

Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure. All the required libraries are already installed easily to use in any big project.

Ajay kumar sharma 5 Jun 14, 2022
flask-reactize is a boostrap to serve any React JS application via a Python back-end, using Flask as web framework.

flask-reactize Purpose Developing a ReactJS application requires to use nodejs as back end server. What if you want to consume external APIs: how are

Julien Chomarat 4 Jan 11, 2022
Pf-flask-rest-com - Flask REST API Common Implementation by Problem Fighter Library

In the name of God, the Most Gracious, the Most Merciful. PF-Flask-Rest-Com Docu

Problem Fighter 3 Jan 15, 2022
Flask-Discord-Bot-Dashboard - A simple discord Bot dashboard created in Flask Python

Flask-Discord-Bot-Dashboard A simple discord Bot dashboard created in Flask Pyth

Ethan 8 Dec 22, 2022
Open-source Flask Sample built on top of flask-dance library

Open-source Flask Sample built on top of flask-dance library. The project implements the social login for Github and Twitter - Originally coded by TestDriven.IO.

App Generator 4 Jul 26, 2022
Flask-redmail - Email sending for Flask

Flask Red Mail: Email Sending for Flask Flask extension for Red Mail What is it?

Mikael Koli 11 Sep 23, 2022
Flask Sitemapper is a small Python 3 package that generates XML sitemaps for Flask applications.

Flask Sitemapper Flask Sitemapper is a small Python 3 package that generates XML sitemaps for Flask applications. This allows you to create a nice and

null 6 Jan 6, 2023
Flask-template - A simple template for make an flask api

flask-template By GaGoU :3 a simple template for make an flask api notes: you ca

GaGoU 2 Feb 17, 2022
SQLAlchemy database migrations for Flask applications using Alembic

Flask-Migrate Flask-Migrate is an extension that handles SQLAlchemy database migrations for Flask applications using Alembic. The database operations

Miguel Grinberg 2.2k Dec 28, 2022
Adds SQLAlchemy support to Flask

Flask-SQLAlchemy Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy

The Pallets Projects 3.9k Dec 29, 2022
Cross Origin Resource Sharing ( CORS ) support for Flask

Flask-CORS A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible. This package has a simple philosoph

Cory Dolphin 803 Jan 1, 2023