wangweimin пре 4 година
родитељ
комит
e3c8ce2495

+ 2 - 2
README.md

@@ -16,7 +16,7 @@
         <img src="https://img.shields.io/pypi/v/pywebio?colorB=brightgreen" alt="Package version">
     </a>
     <a href="https://pypi.org/project/PyWebIO/">
-        <img src="https://img.shields.io/pypi/pyversions/PyWebIO.svg?colorB=brightgreen" alt="Python Version">
+        <img src="https://img.shields.io/badge/python->%3D%203.5.2-brightgreen" alt="Python Version">
     </a>
     <br/>
     <a href="https://lgtm.com/projects/g/wang0618/PyWebIO/context:python">
@@ -173,7 +173,7 @@ Document is on [https://pywebio.readthedocs.io](https://pywebio.readthedocs.io)
         <img src="https://img.shields.io/pypi/v/pywebio?colorB=brightgreen" alt="Package version">
     </a>
     <a href="https://pypi.org/project/PyWebIO/">
-        <img src="https://img.shields.io/pypi/pyversions/PyWebIO.svg?colorB=brightgreen" alt="Python Version">
+        <img src="https://img.shields.io/badge/python->%3D%203.5.2-brightgreen" alt="Python Version">
     </a>
     <br/>
     <a href="https://lgtm.com/projects/g/wang0618/PyWebIO/context:python">

+ 8 - 8
demos/__main__.py

@@ -17,10 +17,10 @@ from tornado.options import define, options
 
 index_md = r"""### Basic demo
 
- - [BMI calculation](./bmi): Calculating Body Mass Index based on height and weight [source](https://github.com/wang0618/PyWebIO/blob/dev/demos/bmi.py)
- - [Online chat room](./chat_room): Chat with everyone currently online [source](https://github.com/wang0618/PyWebIO/blob/dev/demos/chat_room.py)
- - [Input demo](./input_usage): Demonstrate various input usage supported by PyWebIO [source](https://github.com/wang0618/PyWebIO/blob/dev/demos/input_usage.py)
- - [Output demo](./output_usage): Demonstrate various output usage supported by PyWebIO [source](https://github.com/wang0618/PyWebIO/blob/dev/demos/output_usage.py)
+ - [BMI calculation](./bmi): Calculating Body Mass Index based on height and weight
+ - [Online chat room](./chat_room): Chat with everyone currently online
+ - [Input demo](./input_usage): Demonstrate various input usage supported by PyWebIO
+ - [Output demo](./output_usage): Demonstrate various output usage supported by PyWebIO
 
 ### Data visualization demo
 PyWebIO supports for data visualization with the third-party libraries.
@@ -58,10 +58,10 @@ PyWebIO supports for data visualization with the third-party libraries.
 
 index_md_zh = r"""### 基本demo
 
- - [BMI计算](./bmi): 根据身高体重计算BMI指数 [源码](https://github.com/wang0618/PyWebIO/blob/dev/demos/bmi.py)
- - [聊天室](./chat_room): 和当前所有在线的人聊天 [源码](https://github.com/wang0618/PyWebIO/blob/dev/demos/chat_room.py)
- - [输入演示](./input_usage):  演示PyWebIO输入模块的用法 [源码](https://github.com/wang0618/PyWebIO/blob/dev/demos/input_usage.py)
- - [输出演示](./output_usage): 演示PyWebIO输出模块的用法 [源码](https://github.com/wang0618/PyWebIO/blob/dev/demos/output_usage.py)
+ - [BMI计算](./bmi): 根据身高体重计算BMI指数
+ - [聊天室](./chat_room): 和当前所有在线的人聊天
+ - [输入演示](./input_usage):  演示PyWebIO输入模块的用法
+ - [输出演示](./output_usage): 演示PyWebIO输出模块的用法 
  - 更多Demo请见[文档](https://pywebio.readthedocs.io)中示例代码的在线Demo
 
 ### 数据可视化demo

+ 5 - 5
demos/input_usage.py

@@ -19,7 +19,7 @@ def t(eng, chinese):
 
 
 def main():
-    """PyWebIO input demo
+    """PyWebIO Input Usage
 
     Demonstrate various input usage supported by PyWebIO.
     演示PyWebIO输入模块的使用
@@ -122,7 +122,7 @@ def main():
     # 输入选项
     put_markdown(t("""#### Parameter of input functions
     There are many parameters that can be passed to the input function:
-    ""","""#### 输入选项
+    """, """#### 输入选项
     输入函数可指定的参数非常丰富:
     """), strip_indent=4)
     put_markdown("""
@@ -137,7 +137,7 @@ def main():
           datalist=['candidate1', 'candidate2', 'candidate2'])
 
     # 校验函数
-    put_markdown(t("""You can specify a validation function for the input by using validate parameter. The validation function should return None when the check passes, otherwise an error message will be returned:""", """我们可以为输入指定校验函数,校验函数校验通过时返回None,否则返回错误消息:"""), strip_indent=4)
+    put_markdown(t("""You can specify a validation function for the input by using `validate` parameter. The validation function should return `None` when the check passes, otherwise an error message will be returned:""", """我们可以为输入指定校验函数,校验函数校验通过时返回`None`,否则返回错误消息:"""), strip_indent=4)
     put_markdown("""
     ```python
     def check_age(p):  # return None when the check passes, otherwise return the error message
@@ -160,7 +160,7 @@ def main():
     put_markdown('`age = %r`' % age)
 
     # Codemirror
-    put_markdown(t("""You can use `code` parameter in `pywebio.input.textarea()` to make a code editing textarea:""", """PyWebIO 的 `textarea()` 输入函数还支持使用 [Codemirror](https://codemirror.net/) 实现代码风格的编辑区,只需使用 `code` 参数传入Codemirror支持的选项即可(最简单的情况是直接传入` code={}` 或 `code=True`):"""), strip_indent=4)
+    put_markdown(t("""You can use `code` parameter in `pywebio.input.textarea()` to create a code editing textarea:""", """PyWebIO 的 `textarea()` 输入函数还支持使用 [Codemirror](https://codemirror.net/) 实现代码风格的编辑区,只需使用 `code` 参数传入Codemirror支持的选项即可(最简单的情况是直接传入` code={}` 或 `code=True`):"""), strip_indent=4)
     put_markdown(r"""
     ```python
     code = textarea('Code Edit', code={
@@ -179,7 +179,7 @@ def main():
 
     # 输入组
     put_markdown(t("""### Input Group
-    `input_group()` accepts a list of single input function call as parameter, and returns a dictionary with the name from the single input function as the key and the input data as the value.
+    `input_group()` accepts a list of single input function call as parameter, and returns a dictionary with the name of the single input function as the key and the input data as the value.
     The input group also supports using `validate` parameter to set the validation function, which accepts the entire form data as parameter:""",
     """### 输入组
     `input_group()` 接受单项输入组成的列表作为参数,输入组中需要在每一项输入函数中提供 `name` 参数来用于在结果中标识不同输入项。输入组中同样支持设置校验函数,其接受整个表单数据作为参数。检验函数校验通过时返回None,否则返回 `(input name,错误消息)`

+ 8 - 8
demos/output_usage.py

@@ -36,7 +36,7 @@ def code_block(code, strip_indent=4):
 
 
 async def main():
-    """PyWebIO Output demo
+    """PyWebIO Output Usage
 
     Demonstrate various output usage supported by PyWebIO.
     演示PyWebIO输出模块的使用
@@ -95,13 +95,13 @@ async def main():
     put_file('hello_word.txt', b'hello word!')
     """))
 
-    put_markdown(t(r"""For all output functions provided by PyWebIO, please refer to the document.
+    put_markdown(t(r"""For all output functions provided by PyWebIO, please refer to the [document](https://pywebio.readthedocs.io/en/latest/output.html#output-func-list).
     
     ### Combined Output
-    The output functions whose name starts with put_ can be combined with some output functions as part of the final output:
+    The output functions whose name starts with `put_` can be combined with some output functions as part of the final output:
 
     You can pass `put_xxx()` calls to `put_table()` as cell content:
-    """, r"""PyWebIO提供的全部输出函数请参考PyWebIO文档
+    """, r"""PyWebIO提供的全部输出函数请参考[PyWebIO文档](https://pywebio.readthedocs.io/zh_CN/latest/output.html#output-func-list)
     
     ### 组合输出
     
@@ -134,11 +134,11 @@ async def main():
     ])
     """)
 
-    put_markdown(t(r"For more output functions that accept `put_xxx()` calls as parameters, please refer to corresponding function documentation.",
-                   r"更多接受`put_xxx()`作为参数的输出函数请参考函数文档。"))
+    put_markdown(t(r"For more output functions that accept `put_xxx()` calls as parameters, please refer to the [document](https://pywebio.readthedocs.io/en/latest/output.html#output-func-list).",
+                   r"更多接受`put_xxx()`作为参数的输出函数请参考[函数文档](https://pywebio.readthedocs.io/zh_CN/latest/output.html#output-func-list)。"))
 
     put_markdown(t(r"""### Callback
-    PyWebIO allows you to output some buttons, and the provided callback function will be executed when the button is clicked.
+    PyWebIO allows you to output some buttons and bind callbacks to them. The provided callback function will be executed when the button is clicked.
     
     This is an example:%s
     The call to `put_table()` will not block. When user clicks a button, the corresponding callback function will be invoked:
@@ -177,7 +177,7 @@ async def main():
     ])
     set_scope('table-callback')
 
-    put_markdown(t("Of course, PyWebIO also supports outputting individual button:", "当然,PyWebIO还支持单独的按钮控件:")+r"""
+    put_markdown(t("Of course, PyWebIO also supports outputting individual buttons:", "当然,PyWebIO还支持单独的按钮控件:")+r"""
     ```python
     def btn_click(btn_val):
         put_markdown("> You click `%s` button" % btn_val)

BIN
docs/assets/demo.gif


BIN
docs/assets/demo.png


BIN
docs/assets/input_1.png


BIN
docs/assets/input_2.png


+ 24 - 23
docs/guide.rst

@@ -124,7 +124,7 @@ The results of the above example are as follows:
 Input Group
 ^^^^^^^^^^^^^
 
-PyWebIO uses input group to get multiple inputs in a single form. `pywebio.input.input_group()` accepts a list of single input function call as parameter, and returns a dictionary with the ``name`` from the single input function as the key and the input data as the value:
+PyWebIO uses input group to get multiple inputs in a single form. `pywebio.input.input_group()` accepts a list of single input function call as parameter, and returns a dictionary with the ``name`` of the single input function as the key and the input data as the value:
 
 
 .. exportable-codeblock::
@@ -301,9 +301,9 @@ For a full list of functions that support context manager, see :ref:`Output func
 Callback
 ^^^^^^^^^^^^^^
 
-As we can see from the above, PyWebIO divides the interaction into two parts: input and output. The input function is blocking, a form will be displayed on the user's web browser when calling input function, the input function will not return util the user submits the form. The output function is used to output content to the browser in real time. The behavior of input and output is consistent with the console program. That's why we say PyWebIO turning the browser into a "rich text terminal". So you can write PyWebIO applications in script programing way.
+As we can see from the above, the interaction of PyWebIO has two parts: input and output. The input function of PyWebIO is blocking, a form will be displayed on the user's web browser when calling input function, the input function will not return until the user submits the form. The output function is used to output content to the browser in real time. The input/output behavior of PyWebIO is consistent with the console program. That's why we say PyWebIO turning the browser into a "rich text terminal". So you can write PyWebIO applications in script programing way.
 
-In addition, PyWebIO also supports event callbacks: PyWebIO allows you to output some buttons, and the provided callback function will be executed when the button is clicked.
+In addition, PyWebIO also supports event callbacks: PyWebIO allows you to output some buttons and bind callbacks to them. The provided callback function will be executed when the button is clicked.
 
 This is an example:
 
@@ -410,9 +410,9 @@ The results of the above code are as follows::
        show_time()    # ..demo-only
        time.sleep(1)  # ..demo-only
 
-When calling ``show_time()`` for the first time, a ``time`` scope will be created at the current position, and the current time will be output to it. And then every time the ``show_time()`` is called, the new content will replace the previous content.
+When calling ``show_time()`` for the first time, a ``time`` scope will be created, and the current time will be output to it. And then every time the ``show_time()`` is called, the new content will replace the previous content.
 
-Scopes can be nested. At the beginning, PyWebIO applications have only one ``ROOT`` Scope. Each time a new scope is created, the nesting level of the scope will increase by one level, and each time the current scope is exited, the nesting level of the scope will be reduced by one. PyWebIO uses the Scope stack to save the nesting level of scope at runtime.
+Scopes can be nested. At the beginning, PyWebIO applications have only one ``ROOT`` Scope. Each time a new scope is created, the nesting level of the scope will increase by one level, and each time the current scope is exited, the nesting level of the scope will be reduced by one. PyWebIO uses the Scope stack to save the scope nesting level at runtime.
 
 For example, the following code will create 3 scopes:
 
@@ -438,7 +438,7 @@ For example, the following code will create 3 scopes:
     put_buttons([('Put text to %s' % i, i) for i in ('A', 'B', 'C')], lambda s: put_text(s, scope=s))  # ..demo-only
 
 
-The above code will generate the following Scope layout::
+The above code will generate the following scope layout::
 
    ┌─ROOT────────────────────┐
    │                         │
@@ -478,13 +478,13 @@ The results of the above code are as follows::
     text2 in scope3
     text in ROOT scope
 
-In addition to directly specifying the target scope name, the ``scope`` parameter can also accept an integer to determine the scope by indexing the scope stack: 0 means the top level scope(the ROOT Scope), -1 means the current Scope, -2 means the scope used before entering the current scope, ...
+In addition to directly specifying the target scope name, the ``scope`` parameter can also accept an integer to determine the scope by indexing the scope stack: 0 means the top level scope(the ROOT Scope), -1 means the current scope, -2 means the scope used before entering the current scope, ...
 
-By default, the content output to the same scope will be arranged from top to bottom according to the calling order of the output function, and the output function called last will output the content to the bottom of the target scope. The output content can be inserted into other positions of the target scope by using the ``position`` parameter of the output function.
+By default, the content output to the same scope will be arranged from top to bottom according to the calling order of the output function. The output content can be inserted into other positions of the target scope by using the ``position`` parameter of the output function.
 
 Each output item in a scope has an index, the first item's index is 0, and the next item's index is incremented by one. You can also use a negative number to index the items in the scope, -1 means the last item, -2 means the item before the last...
 
-The ``position`` parameter of output functions is an integer. When ``position>=0``, it means to insert content before the item whose index equal ``position``; when ``position<0``, it means to insert content after the item whose index equal ``position``:
+The ``position`` parameter of output functions accepts an integer. When ``position>=0``, it means to insert content before the item whose index equal ``position``; when ``position<0``, it means to insert content after the item whose index equal ``position``:
 
 .. exportable-codeblock::
     :name: put-xxx-position
@@ -532,7 +532,7 @@ To view the effects of environment settings, please visit :demo_host:`set_env De
 Layout
 ^^^^^^^^^^^^^^
 
-In general, using the various output functions introduced above is enough to output what you want, but these outputs are arranged vertically. If you want to make a more complex layout (such as displaying a code block on the left side of the page and an image on the right), you need to use layout functions.
+In general, using the output functions introduced above is enough to output what you want, but these outputs are arranged vertically. If you want to create a more complex layout (such as displaying a code block on the left side of the page and an image on the right), you need to use layout functions.
 
 The ``pywebio.output`` module provides 3 layout functions, and you can create complex layouts by combining them:
 
@@ -569,7 +569,7 @@ The layout function also supports customizing the size of each part::
 
     put_row([put_image(...), put_image(...)], size='40% 60%')  # The ratio of the width of two images is 2:3
 
-For more information, please refer to the :ref:`layout function documentation <style_and_layout>`.
+For more information, please refer to the :ref:`layout functions documentation <style_and_layout>`.
 
 Style
 ^^^^^^^^^^^^^^
@@ -617,9 +617,9 @@ In PyWebIO, there are two modes to run PyWebIO applications: running as a script
 
 **Server mode**
 
-In Server mode, PyWebIO will start a web server to continuously provide services. When the user accesses the service address, PyWebIO will open a new session and run PyWebIO application in it.
+In server mode, PyWebIO will start a web server to continuously provide services. When the user accesses the service address, PyWebIO will open a new session and run PyWebIO application in it.
 
-Use `start_server() <pywebio.platform.tornado.start_server>` to start a web server and serve given PyWebIO applications on it. `start_server() <pywebio.platform.tornado.start_server>` accepts a function as PyWebIO application. In addition, `start_server() <pywebio.platform.tornado.start_server>` also accepts a list of task function or a dictionary of it, so that one PyWebIO Server can have multiple services with different functions. You can use `go_app() <pywebio.session.go_app>` or `put_link() <pywebio.output.put_link>` to jump between services::
+Use `start_server() <pywebio.platform.tornado.start_server>` to start a web server and serve given PyWebIO applications on it. `start_server() <pywebio.platform.tornado.start_server>` accepts a function as PyWebIO application. In addition, `start_server() <pywebio.platform.tornado.start_server>` also accepts a list of task function or a dictionary of it, so  one PyWebIO Server can have multiple services with different functions. You can use `go_app() <pywebio.session.go_app>` or `put_link() <pywebio.output.put_link>` to jump between services::
 
     def task_1():
         put_text('task_1')
@@ -635,7 +635,8 @@ Use `start_server() <pywebio.platform.tornado.start_server>` to start a web serv
         put_link('Go task 1', app='task_1')  # Use `app` parameter to specify the task name
         put_link('Go task 2', app='task_2')
 
-    start_server([index, task_1, task_2])  # or start_server({'index': index, 'task_1': task_1, 'task_2': task_2}) For more information, please refer to the function documentation.
+    # equal to `start_server({'index': index, 'task_1': task_1, 'task_2': task_2})`
+    start_server([index, task_1, task_2])
 
 
 Use `path_deploy() <pywebio.platform.path_deploy>` to deploy the PyWebIO applications from a directory.
@@ -651,12 +652,12 @@ For example, given the following folder structure::
    │   └── b.py
    └── c.py
 
-If you use this directory in `path_deploy() <pywebio.platform.path_deploy>`, you can access the PyWebIO application in ``b.py`` by using URL ``http://<hist>:<port>/A/b``.
-And if the files have been modified after run `path_deploy() <pywebio.platform.path_deploy>`, you can use ``reload`` URL parameter to reload application in the file: ``http://<hist>:<port>/A/b?reload``
+If you use this directory in `path_deploy() <pywebio.platform.path_deploy>`, you can access the PyWebIO application in ``b.py`` by using URL ``http://<host>:<port>/A/b``.
+And if the files have been modified after run `path_deploy() <pywebio.platform.path_deploy>`, you can use ``reload`` URL parameter to reload application in the file: ``http://<host>:<port>/A/b?reload``
 
 You can also use the command ``pywebio-path-deploy`` to start a server just like using `path_deploy() <pywebio.platform.path_deploy>`. For more information, refer ``pywebio-path-deploy --help``
 
-In Server mode, you can use `pywebio.platform.seo()` to set the `SEO <https://en.wikipedia.org/wiki/Search_engine_optimization>`_ information. If not ``seo()`` is not used, the `docstring <https://www.python.org/dev/peps/pep-0257/>`_ of the task function will be regarded as SEO information by default.
+In Server mode, you can use `pywebio.platform.seo()` to set the `SEO <https://en.wikipedia.org/wiki/Search_engine_optimization>`_ information. If ``seo()`` is not used, the `docstring <https://www.python.org/dev/peps/pep-0257/>`_ of the task function will be regarded as SEO information by default.
 
 .. attention::
 
@@ -727,9 +728,9 @@ You can use `defer_call(func) <pywebio.session.defer_call>` to set the function
 Integration with web framework
 ---------------------------------
 
-The PyWebIO application can be integrated into an existing Python Web project, and the PyWebIO application and the Web project share a web framework. PyWebIO currently supports integration with Flask, Tornado, Django and aiohttp web frameworks.
+The PyWebIO application can be integrated into an existing Python Web project, the PyWebIO application and the Web project share a web framework. PyWebIO currently supports integration with Flask, Tornado, Django and aiohttp web frameworks.
 
-The integration methods of different web frameworks are as follows:
+The integration methods of those web frameworks are as follows:
 
 .. tabs::
 
@@ -821,7 +822,7 @@ The integration methods of different web frameworks are as follows:
 
          **aiohttp**
 
-      One route need to be added to communicate with the browser through WebSocket:::
+      One route need to be added to communicate with the browser through WebSocket::
 
             from aiohttp import web
             from pywebio.platform.aiohttp import static_routes, webio_handler
@@ -851,7 +852,7 @@ In addition, you can also pass a string to ``cdn`` parameter to directly set the
 
 The path of the static file of PyWebIO is stored in ``pywebio.STATIC_PATH``, you can use the command ``python3 -c "import pywebio; print(pywebio.STATIC_PATH)"`` to print it out.
 
-.. note:: ``start_server()`` also support ``cdn`` parameter, if it is set to ``False``, the static resource will be hosted in local server automatically, without manual hosting.
+.. note:: ``start_server()`` and ``path_deploy()`` also support ``cdn`` parameter, if it is set to ``False``, the static resource will be hosted in local server automatically, without manual hosting.
 
 
 .. _coroutine_based_session:
@@ -917,7 +918,7 @@ In the coroutine task function, you can also use ``await`` to call other corouti
 
    Although the PyWebIO coroutine session is compatible with the ``awaitable objects`` in the standard library ``asyncio``, the ``asyncio`` library is not compatible with the ``awaitable objects`` in the PyWebIO coroutine session.
 
-   That is to say, you can't pass PyWebIO ``awaitable objects`` to the `asyncio`` functions that accept ``awaitable objects``. For example, the following calls are **not supported** ::
+   That is to say, you can't pass PyWebIO ``awaitable objects`` to the ``asyncio`` functions that accept ``awaitable objects``. For example, the following calls are **not supported** ::
 
       await asyncio.shield(pywebio.input())
       await asyncio.gather(asyncio.sleep(1), pywebio.session.eval_js('1+1'))
@@ -1000,7 +1001,7 @@ Example of coroutine-based session integration into Flask:
     threading.Thread(target=run_event_loop, daemon=True).start()
     app.run(host='localhost', port=80)
 
-Finally, coroutine-based session is not available in the Script mode. You always need to use ``start_server()`` to run coroutine task function or integrate it to a web framework.
+Finally, coroutine-based session is not available in the script mode. You always need to use ``start_server()`` to run coroutine task function or integrate it to a web framework.
 
 Last but not least
 ---------------------

+ 143 - 139
docs/locales/zh_CN/LC_MESSAGES/guide.po

@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PyWebIO 1.1.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-03-18 14:41+0800\n"
-"PO-Revision-Date: 2021-03-18 15:27+0800\n"
+"POT-Creation-Date: 2021-03-23 19:49+0800\n"
+"PO-Revision-Date: 2021-03-23 19:57+0800\n"
 "Last-Translator: WangWeimin <wang0.618@qq.com>\n"
 "Language: zh_CN\n"
 "Language-Team: \n"
@@ -232,10 +232,10 @@ msgstr "输入组"
 #: ../../guide.rst:127
 msgid ""
 "PyWebIO uses input group to get multiple inputs in a single form. `pywebio.input.input_group()` accepts a list of single input function call as "
-"parameter, and returns a dictionary with the ``name`` from the single input function as the key and the input data as the value:"
+"parameter, and returns a dictionary with the ``name`` of the single input function as the key and the input data as the value:"
 msgstr ""
-"PyWebIO支持输入组, 返回结果为一个字典。`pywebio.input.input_group()` 接受单项输入组成的列表作为参数, 返回以单项输入函数中的 ``name`` 作为键、以输入"
-"数据为值的字典:"
+"PyWebIO支持输入组, 返回结果为一个字典。`pywebio.input.input_group()` 接受单项输入组成的列表作为参数, 返回以单项输入中的 ``name`` 作为键、以输入数据"
+"为值的字典:"
 
 #: ../../guide.rst:130
 msgid ""
@@ -452,19 +452,19 @@ msgstr "事件回调"
 
 #: ../../guide.rst:304
 msgid ""
-"As we can see from the above, PyWebIO divides the interaction into two parts: input and output. The input function is blocking, a form will be "
-"displayed on the user's web browser when calling input function, the input function will not return util the user submits the form. The output "
-"function is used to output content to the browser in real time. The behavior of input and output is consistent with the console program. That's why "
-"we say PyWebIO turning the browser into a \"rich text terminal\". So you can write PyWebIO applications in script programing way."
+"As we can see from the above, the interaction of PyWebIO has two parts: input and output. The input function of PyWebIO is blocking, a form will be "
+"displayed on the user's web browser when calling input function, the input function will not return until the user submits the form. The output "
+"function is used to output content to the browser in real time. The input/output behavior of PyWebIO is consistent with the console program. That's "
+"why we say PyWebIO turning the browser into a \"rich text terminal\". So you can write PyWebIO applications in script programing way."
 msgstr ""
 "从上面可以看出,PyWebIO把交互分成了输入和输出两部分:输入函数为阻塞式调用,会在用户浏览器上显示一个表单,在用户提交表单之前输入函数将不会返回;输出"
 "函数将内容实时输出至浏览器。这种交互方式和控制台程序是一致的,因此PyWebIO应用非常适合使用控制台程序的编写逻辑来进行开发。"
 
 #: ../../guide.rst:306
 msgid ""
-"In addition, PyWebIO also supports event callbacks: PyWebIO allows you to output some buttons, and the provided callback function will be executed "
-"when the button is clicked."
-msgstr "此外,PyWebIO还支持事件回调:PyWebIO允许你输出一些控件,当控件被点击时执行提供的回调函数。"
+"In addition, PyWebIO also supports event callbacks: PyWebIO allows you to output some buttons and bind callbacks to them. The provided callback "
+"function will be executed when the button is clicked."
+msgstr "此外,PyWebIO还支持事件回调:PyWebIO允许你输出一些控件并绑定回调函数,当控件被点击时相应的回调函数便会被执行。"
 
 #: ../../guide.rst:308
 msgid "This is an example:"
@@ -621,16 +621,15 @@ msgstr ""
 
 #: ../../guide.rst:413
 msgid ""
-"When calling ``show_time()`` for the first time, a ``time`` scope will be created at the current position, and the current time will be output to "
-"it. And then every time the ``show_time()`` is called, the new content will replace the previous content."
-msgstr ""
-"第一次调用 ``show_time`` 时,将会在当前位置创建 ``time`` 输出域并在其中输出当前时间,之后每次调用 ``show_time()`` ,时间都会输出到相同的区域。"
+"When calling ``show_time()`` for the first time, a ``time`` scope will be created, and the current time will be output to it. And then every time "
+"the ``show_time()`` is called, the new content will replace the previous content."
+msgstr "第一次调用 ``show_time`` 时,将会创建 ``time`` 输出域并在其中输出当前时间,之后每次调用 ``show_time()`` ,输出域都会被新的内容覆盖。"
 
 #: ../../guide.rst:415
 msgid ""
 "Scopes can be nested. At the beginning, PyWebIO applications have only one ``ROOT`` Scope. Each time a new scope is created, the nesting level of "
 "the scope will increase by one level, and each time the current scope is exited, the nesting level of the scope will be reduced by one. PyWebIO "
-"uses the Scope stack to save the nesting level of scope at runtime."
+"uses the Scope stack to save the scope nesting level at runtime."
 msgstr ""
 "Scope是可嵌套的,初始条件下,PyWebIO应用只有一个最顶层的 ``ROOT`` Scope。每创建一个新Scope,Scope的嵌套层级便会多加一层,每退出当前Scope,Scope的嵌"
 "套层级便会减少一层。PyWebIO使用Scope栈来保存运行时的Scope的嵌套层级。"
@@ -661,7 +660,7 @@ msgid ""
 msgstr ""
 
 #: ../../guide.rst:441
-msgid "The above code will generate the following Scope layout::"
+msgid "The above code will generate the following scope layout::"
 msgstr "以上代码将会产生如下Scope布局::"
 
 #: ../../guide.rst:443
@@ -714,16 +713,15 @@ msgstr ""
 #: ../../guide.rst:481
 msgid ""
 "In addition to directly specifying the target scope name, the ``scope`` parameter can also accept an integer to determine the scope by indexing the "
-"scope stack: 0 means the top level scope(the ROOT Scope), -1 means the current Scope, -2 means the scope used before entering the current scope, ..."
+"scope stack: 0 means the top level scope(the ROOT Scope), -1 means the current scope, -2 means the scope used before entering the current scope, ..."
 msgstr ""
 "``scope`` 参数除了直接指定目标Scope名,还可以使用一个整形通过索引Scope栈来确定Scope:0表示最顶层也就是ROOT Scope,-1表示当前Scope,-2表示进入当前"
 "Scope前所使用的Scope,……"
 
 #: ../../guide.rst:483
 msgid ""
-"By default, the content output to the same scope will be arranged from top to bottom according to the calling order of the output function, and the "
-"output function called last will output the content to the bottom of the target scope. The output content can be inserted into other positions of "
-"the target scope by using the ``position`` parameter of the output function."
+"By default, the content output to the same scope will be arranged from top to bottom according to the calling order of the output function. The "
+"output content can be inserted into other positions of the target scope by using the ``position`` parameter of the output function."
 msgstr ""
 "默认条件下,在同一Scope中的输出内容,会根据输出函数的调用顺序从上往下排列,最后调用的输出函数会输出内容到目标Scope的底部。通过输出函数的 "
 "``position`` 参数可以将输出内容插入到目标Scope的其他位置。"
@@ -738,8 +736,8 @@ msgstr ""
 
 #: ../../guide.rst:487
 msgid ""
-"The ``position`` parameter of output functions is an integer. When ``position>=0``, it means to insert content before the item whose index equal "
-"``position``; when ``position<0``, it means to insert content after the item whose index equal ``position``:"
+"The ``position`` parameter of output functions accepts an integer. When ``position>=0``, it means to insert content before the item whose index "
+"equal ``position``; when ``position<0``, it means to insert content after the item whose index equal ``position``:"
 msgstr ""
 "``position`` 参数类型为整形, ``position>=0`` 时表示输出内容到目标Scope的第position号元素的前面; ``position<0`` 时表示输出内容到目标Scope第position"
 "号元素之后:"
@@ -829,12 +827,10 @@ msgstr "布局"
 
 #: ../../guide.rst:535
 msgid ""
-"In general, using the various output functions introduced above is enough to output what you want, but these outputs are arranged vertically. If "
-"you want to make a more complex layout (such as displaying a code block on the left side of the page and an image on the right), you need to use "
-"layout functions."
+"In general, using the output functions introduced above is enough to output what you want, but these outputs are arranged vertically. If you want "
+"to create a more complex layout (such as displaying a code block on the left side of the page and an image on the right), you need to use layout "
+"functions."
 msgstr ""
-"一般情况下,使用上文介绍的各种输出函数足以完成各种内容的展示,但直接调用输出函数产生的输出之间都是竖直排列的,如果想实现更复杂的布局(比如在页面左侧"
-"显示一个代码块,在右侧显示一个图像),就需要借助布局函数。"
 
 #: ../../guide.rst:537
 msgid "The ``pywebio.output`` module provides 3 layout functions, and you can create complex layouts by combining them:"
@@ -883,7 +879,7 @@ msgid "put_row([put_image(...), put_image(...)], size='40% 60%')  # The ratio of
 msgstr "put_row([put_image(…), put_image(…)], size='40% 60%')  # 左右两图宽度比2:3"
 
 #: ../../guide.rst:572
-msgid "For more information, please refer to the :ref:`layout function documentation <style_and_layout>`."
+msgid "For more information, please refer to the :ref:`layout functions documentation <style_and_layout>`."
 msgstr "更多布局函数的用法及代码示例请查阅 :ref:`布局函数文档 <style_and_layout>` ."
 
 #: ../../guide.rst:575
@@ -945,13 +941,13 @@ msgstr ""
 "在PyWebIO中,有两种方式用来运行PyWebIO应用:作为脚本运行和使用 `start_server() <pywebio.platform.tornado.start_server>` 或 `path_deploy() <pywebio."
 "platform.path_deploy>` 来作为Web服务运行。"
 
-#: ../../guide.rst:618 ../../guide.rst:689
+#: ../../guide.rst:618 ../../guide.rst:690
 msgid "**Server mode**"
 msgstr "**Server模式**"
 
 #: ../../guide.rst:620
 msgid ""
-"In Server mode, PyWebIO will start a web server to continuously provide services. When the user accesses the service address, PyWebIO will open a "
+"In server mode, PyWebIO will start a web server to continuously provide services. When the user accesses the service address, PyWebIO will open a "
 "new session and run PyWebIO application in it."
 msgstr "在Server模式下,PyWebIO会启动一个Web服务来持续性地提供服务。当用户访问服务地址时,PyWebIO会开启一个新会话并运行PyWebIO应用。"
 
@@ -959,7 +955,7 @@ msgstr "在Server模式下,PyWebIO会启动一个Web服务来持续性地提
 msgid ""
 "Use `start_server() <pywebio.platform.tornado.start_server>` to start a web server and serve given PyWebIO applications on it. `start_server() "
 "<pywebio.platform.tornado.start_server>` accepts a function as PyWebIO application. In addition, `start_server() <pywebio.platform.tornado."
-"start_server>` also accepts a list of task function or a dictionary of it, so that one PyWebIO Server can have multiple services with different "
+"start_server>` also accepts a list of task function or a dictionary of it, so  one PyWebIO Server can have multiple services with different "
 "functions. You can use `go_app() <pywebio.session.go_app>` or `put_link() <pywebio.output.put_link>` to jump between services::"
 msgstr ""
 "使用 `start_server() <pywebio.platform.tornado.start_server>` 启动一个Web Server来将PyWebIO应用作为Web服务运行, `start_server() <pywebio.platform."
@@ -983,8 +979,8 @@ msgid ""
 "    put_link('Go task 1', app='task_1')  # Use `app` parameter to specify the task name\n"
 "    put_link('Go task 2', app='task_2')\n"
 "\n"
-"start_server([index, task_1, task_2])  # or start_server({'index': index, 'task_1': task_1, 'task_2': task_2}) For more information, please refer "
-"to the function documentation."
+"# equal to `start_server({'index': index, 'task_1': task_1, 'task_2': task_2})`\n"
+"start_server([index, task_1, task_2])"
 msgstr ""
 "def task_1():\n"
 "    put_text('task_1')\n"
@@ -1000,10 +996,10 @@ msgstr ""
 "    put_link('Go task 1', app='task_1')  #  使用app参数指定任务名\n"
 "    put_link('Go task 2', app='task_2')\n"
 "\n"
-"start_server([index, task_1, task_2])  # 或 start_server({'index': index, 'task_1': task_1, 'task_2': task_2}) For more information, please refer "
-"to the function documentation."
+"# 等价于 start_server({'index': index, 'task_1': task_1, 'task_2': task_2})\n"
+"start_server([index, task_1, task_2])"
 
-#: ../../guide.rst:641
+#: ../../guide.rst:642
 msgid ""
 "Use `path_deploy() <pywebio.platform.path_deploy>` to deploy the PyWebIO applications from a directory. The python file under this directory need "
 "contain the ``main`` function to be seen as the PyWebIO application. You can access the application by using the file path as the URL."
@@ -1011,11 +1007,11 @@ msgstr ""
 "使用 `path_deploy() <pywebio.platform.path_deploy>` 可以从一个路径中部署PyWebIO应用。位于该路径下的python文件需要包含名字为 ``main`` 的PyWebIO任务函"
 "数才能被视为PyWebIO应用程序。服务端会根据用户访问的URL来确定需要加载的文件并从中读取PyWebIO应用来运行。"
 
-#: ../../guide.rst:645
+#: ../../guide.rst:646
 msgid "For example, given the following folder structure::"
 msgstr "例如,给定如下文件结构::"
 
-#: ../../guide.rst:647
+#: ../../guide.rst:648
 msgid ""
 ".\n"
 "├── A\n"
@@ -1025,17 +1021,17 @@ msgid ""
 "└── c.py"
 msgstr ""
 
-#: ../../guide.rst:654
+#: ../../guide.rst:655
 msgid ""
 "If you use this directory in `path_deploy() <pywebio.platform.path_deploy>`, you can access the PyWebIO application in ``b.py`` by using URL "
-"``http://<hist>:<port>/A/b``. And if the files have been modified after run `path_deploy() <pywebio.platform.path_deploy>`, you can use ``reload`` "
-"URL parameter to reload application in the file: ``http://<hist>:<port>/A/b?reload``"
+"``http://<host>:<port>/A/b``. And if the files have been modified after run `path_deploy() <pywebio.platform.path_deploy>`, you can use ``reload`` "
+"URL parameter to reload application in the file: ``http://<host>:<port>/A/b?reload``"
 msgstr ""
-"如果使用以上路径调用 `path_deploy() <pywebio.platform.path_deploy>` ,你可以通过 URL ``http://<hist>:<port>/A/b`` 来访问 ``b.py`` 文件中的PyWebIO应"
-"用。当文件在运行 `path_deploy() <pywebio.platform.path_deploy>` 之后被修改,可以使用 ``reload`` URL参数来重载文件: ``http://<hist>:<port>/A/b?"
+"如果使用以上路径调用 `path_deploy() <pywebio.platform.path_deploy>` ,你可以通过 URL ``http://<host>:<port>/A/b`` 来访问 ``b.py`` 文件中的PyWebIO应"
+"用。当文件在运行 `path_deploy() <pywebio.platform.path_deploy>` 之后被修改,可以使用 ``reload`` URL参数来重载文件: ``http://<host>:<port>/A/b?"
 "reload``"
 
-#: ../../guide.rst:657
+#: ../../guide.rst:658
 msgid ""
 "You can also use the command ``pywebio-path-deploy`` to start a server just like using `path_deploy() <pywebio.platform.path_deploy>`. For more "
 "information, refer ``pywebio-path-deploy --help``"
@@ -1043,22 +1039,22 @@ msgstr ""
 "你还可以使用 ``pywebio-path-deploy`` 命令来启动一个和 `path_deploy() <pywebio.platform.path_deploy>` 效果一样的server。关于命令的更多信息请查阅命令"
 "帮助: ``pywebio-path-deploy —help``"
 
-#: ../../guide.rst:659
+#: ../../guide.rst:660
 msgid ""
 "In Server mode, you can use `pywebio.platform.seo()` to set the `SEO <https://en.wikipedia.org/wiki/Search_engine_optimization>`_ information. If "
-"not ``seo()`` is not used, the `docstring <https://www.python.org/dev/peps/pep-0257/>`_ of the task function will be regarded as SEO information by "
+"``seo()`` is not used, the `docstring <https://www.python.org/dev/peps/pep-0257/>`_ of the task function will be regarded as SEO information by "
 "default."
 msgstr ""
 "在Server模式下,可以使用 `pywebio.platform.seo()` 函数来设置任务函数SEO信息(在被搜索引擎索引时提供的网页信息,包含应用标题和应用简介),如果不使用 "
-"``seo()`` 函数,默认条件下,PyWebIO会将任务函数的函数注释作为SEO信息(应用标题和简介之间使用一个空行分隔)。"
+"``seo()`` 函数,默认条件下,PyWebIO会将任务函数的函数注释作为SEO信息(应用标题和简介之间使用一个空行分隔)。 "
 
-#: ../../guide.rst:663
+#: ../../guide.rst:664
 msgid ""
 "Note that in Server mode, PyWebIO's input and output functions can only be called in the context of task functions. For example, the following code "
 "is **not allowed**::"
 msgstr "注意,在Server模式下,仅能在任务函数上下文中对PyWebIO的交互函数进行调用。比如如下调用是 **不被允许的** ::"
 
-#: ../../guide.rst:665
+#: ../../guide.rst:666
 msgid ""
 "import pywebio\n"
 "from pywebio.input import input\n"
@@ -1067,15 +1063,15 @@ msgid ""
 "pywebio.start_server(my_task_func, port=int(port))"
 msgstr ""
 
-#: ../../guide.rst:672 ../../guide.rst:685
+#: ../../guide.rst:673 ../../guide.rst:686
 msgid "**Script mode**"
 msgstr "**Script模式**"
 
-#: ../../guide.rst:674
+#: ../../guide.rst:675
 msgid "In Script mode, PyWebIO input and output functions can be called anywhere."
 msgstr "Script模式下,在任何位置都可以调用PyWebIO的交互函数。"
 
-#: ../../guide.rst:676
+#: ../../guide.rst:677
 msgid ""
 "If the user closes the browser before the end of the session, then calls to PyWebIO input and output functions in the session will cause a "
 "`SessionException <pywebio.exceptions.SessionException>` exception."
@@ -1083,15 +1079,15 @@ msgstr ""
 "如果用户在会话结束之前关闭了浏览器,那么之后会话内对于PyWebIO交互函数的调用将会引发一个 `SessionException <pywebio.exceptions.SessionException>` 异"
 "常。"
 
-#: ../../guide.rst:681
+#: ../../guide.rst:682
 msgid "Concurrent"
 msgstr "并发"
 
-#: ../../guide.rst:683
+#: ../../guide.rst:684
 msgid "PyWebIO can be used in a multi-threading environment."
 msgstr "PyWebIO 支持在多线程环境中使用。"
 
-#: ../../guide.rst:687
+#: ../../guide.rst:688
 msgid ""
 "In Script mode, you can freely start new thread and call PyWebIO interactive functions in it. When all `non-daemonic <https://docs.python.org/3/"
 "library/threading.html#thread-objects>`_ threads finish running, the script exits."
@@ -1099,7 +1095,7 @@ msgstr ""
 "在 Script模式下,你可以自由地启动线程,并在其中调用PyWebIO的交互函数。当所有非 `Daemon线程 <https://docs.python.org/3/library/threading.html#thread-"
 "objects>`_ 运行结束后,脚本退出。"
 
-#: ../../guide.rst:691
+#: ../../guide.rst:692
 msgid ""
 "In Server mode, if you need to use PyWebIO interactive functions in new thread, you need to use `register_thread(thread) <pywebio.session."
 "register_thread>` to register the new thread (so that PyWebIO can know which session the thread belongs to). If the PyWebIO interactive function is "
@@ -1114,11 +1110,11 @@ msgstr ""
 "理,其调用PyWebIO的交互函数将会产生 `SessionNotFoundException <pywebio.exceptions.SessionNotFoundException>` 异常。\n"
 "当会话的任务函数和会话内通过 `register_thread(thread) <pywebio.session.register_thread>` 注册的线程都结束运行时,会话关闭。"
 
-#: ../../guide.rst:693
+#: ../../guide.rst:694
 msgid "Example of using multi-threading in Server mode::"
 msgstr "Server模式下多线程的使用示例::"
 
-#: ../../guide.rst:695
+#: ../../guide.rst:696
 msgid ""
 "def show_time():\n"
 "    while True:\n"
@@ -1141,11 +1137,11 @@ msgid ""
 "start_server(app, port=8080, debug=True)"
 msgstr ""
 
-#: ../../guide.rst:719 ../../guide.rst:955
+#: ../../guide.rst:720 ../../guide.rst:956
 msgid "Close of session"
 msgstr "会话的结束"
 
-#: ../../guide.rst:721
+#: ../../guide.rst:722
 msgid ""
 "The close of session may also be caused by the user closing the browser page. After the browser page is closed, PyWebIO input function calls that "
 "have not yet returned in the current session will cause `SessionClosedException <pywebio.exceptions.SessionClosedException>`, and subsequent calls "
@@ -1156,7 +1152,7 @@ msgstr ""
 "SessionClosedException>` 异常,之后对于PyWebIO交互函数的调用将会产生 `SessionNotFoundException <pywebio.exceptions.SessionNotFoundException>` 或 "
 "`SessionClosedException <pywebio.exceptions.SessionClosedException>` 异常。"
 
-#: ../../guide.rst:723
+#: ../../guide.rst:724
 msgid ""
 "You can use `defer_call(func) <pywebio.session.defer_call>` to set the function to be called when the session closes. Whether it is because the "
 "user closes the page or the task finishes to cause session closed, the function set by `defer_call(func) <pywebio.session.defer_call>` will be "
@@ -1168,33 +1164,33 @@ msgstr ""
 "`defer_call(func) <pywebio.session.defer_call>` 可以用于资源清理等工作。在会话中可以多次调用 `defer_call() <pywebio.session.defer_call>` ,会话结束后"
 "将会顺序执行设置的函数。"
 
-#: ../../guide.rst:728
+#: ../../guide.rst:729
 msgid "Integration with web framework"
 msgstr "与Web框架集成"
 
-#: ../../guide.rst:730
+#: ../../guide.rst:731
 msgid ""
-"The PyWebIO application can be integrated into an existing Python Web project, and the PyWebIO application and the Web project share a web "
-"framework. PyWebIO currently supports integration with Flask, Tornado, Django and aiohttp web frameworks."
+"The PyWebIO application can be integrated into an existing Python Web project, the PyWebIO application and the Web project share a web framework. "
+"PyWebIO currently supports integration with Flask, Tornado, Django and aiohttp web frameworks."
 msgstr "可以将PyWebIO应用集成到现有的Python Web项目中,PyWebIO应用与Web项目共用一个Web框架。目前支持与Flask、Tornado、Django和aiohttp Web框架的集成。"
 
-#: ../../guide.rst:732
-msgid "The integration methods of different web frameworks are as follows:"
-msgstr "不同Web框架的集成方法如下:"
+#: ../../guide.rst:733
+msgid "The integration methods of those web frameworks are as follows:"
+msgstr "不同Web框架的集成方法如下: "
 
-#: ../../guide.rst:736
+#: ../../guide.rst:737
 msgid "Tornado"
 msgstr ""
 
-#: ../../guide.rst:740
+#: ../../guide.rst:741
 msgid "**Tornado**"
 msgstr ""
 
-#: ../../guide.rst:742
+#: ../../guide.rst:743
 msgid "Need to add a ``RequestHandler`` to Tornado application::"
 msgstr "需要在Tornado应用中引入一个 ``RequestHandler`` ::"
 
-#: ../../guide.rst:744
+#: ../../guide.rst:745
 msgid ""
 "import tornado.ioloop\n"
 "import tornado.web\n"
@@ -1214,7 +1210,7 @@ msgid ""
 "    tornado.ioloop.IOLoop.current().start()"
 msgstr ""
 
-#: ../../guide.rst:762
+#: ../../guide.rst:763
 msgid ""
 "In above code, we use `webio_handler(task_func) <pywebio.platform.tornado.webio_handler>` to get the Tornado `WebSocketHandler <https://www."
 "tornadoweb.org/en/stable/websocket.html#tornado.websocket.WebSocketHandler>`_  that communicates with the browser, and bind it to the ``/tool`` "
@@ -1224,7 +1220,7 @@ msgstr ""
 "www.tornadoweb.org/en/stable/websocket.html#tornado.websocket.WebSocketHandler>`_ ,并将其绑定在 ``/tool`` 路由下。启动Tornado服务器后,访问 "
 "``http://localhost/tool`` 即可打开PyWebIO应用。"
 
-#: ../../guide.rst:766
+#: ../../guide.rst:767
 msgid ""
 "PyWebIO uses the WebSocket protocol to communicate with the browser in Tornado. If your Tornado application is behind a reverse proxy (such as "
 "Nginx), you may need to configure the reverse proxy to support the WebSocket protocol. :ref:`Here <nginx_ws_config>` is an example of Nginx "
@@ -1233,19 +1229,19 @@ msgstr ""
 "当使用Tornado后端时,PyWebIO使用WebSocket协议和浏览器进行通讯,如果你的Tornado应用处在反向代理(比如Nginx)之后,可能需要特别配置反向代理来支持"
 "WebSocket协议,:ref:`这里 <nginx_ws_config>` 有一个Nginx配置WebSocket的例子。"
 
-#: ../../guide.rst:768
+#: ../../guide.rst:769
 msgid "Flask"
 msgstr ""
 
-#: ../../guide.rst:772
+#: ../../guide.rst:773
 msgid "**Flask**"
 msgstr ""
 
-#: ../../guide.rst:774
+#: ../../guide.rst:775
 msgid "One route need to be added to communicate with the browser through HTTP::"
 msgstr "需要添加一个PyWebIO相关的路由,用来和浏览器进行Http通讯::"
 
-#: ../../guide.rst:776
+#: ../../guide.rst:777
 msgid ""
 "from pywebio.platform.flask import webio_view\n"
 "from pywebio import STATIC_PATH\n"
@@ -1260,7 +1256,7 @@ msgid ""
 "app.run(host='localhost', port=80)"
 msgstr ""
 
-#: ../../guide.rst:789
+#: ../../guide.rst:790
 msgid ""
 "In above code, we use `webio_view(task_func) <pywebio.platform.flask.webio_view>` to get the Flask view of the PyWebIO application, and bind it to "
 "``/tool`` path. After starting the Flask application, visit ``http://localhost/tool`` to open the PyWebIO application."
@@ -1269,19 +1265,19 @@ msgstr ""
 "flask.palletsprojects.com/en/1.1.x/api/#flask.Flask.add_url_rule>`_ 将其绑定在 ``/tool`` 路径下。启动Flask应用后,访问 ``http://localhost/tool`` 即"
 "可打开PyWebIO应用。"
 
-#: ../../guide.rst:791
+#: ../../guide.rst:792
 msgid "Django"
 msgstr ""
 
-#: ../../guide.rst:795
+#: ../../guide.rst:796
 msgid "**Django**"
 msgstr ""
 
-#: ../../guide.rst:797
+#: ../../guide.rst:798
 msgid "Need to add a route in ``urls.py``::"
 msgstr "在django的路由配置文件 ``urls.py`` 中加入PyWebIO相关的路由即可::"
 
-#: ../../guide.rst:799
+#: ../../guide.rst:800
 msgid ""
 "# urls.py\n"
 "\n"
@@ -1299,7 +1295,7 @@ msgid ""
 "]"
 msgstr ""
 
-#: ../../guide.rst:815
+#: ../../guide.rst:816
 msgid ""
 "In above code, we add a routing rule to bind the view function of the PyWebIO application to the ``/tool`` path After starting the Django server, "
 "visit ``http://localhost/tool`` to open the PyWebIO application"
@@ -1307,19 +1303,19 @@ msgstr ""
 "以上代码使用添加了一条路由规则将PyWebIO应用的视图函数绑定到 ``/tool`` 路径下。\n"
 "启动Django应用后,访问 ``http://localhost/tool`` 即可打开PyWebIO应用"
 
-#: ../../guide.rst:818
+#: ../../guide.rst:819
 msgid "aiohttp"
 msgstr ""
 
-#: ../../guide.rst:822
+#: ../../guide.rst:823
 msgid "**aiohttp**"
 msgstr ""
 
-#: ../../guide.rst:824
-msgid "One route need to be added to communicate with the browser through WebSocket:::"
+#: ../../guide.rst:825
+msgid "One route need to be added to communicate with the browser through WebSocket::"
 msgstr "需要添加一个PyWebIO相关的路由,用来和浏览器进行WebSocket通讯::"
 
-#: ../../guide.rst:826
+#: ../../guide.rst:827
 msgid ""
 "from aiohttp import web\n"
 "from pywebio.platform.aiohttp import static_routes, webio_handler\n"
@@ -1331,11 +1327,11 @@ msgid ""
 "web.run_app(app, host='localhost', port=80)"
 msgstr ""
 
-#: ../../guide.rst:835
+#: ../../guide.rst:836
 msgid "After starting the aiohttp server, visit ``http://localhost/tool`` to open the PyWebIO application"
 msgstr "启动aiohttp应用后,访问 ``http://localhost/tool`` 即可打开PyWebIO应用"
 
-#: ../../guide.rst:839
+#: ../../guide.rst:840
 msgid ""
 "PyWebIO uses the WebSocket protocol to communicate with the browser in aiohttp. If your aiohttp server is behind a reverse proxy (such as Nginx), "
 "you may need to configure the reverse proxy to support the WebSocket protocol. :ref:`Here <nginx_ws_config>` is an example of Nginx WebSocket "
@@ -1344,15 +1340,15 @@ msgstr ""
 "当使用aiohttp后端时,PyWebIO使用WebSocket协议和浏览器进行通讯,如果你的aiohttp应用处在反向代理(比如Nginx)之后,\n"
 "可能需要特别配置反向代理来支持WebSocket协议,:ref:`这里 <nginx_ws_config>` 有一个Nginx配置WebSocket的例子。"
 
-#: ../../guide.rst:844
+#: ../../guide.rst:845
 msgid "Notes"
 msgstr ""
 
-#: ../../guide.rst:845
+#: ../../guide.rst:846
 msgid "**Static resources Hosting**"
 msgstr "**PyWebIO静态资源的托管**"
 
-#: ../../guide.rst:847
+#: ../../guide.rst:848
 msgid ""
 "By default, the front-end of PyWebIO gets required static resources from CDN. If you want to deploy PyWebIO applications in an offline environment, "
 "you need to host static files by yourself, and set the ``cdn`` parameter of ``webio_view()`` or ``webio_handler()`` to ``False``."
@@ -1360,7 +1356,7 @@ msgstr ""
 "PyWebIO默认使用CDN来获取前端的静态资源,如果要将PyWebIO应用部署到离线环境中,需要自行托管静态文件,\n"
 "并将 ``webio_view()`` 或 ``webio_handler()`` 的 ``cdn`` 参数设置为 ``False`` 。"
 
-#: ../../guide.rst:849
+#: ../../guide.rst:850
 msgid ""
 "When setting ``cdn=False`` , you need to host the static resources in the same directory as the PyWebIO application. In addition, you can also pass "
 "a string to ``cdn`` parameter to directly set the deployment directory of PyWebIO static resources."
@@ -1368,30 +1364,30 @@ msgstr ""
 "``cdn=False``  时需要将静态资源托管在和PyWebIO应用同级的目录下。\n"
 "同时,也可以通过 ``cdn`` 参数直接设置PyWebIO静态资源的部署目录。"
 
-#: ../../guide.rst:852
+#: ../../guide.rst:853
 msgid ""
 "The path of the static file of PyWebIO is stored in ``pywebio.STATIC_PATH``, you can use the command ``python3 -c \"import pywebio; print(pywebio."
 "STATIC_PATH)\"`` to print it out."
 msgstr ""
 "PyWebIO的静态文件的路径保存在 ``pywebio.STATIC_PATH`` 中,可使用命令 ``python3 -c \"import pywebio; print(pywebio.STATIC_PATH)\"`` 将其打印出来。"
 
-#: ../../guide.rst:854
+#: ../../guide.rst:855
 msgid ""
-"``start_server()`` also support ``cdn`` parameter, if it is set to ``False``, the static resource will be hosted in local server automatically, "
-"without manual hosting."
+"``start_server()`` and ``path_deploy()`` also support ``cdn`` parameter, if it is set to ``False``, the static resource will be hosted in local "
+"server automatically, without manual hosting."
 msgstr "使用 ``start_server()`` 启动的应用,如果将 ``cdn`` 参数设置为 ``False`` ,会自动启动一个本地的静态资源托管服务,无需手动托管。"
 
-#: ../../guide.rst:860
+#: ../../guide.rst:861
 msgid "Coroutine-based session"
 msgstr "基于协程的会话"
 
-#: ../../guide.rst:862
+#: ../../guide.rst:863
 msgid ""
 "This section will introduce the advanced features of PyWebIO --- coroutine-based session. In most cases, you don’t need it. All functions or "
 "methods in PyWebIO that are only used for coroutine sessions are specifically noted in the document."
 msgstr "关于协程内容属于高级特性,您不必使用此部分也可以实现PyWebIO支持的全部功能。PyWebIO中所有仅用于协程会话的函数或方法都在文档中有特别说明。"
 
-#: ../../guide.rst:864
+#: ../../guide.rst:865
 msgid ""
 "PyWebIO's session is based on thread by default. Each time a user opens a session connection to the server, PyWebIO will start a thread to run the "
 "task function. In addition to thread-based sessions, PyWebIO also provides coroutine-based sessions. Coroutine-based sessions accept coroutine "
@@ -1400,7 +1396,7 @@ msgstr ""
 "PyWebIO的会话实现默认是基于线程的,用户每打开一个和服务端的会话连接,PyWebIO会启动一个线程来运行任务函数。\n"
 "除了基于线程的会话,PyWebIO还提供了基于协程的会话。基于协程的会话接受协程函数作为任务函数。"
 
-#: ../../guide.rst:866
+#: ../../guide.rst:867
 msgid ""
 "The session based on the coroutine is a single-thread model, which means that all sessions run in a single thread. For IO-bound tasks, coroutines "
 "take up fewer resources than threads and have performance comparable to threads. In addition, the context switching of the coroutine is "
@@ -1409,17 +1405,17 @@ msgstr ""
 "基于协程的会话为单线程模型,所有会话都运行在一个线程内。对于IO密集型的任务,协程比线程占用更少的资源同时又拥有媲美于线程的性能。\n"
 "另外,协程的上下文切换具有可预测性,能够减少程序同步与加锁的需要,可以有效避免大多数临界区问题。"
 
-#: ../../guide.rst:869
+#: ../../guide.rst:870
 msgid "Using coroutine session"
 msgstr "使用协程会话"
 
-#: ../../guide.rst:871
+#: ../../guide.rst:872
 msgid ""
 "To use coroutine-based session, you need to use the ``async`` keyword to declare the task function as a coroutine function, and use the ``await`` "
 "syntax to call the PyWebIO input function:"
 msgstr "要使用基于协程的会话,需要使用 ``async`` 关键字将任务函数声明为协程函数,并使用 ``await`` 语法调用PyWebIO输入函数:"
 
-#: ../../guide.rst:873
+#: ../../guide.rst:874
 #, python-format
 msgid ""
 " from pywebio.input import *\n"
@@ -1433,7 +1429,7 @@ msgid ""
 " start_server(say_hello, auto_open_webbrowser=True)"
 msgstr ""
 
-#: ../../guide.rst:887
+#: ../../guide.rst:888
 msgid ""
 "In the coroutine task function, you can also use ``await`` to call other coroutines or ( `awaitable objects <https://docs.python.org/3/library/"
 "asyncio-task.html#asyncio-awaitables>`_ ) in the standard library `asyncio <https://docs.python.org/3/library/asyncio.html>`_:"
@@ -1441,7 +1437,7 @@ msgstr ""
 "在协程任务函数中,也可以使用 ``await`` 调用其他协程或标准库 `asyncio <https://docs.python.org/3/library/asyncio.html>`_ 中的可等待对象( `awaitable "
 "objects <https://docs.python.org/3/library/asyncio-task.html#asyncio-awaitables>`_ ):"
 
-#: ../../guide.rst:889
+#: ../../guide.rst:890
 msgid ""
 " import asyncio\n"
 " from pywebio import start_server\n"
@@ -1458,7 +1454,7 @@ msgid ""
 " start_server(main, auto_open_webbrowser=True)"
 msgstr ""
 
-#: ../../guide.rst:908
+#: ../../guide.rst:909
 msgid ""
 "In coroutine-based session, all input functions defined in the :doc:`pywebio.input </input>` module need to use ``await`` syntax to get the return "
 "value. Forgetting to use ``await`` will be a common error when using coroutine-based session."
@@ -1466,47 +1462,47 @@ msgstr ""
 "在基于协程的会话中, :doc:`pywebio.input </input>` 模块中的定义输入函数都需要使用 ``await`` 语法来获取返回值,忘记使用 ``await`` 将会是在使用基于协"
 "程的会话时常出现的错误。"
 
-#: ../../guide.rst:910
+#: ../../guide.rst:911
 msgid "Other functions that need to use ``await`` syntax in the coroutine session are:"
 msgstr "其他在协程会话中也需要使用 ``await`` 语法来进行调用函数有:"
 
-#: ../../guide.rst:912
+#: ../../guide.rst:913
 msgid "`pywebio.session.run_asyncio_coroutine(coro_obj) <pywebio.session.run_asyncio_coroutine>`"
 msgstr ""
 
-#: ../../guide.rst:913
+#: ../../guide.rst:914
 msgid "`pywebio.session.eval_js(expression) <pywebio.session.eval_js>`"
 msgstr ""
 
-#: ../../guide.rst:914
+#: ../../guide.rst:915
 msgid "`pywebio.session.hold() <pywebio.session.hold>`"
 msgstr ""
 
-#: ../../guide.rst:918
+#: ../../guide.rst:919
 msgid ""
 "Although the PyWebIO coroutine session is compatible with the ``awaitable objects`` in the standard library ``asyncio``, the ``asyncio`` library is "
 "not compatible with the ``awaitable objects`` in the PyWebIO coroutine session."
 msgstr "虽然PyWebIO的协程会话兼容标准库 ``asyncio`` 中的 ``awaitable objects`` ,但 ``asyncio`` 库不兼容PyWebIO协程会话中的 ``awaitable objects`` ."
 
-#: ../../guide.rst:920
+#: ../../guide.rst:921
 msgid ""
-"That is to say, you can't pass PyWebIO ``awaitable objects`` to the `asyncio`` functions that accept ``awaitable objects``. For example, the "
+"That is to say, you can't pass PyWebIO ``awaitable objects`` to the ``asyncio`` functions that accept ``awaitable objects``. For example, the "
 "following calls are **not supported** ::"
 msgstr ""
 "也就是说,无法将PyWebIO中的 ``awaitable objects`` 传入 ``asyncio`` 中的接受 ``awaitable objects`` 作为参数的函数中,比如如下调用是 **不被支持的** ::"
 
-#: ../../guide.rst:922
+#: ../../guide.rst:923
 msgid ""
 "await asyncio.shield(pywebio.input())\n"
 "await asyncio.gather(asyncio.sleep(1), pywebio.session.eval_js('1+1'))\n"
 "task = asyncio.create_task(pywebio.input())"
 msgstr ""
 
-#: ../../guide.rst:929
+#: ../../guide.rst:930
 msgid "Concurrency in coroutine-based sessions"
 msgstr "协程会话的并发"
 
-#: ../../guide.rst:931
+#: ../../guide.rst:932
 msgid ""
 "In coroutine-based session, you can start new thread, but you cannot call PyWebIO interactive functions in it (`register_thread() <pywebio.session."
 "register_thread>` is not available in coroutine session). But you can use `run_async(coro) <pywebio.session.run_async>` to execute a coroutine "
@@ -1516,7 +1512,7 @@ msgstr ""
 "用)。\n"
 "但你可以使用 `run_async(coro) <pywebio.session.run_async>` 来异步执行一个协程对象,新协程内可以使用PyWebIO交互函数:"
 
-#: ../../guide.rst:933
+#: ../../guide.rst:934
 msgid ""
 " from pywebio import start_server\n"
 " from pywebio.session import run_async\n"
@@ -1534,7 +1530,7 @@ msgid ""
 " start_server(main, auto_open_webbrowser=True)"
 msgstr ""
 
-#: ../../guide.rst:952
+#: ../../guide.rst:953
 msgid ""
 "`run_async(coro) <pywebio.session.run_async>` returns a `TaskHandler <pywebio.session.coroutinebased.TaskHandler>`, which can be used to query the "
 "running status of the coroutine or close the coroutine."
@@ -1542,13 +1538,13 @@ msgstr ""
 "`run_async(coro) <pywebio.session.run_async>` 返回一个 `TaskHandler <pywebio.session.coroutinebased.TaskHandler>` ,通过该 `TaskHandler <pywebio."
 "session.coroutinebased.TaskHandler>` 可以查询协程运行状态和关闭协程。"
 
-#: ../../guide.rst:957
+#: ../../guide.rst:958
 msgid ""
 "Similar to thread-based session, in coroutine-based session, when the task function and the coroutine running through `run_async() <pywebio.session."
 "run_async>` in the session are all finished, the session is closed."
 msgstr "与基于线程的会话类似,在基于协程的会话中,当任务函数和在会话内通过 `run_async() <pywebio.session.run_async>` 运行的协程全部结束后,会话关闭。"
 
-#: ../../guide.rst:959
+#: ../../guide.rst:960
 msgid ""
 "If the close of the session is caused by the user closing the browser, the behavior of PyWebIO is the same as :ref:`Thread-based session "
 "<session_close>`: After the browser page closed, PyWebIO input function calls that have not yet returned in the current session will cause "
@@ -1560,23 +1556,23 @@ msgstr ""
 "的调用将会产生 `SessionNotFoundException <pywebio.exceptions.SessionNotFoundException>` 或 `SessionClosedException <pywebio.exceptions."
 "SessionClosedException>` 异常。"
 
-#: ../../guide.rst:961
+#: ../../guide.rst:962
 msgid "`defer_call(func) <pywebio.session.defer_call>` also available in coroutine session."
 msgstr "协程会话也同样支持使用 `defer_call(func) <pywebio.session.defer_call>` 来设置会话结束时需要调用的函数。"
 
-#: ../../guide.rst:966
+#: ../../guide.rst:967
 msgid "Integration with Web Framework"
 msgstr "协程会话与Web框架集成"
 
-#: ../../guide.rst:968
+#: ../../guide.rst:969
 msgid "The PyWebIO application that using coroutine-based session can also be integrated to the web framework."
 msgstr "基于协程的会话同样可以与Web框架进行集成,只需要在原来传入任务函数的地方改为传入协程函数即可。"
 
-#: ../../guide.rst:970
+#: ../../guide.rst:971
 msgid "However, there are some limitations when using coroutine-based sessions to integrate into Flask or Django:"
 msgstr "但当前在使用基于协程的会话集成进Flask或Django时,存在一些限制:"
 
-#: ../../guide.rst:972
+#: ../../guide.rst:973
 msgid ""
 "First, when ``await`` the coroutine objects/awaitable objects in the ``asyncio`` module, you need to use `run_asyncio_coroutine() <pywebio.session."
 "run_asyncio_coroutine>` to wrap the coroutine object."
@@ -1584,15 +1580,15 @@ msgstr ""
 "一是协程函数内还无法直接通过 ``await`` 直接等待asyncio库中的协程对象,目前需要使用 `run_asyncio_coroutine() <pywebio.session."
 "run_asyncio_coroutine>` 进行包装。"
 
-#: ../../guide.rst:974
+#: ../../guide.rst:975
 msgid "Secondly, you need to start a new thread to run the event loop before starting a Flask/Django server."
 msgstr "二是,在启动Flask/Django这类基于线程的服务器之前需要启动一个单独的线程来运行事件循环。"
 
-#: ../../guide.rst:976
+#: ../../guide.rst:977
 msgid "Example of coroutine-based session integration into Flask:"
 msgstr "使用基于协程的会话集成进Flask的示例:"
 
-#: ../../guide.rst:978
+#: ../../guide.rst:979
 msgid ""
 " import asyncio\n"
 " import threading\n"
@@ -1617,21 +1613,21 @@ msgid ""
 " app.run(host='localhost', port=80)"
 msgstr ""
 
-#: ../../guide.rst:1003
+#: ../../guide.rst:1004
 msgid ""
-"Finally, coroutine-based session is not available in the Script mode. You always need to use ``start_server()`` to run coroutine task function or "
+"Finally, coroutine-based session is not available in the script mode. You always need to use ``start_server()`` to run coroutine task function or "
 "integrate it to a web framework."
 msgstr "最后,使用PyWebIO编写的协程函数不支持Script模式,总是需要使用 ``start_server`` 来启动一个服务或者集成进Web框架来调用。"
 
-#: ../../guide.rst:1006
+#: ../../guide.rst:1007
 msgid "Last but not least"
 msgstr ""
 
-#: ../../guide.rst:1008
+#: ../../guide.rst:1009
 msgid "This is all features of PyWebIO, you can continue to read the rest of the documents, or start writing your PyWebIO applications now."
 msgstr "以上就是PyWebIO的全部功能了,你可以继续阅读接下来的文档,或者立即开始PyWebIO应用的编写了。"
 
-#: ../../guide.rst:1010
+#: ../../guide.rst:1011
 msgid ""
 "Finally, please allow me to provide one more suggestion. When you encounter a design problem when using PyWebIO, you can ask yourself a question: "
 "What would I do if it is in a terminal program? If you already have the answer, it can be done in the same way with PyWebIO. If the problem "
@@ -1641,7 +1637,7 @@ msgstr ""
 "如果你已经有答案了,那么在PyWebIO中一样可以使用这样的方式完成。如果问题依然存在或者觉得解决方案不够好,\n"
 "你可以考虑使用 `put_buttons() <pywebio.output.put_buttons>` 提供的回调机制。"
 
-#: ../../guide.rst:1013
+#: ../../guide.rst:1014
 msgid "OK, Have fun with PyWebIO!"
 msgstr ""
 
@@ -1660,3 +1656,11 @@ msgstr ""
 #~ "其他接受 ``put_xxx()`` 调用作为参数的输出函数还有 `put_collapse() <pywebio.output.put_collapse>` 、 `put_scrollable() <pywebio.output."
 #~ "put_scrollable>` 、`put_row() <pywebio.output.put_row>` 等,此外,还可以通过 `put_widget() <pywebio.output.put_widget>` 自定义可接收 "
 #~ "``put_xxx()`` 调用的输出组件,具体用法请参考函数文档。"
+
+#~ msgid ""
+#~ "In general, using the various output functions introduced above is enough to output what you want, but these outputs are arranged vertically. If "
+#~ "you want to make a more complex layout (such as displaying a code block on the left side of the page and an image on the right), you need to use "
+#~ "layout functions."
+#~ msgstr ""
+#~ "一般情况下,使用上文介绍的各种输出函数足以完成各种内容的展示,但直接调用输出函数产生的输出之间都是竖直排列的,如果想实现更复杂的布局(比如在页面"
+#~ "左侧显示一个代码块,在右侧显示一个图像),就需要借助布局函数。"

+ 29 - 28
docs/locales/zh_CN/LC_MESSAGES/input.po

@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PyWebIO 1.1.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-03-18 19:30+0800\n"
-"PO-Revision-Date: 2021-03-19 22:07+0800\n"
+"POT-Creation-Date: 2021-03-23 20:40+0800\n"
+"PO-Revision-Date: 2021-03-23 20:40+0800\n"
 "Last-Translator: WangWeimin <wang0.618@qq.com>\n"
 "Language: zh_CN\n"
 "Language-Team: \n"
@@ -24,7 +24,7 @@ msgid "``pywebio.input`` --- Get input from web browser"
 msgstr "``pywebio.input`` — 输入模块"
 
 #: of pywebio.input:1
-msgid "This module provides many functions to get all kinds of input of user from the browser"
+msgid "This module provides functions to get all kinds of input of user from the browser"
 msgstr "本模块提供了一系列函数来从浏览器接收用户不同的形式的输入"
 
 #: of pywebio.input:3
@@ -72,9 +72,9 @@ msgstr ""
 
 #: of pywebio.input:22
 msgid ""
-"By default, the user can submit an input of empty value. If the user must provide a non-empty "
-"input value, you need to pass ``required=True`` to the input function (some input functions "
-"do not support the ``required`` parameter)"
+"By default, the user can submit empty input value. If the user must provide a non-empty input "
+"value, you need to pass ``required=True`` to the input function (some input functions do not "
+"support the ``required`` parameter)"
 msgstr ""
 "输入默认可以为空,如果需要用户必须提供值,则需要在输入函数中传入 ``required=True`` (部分输入函"
 "数不支持 ``required`` 参数)"
@@ -193,9 +193,9 @@ msgstr ""
 
 #: of pywebio.input.input:7
 msgid ""
-"Input value validation function. If provided, the validation function will be called when the "
-"user completes input or submits the form.  ``validate`` receives the input value as a "
-"parameter. When the input value is valid, it returns ``None``. When the input value is "
+"Input value validation function. If provided, the validation function will be called when "
+"user completes the input field or submits the form.  ``validate`` receives the input value as "
+"a parameter. When the input value is valid, it returns ``None``. When the input value is "
 "invalid, it returns an error message string. For example:  .. exportable-codeblock::     :"
 "name: input-valid-func     :summary: `input()` validation      def check_age(age):         if "
 "age>30:             return 'Too old'         elif age<10:             return 'Too young'     "
@@ -204,9 +204,9 @@ msgstr ""
 
 #: of pywebio.input.input:7
 msgid ""
-"Input value validation function. If provided, the validation function will be called when the "
-"user completes input or submits the form."
-msgstr "输入值校验函数. 如果提供,当用户输入完毕或提交表单后校验函数将被调用."
+"Input value validation function. If provided, the validation function will be called when "
+"user completes the input field or submits the form."
+msgstr "输入值校验函数。 如果提供,当用户输入完毕或提交表单后校验函数将被调用。"
 
 #: of pywebio.input.input:9
 msgid ""
@@ -242,7 +242,7 @@ msgstr "输入框的初始值"
 
 #: of pywebio.input.input:25
 msgid ""
-"Put a button on the right side of the input field, and you can click the button to set the "
+"Put a button on the right side of the input field, and user can click the button to set the "
 "value for the input.  ``label`` is the label of the button, and ``callback`` is the callback "
 "function to set the input value when clicked.  The callback is invoked with one argument, the "
 "``set_value``. ``set_value`` is a callable object, which is invoked with one or two "
@@ -271,9 +271,9 @@ msgstr ""
 
 #: of pywebio.input.input:25
 msgid ""
-"Put a button on the right side of the input field, and you can click the button to set the "
+"Put a button on the right side of the input field, and user can click the button to set the "
 "value for the input."
-msgstr "在输入框右侧显示一个按钮,可通过点击按钮为输入框设置值。"
+msgstr "在输入框右侧显示一个按钮,用户可通过点击按钮为输入框设置值。"
 
 #: of pywebio.input.input:27
 msgid ""
@@ -370,8 +370,8 @@ msgid ""
 msgstr "输入框的提示内容。提示内容会在输入框未输入值时以浅色字体显示在输入框中"
 
 #: of pywebio.input.input:67
-msgid "Whether a value is required for the input to be submittable"
-msgstr "当前输入是否为必填项"
+msgid "Whether a value is required for the input to be submittable, default is ``False``"
+msgstr "当前输入是否为必填项,默认为 ``False``"
 
 #: of pywebio.input.input:68
 msgid "Whether the value is readonly(not editable)"
@@ -387,7 +387,7 @@ msgstr ""
 
 #: of pywebio.input.input:70
 msgid ""
-"Help text for the input. The text will be displayed below the input field in a small font"
+"Help text for the input. The text will be displayed below the input field with small font"
 msgstr "输入框的帮助文本。帮助文本会以小号字体显示在输入框下方"
 
 #: of pywebio.input.input:71
@@ -571,7 +571,7 @@ msgid ""
 msgstr "可选项列表。格式与同 `select()` 函数的 ``options`` 参数"
 
 #: of pywebio.input.checkbox:4 pywebio.input.radio:4
-msgid "Whether to display the options on one line. Default is False"
+msgid "Whether to display the options on one line. Default is ``False``"
 msgstr "是否将选项显示在一行上。默认每个选项单独占一行"
 
 #: of pywebio.input.checkbox:5
@@ -723,8 +723,8 @@ msgstr "实现简单的选择操作:"
 #: of pywebio.input.actions:40
 #, python-format
 msgid ""
-"confirm = actions('Confirm to delete file?', ['confirm', 'cancel'], help_text='Unrecoverable "
-"after file deletion')\n"
+"confirm = actions('Confirm to delete file?', ['confirm', 'cancel'],\n"
+"                      help_text='Unrecoverable after file deletion')\n"
 "if confirm=='confirm':  # ..doc-only\n"
 "    ...  # ..doc-only\n"
 "put_markdown('You clicked the `%s` button' % confirm)  # ..demo-only"
@@ -734,17 +734,17 @@ msgstr ""
 "    …  # ..doc-only\n"
 "put_markdown('点击了`%s`按钮' % confirm)  # ..demo-only"
 
-#: of pywebio.input.actions:49
+#: of pywebio.input.actions:50
 msgid ""
 "Compared with other input items, when using `actions()`, the user only needs to click once to "
 "complete the submission."
 msgstr "相比于其他输入项,使用 `actions()` 用户只需要点击一次就可完成提交。"
 
-#: of pywebio.input.actions:51
+#: of pywebio.input.actions:52
 msgid "Replace the default submit button:"
 msgstr "替换默认的提交按钮:"
 
-#: of pywebio.input.actions:53
+#: of pywebio.input.actions:54
 msgid ""
 "import json  # ..demo-only\n"
 "             # ..demo-only\n"
@@ -845,7 +845,7 @@ msgstr ""
 "大小。 格式同 ``max_size`` 参数"
 
 #: of pywebio.input.file_upload:19
-msgid "Indicates whether the user must specify a file for the input. Default is `False`."
+msgid "Indicates whether the user must specify a file for the input. Default is ``False``."
 msgstr "是否必须要上传文件。默认为 `False`"
 
 #: of pywebio.input.file_upload:21
@@ -960,16 +960,17 @@ msgstr ""
 
 #: of pywebio.input.input_group:28
 msgid ""
-"Whether the form can be cancelled. Default is False. If ``cancelable=True``, a \"Cancel\" "
+"Whether the form can be cancelled. Default is ``False``. If ``cancelable=True``, a \"Cancel\" "
 "button will be displayed at the bottom of the form.  Note: If the last input item in the "
 "group is `actions()`, ``cancelable`` will be ignored."
 msgstr ""
 
 #: of pywebio.input.input_group:28
 msgid ""
-"Whether the form can be cancelled. Default is False. If ``cancelable=True``, a \"Cancel\" "
+"Whether the form can be cancelled. Default is ``False``. If ``cancelable=True``, a \"Cancel\" "
 "button will be displayed at the bottom of the form."
-msgstr "表单是否可以取消。若 ``cancelable=True`` 则会在表单底部显示一个“取消”按钮。"
+msgstr ""
+"表单是否可以取消。若 ``cancelable=True`` 则会在表单底部显示一个“取消”按钮,默认为 ``False`` 。"
 
 #: of pywebio.input.input_group:30
 msgid ""

Разлика између датотеке није приказан због своје велике величине
+ 237 - 255
docs/locales/zh_CN/LC_MESSAGES/output.po


+ 138 - 150
docs/locales/zh_CN/LC_MESSAGES/session.po

@@ -7,16 +7,17 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PyWebIO 1.1.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-03-19 22:41+0800\n"
-"PO-Revision-Date: 2021-02-24 09:37+0800\n"
+"POT-Creation-Date: 2021-03-23 20:38+0800\n"
+"PO-Revision-Date: 2021-03-23 20:38+0800\n"
 "Last-Translator: WangWeimin <wang0.618@qq.com>\n"
 "Language: zh_CN\n"
 "Language-Team: \n"
-"Plural-Forms: nplurals=1; plural=0\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Babel 2.8.0\n"
+"X-Generator: Poedit 2.4.2\n"
 
 #: ../../session.rst:2
 msgid "``pywebio.session`` --- More control to session"
@@ -24,15 +25,16 @@ msgstr "``pywebio.session`` — 会话相关"
 
 #: of pywebio.session.run_async:1
 msgid ""
-"Run the coroutine object asynchronously. PyWebIO interactive functions are "
-"also available in the coroutine."
+"Run the coroutine object asynchronously. PyWebIO interactive functions are also "
+"available in the coroutine."
 msgstr "异步运行协程对象。协程中依然可以调用 PyWebIO 交互函数。 "
 
 #: of pywebio.session.run_async:3
 msgid ""
 "``run_async()`` can only be used in :ref:`coroutine-based session "
 "<coroutine_based_session>`."
-msgstr "``run_async()`` 仅能在 :ref:`基于协程 <coroutine_based_session>` 的会话上下文中调用"
+msgstr ""
+"``run_async()`` 仅能在 :ref:`基于协程 <coroutine_based_session>` 的会话上下文中调用"
 
 #: of pywebio.session.download pywebio.session.eval_js pywebio.session.go_app
 #: pywebio.session.register_thread pywebio.session.run_async
@@ -50,12 +52,11 @@ msgstr ""
 
 #: of pywebio.session.run_async:6
 msgid ""
-"`TaskHandle <pywebio.session.coroutinebased.TaskHandle>` instance, which can"
-" be used to query the running status of the coroutine or close the "
-"coroutine."
+"`TaskHandle <pywebio.session.coroutinebased.TaskHandle>` instance, which can be "
+"used to query the running status of the coroutine or close the coroutine."
 msgstr ""
-"`TaskHandle <pywebio.session.coroutinebased.TaskHandle>` 实例。 通过 TaskHandle "
-"以查询协程运行状态和关闭协程。"
+"`TaskHandle <pywebio.session.coroutinebased.TaskHandle>` 实例。 通过 TaskHandle "
+"以查询协程运行状态和关闭协程。"
 
 #: of pywebio.session.run_async:8
 msgid ""
@@ -65,10 +66,12 @@ msgstr "参见::ref:`协程会话的并发 <coroutine_based_concurrency>`"
 
 #: of pywebio.session.run_asyncio_coroutine:1
 msgid ""
-"If the thread running sessions are not the same as the thread running the "
-"asyncio event loop, you need to wrap ``run_asyncio_coroutine()`` to run the "
-"coroutine in asyncio."
-msgstr "若会话线程和运行asyncio事件循环的线程不是同一个线程,需要用 `run_asyncio_coroutine()` 来运行asyncio中的协程。"
+"If the thread running sessions are not the same as the thread running the asyncio "
+"event loop, you need to wrap ``run_asyncio_coroutine()`` to run the coroutine in "
+"asyncio."
+msgstr ""
+"若会话线程和运行asyncio事件循环的线程不是同一个线程,需要用 "
+"`run_asyncio_coroutine()` 来运行asyncio中的协程。"
 
 #: of pywebio.session.run_asyncio_coroutine:3
 msgid "Can only be used in :ref:`coroutine-based session <coroutine_based_session>`."
@@ -111,8 +114,8 @@ msgstr ""
 
 #: of pywebio.session.download:8
 msgid ""
-"put_buttons(['Click to download'], [lambda: download('hello-world.txt', "
-"b'hello world!')])"
+"put_buttons(['Click to download'],\n"
+"            [lambda: download('hello-world.txt', b'hello world!')])"
 msgstr ""
 
 #: of pywebio.session.run_js:1
@@ -137,14 +140,13 @@ msgstr ""
 
 #: of pywebio.session.eval_js:1
 msgid ""
-"Execute JavaScript expression in the user's browser and get the value of the"
-" expression"
+"Execute JavaScript expression in the user's browser and get the value of the "
+"expression"
 msgstr "在用户浏览器中执行JavaScript表达式,并获取表达式的值"
 
 #: of pywebio.session.eval_js:3
 msgid ""
-"JavaScript expression. The value of the expression need to be JSON-"
-"serializable."
+"JavaScript expression. The value of the expression need to be JSON-serializable."
 msgstr "js表达式. 表达式的值需要能JSON序列化"
 
 #: of pywebio.session.eval_js:5
@@ -153,12 +155,11 @@ msgstr "js表达式的值"
 
 #: of pywebio.session.eval_js:7
 msgid ""
-"Note: When using :ref:`coroutine-based session <coroutine_based_session>`, "
-"you need to use the ``await eval_js(expression)`` syntax to call the "
-"function."
+"Note: When using :ref:`coroutine-based session <coroutine_based_session>`, you "
+"need to use the ``await eval_js(expression)`` syntax to call the function."
 msgstr ""
-"注意⚠️:在 :ref:`基于协程 <coroutine_based_session>` 的会话上下文中,需要使用 ``await "
-"eval_js(expression)`` 语法来进行调用。"
+"注意⚠️:在 :ref:`基于协程 <coroutine_based_session>` 的会话上下文中,需要使用 "
+"``await eval_js(expression)`` 语法来进行调用。"
 
 #: of pywebio.session.eval_js:11
 msgid ""
@@ -176,8 +177,8 @@ msgstr ""
 
 #: of pywebio.session.register_thread:1
 msgid ""
-"Register the thread so that PyWebIO interactive functions are available in "
-"the thread."
+"Register the thread so that PyWebIO interactive functions are available in the "
+"thread."
 msgstr "注册线程,以便在线程内调用 PyWebIO 交互函数。"
 
 #: of pywebio.session.register_thread:3
@@ -198,15 +199,15 @@ msgstr "设置会话结束时调用的函数。"
 
 #: of pywebio.session.defer_call:3
 msgid ""
-"Whether it is because the user closes the page or the task finishes to cause"
-" session closed, the function set by ``defer_call(func)`` will be executed. "
-"Can be used for resource cleaning."
+"Whether it is because the user closes the page or the task finishes to cause "
+"session closed, the function set by ``defer_call(func)`` will be executed. Can be "
+"used for resource cleaning."
 msgstr "无论是用户主动关闭会话还是任务结束会话关闭,设置的函数都会被运行。"
 
 #: of pywebio.session.defer_call:5
 msgid ""
-"You can call ``defer_call(func)`` multiple times in the session, and the set"
-" functions will be executed sequentially after the session closes."
+"You can call ``defer_call(func)`` multiple times in the session, and the set "
+"functions will be executed sequentially after the session closes."
 msgstr "在会话中可以多次调用 `defer_call()` ,会话结束后将会顺序执行设置的函数。"
 
 #: of pywebio.session.defer_call:7
@@ -221,8 +222,10 @@ msgid ""
 msgstr ""
 
 #: of pywebio.session.defer_call:13
-msgid "PyWebIO interactive functions cannot be called inside the function ``func``."
-msgstr "通过 `defer_call()` 设置的函数被调用时会话已经关闭,所以在函数体内不可以调用 PyWebIO 的交互函数"
+msgid "PyWebIO interactive functions cannot be called inside the deferred functions."
+msgstr ""
+"通过 `defer_call()` 设置的函数被调用时会话已经关闭,所以在函数体内不可以调用 "
+"PyWebIO 的交互函数"
 
 #: of pywebio.session.hold:1
 msgid "Keep the session alive until the browser page is closed by user."
@@ -230,25 +233,26 @@ msgstr "保持会话,直到用户关闭浏览器。"
 
 #: of pywebio.session.hold:5
 msgid ""
-"After the PyWebIO session closed, the functions that need communicate with "
-"the PyWebIO server (such as the event callback of `put_buttons()` and "
-"download link of `put_file()`) will not work. You can call the ``hold()`` "
-"function at the end of the task function to hold the session, so that the "
-"event callback and download link will always be available before the browser"
-" page is closed by user."
+"After the PyWebIO session closed, the functions that need communicate with the "
+"PyWebIO server (such as the event callback of `put_buttons()` and download link of "
+"`put_file()`) will not work. You can call the ``hold()`` function at the end of "
+"the task function to hold the session, so that the event callback and download "
+"link will always be available before the browser page is closed by user."
 msgstr ""
 "在PyWebIO会话结束后,页面和服务端的连接便会断开,\n"
-"页面上需要和服务端通信才可实现的功能(比如:下载通过 `put_file() <pywebio.output.put_file>` 输出的文件,\n"
+"页面上需要和服务端通信才可实现的功能(比如:下载通过 `put_file() <pywebio.output."
+"put_file>` 输出的文件,\n"
 "`put_buttons() <pywebio.output.put_buttons>` 按钮回调)便无法使用。\n"
-"可以在任务函数末尾处调用 ``hold()`` 函数来将会话保持,这样在用户关闭浏览器页面前,会话将一直保持连接。"
+"可以在任务函数末尾处调用 ``hold()`` 函数来将会话保持,这样在用户关闭浏览器页面前,"
+"会话将一直保持连接。"
 
 #: of pywebio.session.hold:7
 msgid ""
-"Note: When using :ref:`coroutine-based session <coroutine_based_session>`, "
-"you need to use the ``await hold()`` syntax to call the function."
+"Note: When using :ref:`coroutine-based session <coroutine_based_session>`, you "
+"need to use the ``await hold()`` syntax to call the function."
 msgstr ""
-"注意⚠️:在 :ref:`基于协程 <coroutine_based_session>` 的会话上下文中,需要使用 ``await hold()`` "
-"语法来进行调用。"
+"注意⚠️:在 :ref:`基于协程 <coroutine_based_session>` 的会话上下文中,需要使用 "
+"``await hold()`` 语法来进行调用。"
 
 #: of pywebio.session:12
 msgid "The session-local object for current session."
@@ -256,15 +260,15 @@ msgstr "当前会话的数据对象(session-local object)。"
 
 #: of pywebio.session:14
 msgid ""
-"``local`` is a dictionary that can be accessed through attributes. When "
-"accessing a property that does not exist in the data object, it returns "
-"``None`` instead of throwing an exception. The method of dictionary is not "
-"supported in ``local``. It supports the ``in`` operator to determine whether"
-" the key exists. You can use ``local._dict`` to get the underlying "
-"dictionary data."
+"``local`` is a dictionary that can be accessed through attributes. When accessing "
+"a property that does not exist in the data object, it returns ``None`` instead of "
+"throwing an exception. The method of dictionary is not supported in ``local``. It "
+"supports the ``in`` operator to determine whether the key exists. You can use "
+"``local._dict`` to get the underlying dictionary data."
 msgstr ""
-"``local`` 是一个可以通过属性访问的字典,访问不存在的属性时会返回 ``None`` 而不是抛出异常。``local`` "
-"不支持字典的方法,支持使用 ``in`` 操作符来判断键是否存在,可以使用 ``local._dict`` 获取底层的字典表示。"
+"``local`` 是一个可以通过属性访问的字典,访问不存在的属性时会返回 ``None`` 而不是抛"
+"出异常。``local`` 不支持字典的方法,支持使用 ``in`` 操作符来判断键是否存在,可以使"
+"用 ``local._dict`` 获取底层的字典表示。"
 
 #: of pywebio.session
 msgid "Usage Scenes"
@@ -272,10 +276,12 @@ msgstr "使用场景"
 
 #: of pywebio.session:20
 msgid ""
-"When you need to share some session-independent data with multiple "
-"functions, it is more convenient to use session-local objects to save state "
-"than to use function parameters."
-msgstr "当需要在多个函数中保存一些会话独立的数据时,使用session-local对象保存状态会比通过函数参数传递更方便。"
+"When you need to share some session-independent data with multiple functions, it "
+"is more convenient to use session-local objects to save state than to use function "
+"parameters."
+msgstr ""
+"当需要在多个函数中保存一些会话独立的数据时,使用session-local对象保存状态会比通过函"
+"数参数传递更方便。"
 
 #: of pywebio.session:22
 msgid "Here is a example of a session independent counter implementation::"
@@ -310,8 +316,8 @@ msgid ""
 "\n"
 "def main():\n"
 "    cnt = [0]  # Trick: to pass by reference\n"
-"    put_buttons(['Add counter', 'Show counter'], [partial(add, cnt), "
-"partial(show, cnt)])\n"
+"    put_buttons(['Add counter', 'Show counter'], [partial(add, cnt), partial(show, "
+"cnt)])\n"
 "    hold()"
 msgstr ""
 
@@ -369,27 +375,27 @@ msgstr "``title`` (str): 当前页面的标题"
 
 #: of pywebio.session.set_env:6
 msgid ""
-"``output_animation`` (bool): Whether to enable output animation, enabled by "
-"default"
-msgstr "``output_animation`` (bool): 是否启用输出动画(在输出内容时,使用过渡动画),默认启用"
+"``output_animation`` (bool): Whether to enable output animation, enabled by default"
+msgstr ""
+"``output_animation`` (bool): 是否启用输出动画(在输出内容时,使用过渡动画),默认启"
+"用"
 
 #: of pywebio.session.set_env:7
 msgid ""
-"``auto_scroll_bottom`` (bool): Whether to automatically scroll the page to "
-"the bottom after output content, it is closed by default.  Note that after "
-"enabled, only outputting to ROOT scope can trigger automatic scrolling."
+"``auto_scroll_bottom`` (bool): Whether to automatically scroll the page to the "
+"bottom after output content, it is closed by default.  Note that after enabled, "
+"only outputting to ROOT scope can trigger automatic scrolling."
 msgstr ""
-"``auto_scroll_bottom`` (bool): 是否在内容输出时将页面自动滚动到底部,默认关闭。注意,开启后,只有输出到ROOT "
-"Scope才可以触发自动滚动。"
+"``auto_scroll_bottom`` (bool): 是否在内容输出时将页面自动滚动到底部,默认关闭。注"
+"意,开启后,只有输出到ROOT Scope才可以触发自动滚动。"
 
 #: of pywebio.session.set_env:8
 msgid ""
 "``http_pull_interval`` (int): The period of HTTP polling messages (in "
-"milliseconds, default 1000ms), only available in sessions based on HTTP "
-"connection."
+"milliseconds, default 1000ms), only available in sessions based on HTTP connection."
 msgstr ""
-"``http_pull_interval`` (int): "
-"HTTP轮询后端消息的周期(单位为毫秒,默认1000ms),仅在基于HTTP连接的会话(使用Flask或Django后端)中可用"
+"``http_pull_interval`` (int): HTTP轮询后端消息的周期(单位为毫秒,默认1000ms),仅"
+"在基于HTTP连接的会话(使用Flask或Django后端)中可用"
 
 #: of pywebio.session.set_env:12
 msgid "set_env(title='Awesome PyWebIO!!', output_animation=False)"
@@ -397,8 +403,8 @@ msgstr ""
 
 #: of pywebio.session.go_app:1
 msgid ""
-"Jump to another task of a same PyWebIO application. Only available in "
-"PyWebIO Server mode"
+"Jump to another task of a same PyWebIO application. Only available in PyWebIO "
+"Server mode"
 msgstr "在同一PyWebIO应用的不同服务之间跳转。仅在PyWebIO Server模式下可用"
 
 #: of pywebio.session.go_app:3
@@ -419,29 +425,32 @@ msgstr "表示会话信息的对象,属性有:"
 
 #: of pywebio.session:90
 msgid ""
-"``user_agent`` : The Object of the user browser information, whose "
-"attributes are"
+"``user_agent`` : The Object of the user browser information, whose attributes are"
 msgstr "``user_agent`` : 表示用户浏览器信息的对象,属性有"
 
 #: of pywebio.session:92
 msgid ""
-"``is_mobile`` (bool): whether user agent is identified as a mobile phone "
-"(iPhone, Android phones, Blackberry, Windows Phone devices etc)"
+"``is_mobile`` (bool): whether user agent is identified as a mobile phone (iPhone, "
+"Android phones, Blackberry, Windows Phone devices etc)"
 msgstr ""
-"``is_mobile`` (bool): 用户使用的设备是否为手机 (比如 iPhone, Android phones, Blackberry, "
-"Windows Phone 等设备)"
+"``is_mobile`` (bool): 用户使用的设备是否为手机 (比如 iPhone, Android phones, "
+"Blackberry, Windows Phone 等设备)"
 
 #: of pywebio.session:93
 msgid ""
-"``is_tablet`` (bool): whether user agent is identified as a tablet device "
-"(iPad, Kindle Fire, Nexus 7 etc)"
-msgstr "``is_tablet`` (bool): 用户使用的设备是否为平板 (比如 iPad, Kindle Fire, Nexus 7 等设备)"
+"``is_tablet`` (bool): whether user agent is identified as a tablet device (iPad, "
+"Kindle Fire, Nexus 7 etc)"
+msgstr ""
+"``is_tablet`` (bool): 用户使用的设备是否为平板 (比如 iPad, Kindle Fire, Nexus 7 等"
+"设备)"
 
 #: of pywebio.session:94
 msgid ""
-"``is_pc`` (bool): whether user agent is identified to be running a "
-"traditional \"desktop\" OS (Windows, OS X, Linux)"
-msgstr "``is_pc`` (bool): 用户使用的设备是否为桌面电脑 (比如运行 Windows, OS X, Linux 的设备)"
+"``is_pc`` (bool): whether user agent is identified to be running a traditional "
+"\"desktop\" OS (Windows, OS X, Linux)"
+msgstr ""
+"``is_pc`` (bool): 用户使用的设备是否为桌面电脑 (比如运行 Windows, OS X, Linux 的设"
+"备)"
 
 #: of pywebio.session:95
 msgid "``is_touch_capable`` (bool): whether user agent has touch capabilities"
@@ -485,27 +494,28 @@ msgstr "``device.model`` (str): 设备型号. 比如 'iPhone'"
 
 #: of pywebio.session:109
 msgid ""
-"``user_language`` (str): Language used by the user's operating system. "
-"(e.g., ``'zh-CN'``)"
+"``user_language`` (str): Language used by the user's operating system. (e.g., "
+"``'zh-CN'``)"
 msgstr "``user_language`` (str): 用户操作系统使用的语言. 比如 ``'zh-CN'``"
 
 #: of pywebio.session:110
 msgid ""
-"``server_host`` (str): PyWebIO server host, including domain and port, the "
-"port can be omitted when 80."
-msgstr "``server_host`` (str): 当前会话的服务器host,包含域名和端口,端口为80时可以被省略"
+"``server_host`` (str): PyWebIO server host, including domain and port, the port "
+"can be omitted when 80."
+msgstr ""
+"``server_host`` (str): 当前会话的服务器host,包含域名和端口,端口为80时可以被省略"
 
 #: of pywebio.session:111
 msgid ""
-"``origin`` (str): Indicate where the user from. Including protocol, host, "
-"and port parts. Such as ``'http://localhost:8080'`` . It may be empty, but "
-"it is guaranteed to have a value when the user's page address is not under "
-"the server host. (that is, the host, port part are inconsistent with "
-"``server_host``)."
+"``origin`` (str): Indicate where the user from. Including protocol, host, and port "
+"parts. Such as ``'http://localhost:8080'`` . It may be empty, but it is guaranteed "
+"to have a value when the user's page address is not under the server host. (that "
+"is, the host, port part are inconsistent with ``server_host``)."
 msgstr ""
-"``origin`` (str): 当前用户的页面地址. 包含 协议、主机、端口 部分. 比如 ``'http://localhost:8080'`` "
-".\n"
-"可能为空,但保证当用户的页面地址不在当前服务器下(即 主机、端口部分和 ``server_host`` 不一致)时有值."
+"``origin`` (str): 当前用户的页面地址. 包含 协议、主机、端口 部分. 比如 ``'http://"
+"localhost:8080'`` .\n"
+"可能为空,但保证当用户的页面地址不在当前服务器下(即 主机、端口部分和 "
+"``server_host`` 不一致)时有值."
 
 #: of pywebio.session:113
 msgid "``user_ip`` (str): User's ip address."
@@ -513,67 +523,63 @@ msgstr "用户的ip地址."
 
 #: of pywebio.session:114
 msgid ""
-"``backend`` (str): The current PyWebIO backend server implementation. The "
-"possible values are ``'tornado'``, ``'flask'``, ``'django'`` , "
-"``'aiohttp'``."
+"``backend`` (str): The current PyWebIO backend server implementation. The possible "
+"values are ``'tornado'``, ``'flask'``, ``'django'`` , ``'aiohttp'``."
 msgstr ""
-"当前PyWebIO使用的后端Server实现. 可能出现的值有 ``'tornado'`` , ``'flask'`` , ``'django'`` ,"
-" ``'aiohttp'``."
+"当前PyWebIO使用的后端Server实现. 可能出现的值有 ``'tornado'`` , ``'flask'`` , "
+"``'django'`` , ``'aiohttp'``."
 
 #: of pywebio.session:115
 msgid ""
-"``protocol`` (str): The communication protocol between PyWebIO server and "
-"browser. The possible values are ``'websocket'``, ``'http'``"
+"``protocol`` (str): The communication protocol between PyWebIO server and browser. "
+"The possible values are ``'websocket'``, ``'http'``"
 msgstr ""
 
 #: of pywebio.session:116
 msgid ""
 "``request`` (object): The request object when creating the current session. "
 "Depending on the backend server, the type of ``request`` can be:"
-msgstr "创建当前会话时的Web请求对象. 根据PyWebIO使用的后端Server不同,``request`` 的类型也不同:"
+msgstr ""
+"创建当前会话时的Web请求对象. 根据PyWebIO使用的后端Server不同,``request`` 的类型也"
+"不同:"
 
 #: of pywebio.session:118
 msgid ""
-"When using Tornado, ``request`` is instance of "
-"`tornado.httputil.HTTPServerRequest "
-"<https://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest>`_"
+"When using Tornado, ``request`` is instance of `tornado.httputil.HTTPServerRequest "
+"<https://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil."
+"HTTPServerRequest>`_"
 msgstr ""
-"使用Tornado后端时, ``request`` 为 `tornado.httputil.HTTPServerRequest "
-"<https://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest>`_"
-" 实例"
+"使用Tornado后端时, ``request`` 为 `tornado.httputil.HTTPServerRequest <https://www."
+"tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest>`_ 实例"
 
 #: of pywebio.session:120
 msgid ""
-"When using Flask, ``request`` is instance of `flask.Request "
-"<https://flask.palletsprojects.com/en/1.1.x/api/#incoming-request-data>`_"
+"When using Flask, ``request`` is instance of `flask.Request <https://flask."
+"palletsprojects.com/en/1.1.x/api/#incoming-request-data>`_"
 msgstr ""
-"使用Flask后端时, ``request`` 为 `flask.Request "
-"<https://flask.palletsprojects.com/en/1.1.x/api/#incoming-request-data>`_ 实例"
+"使用Flask后端时, ``request`` 为 `flask.Request <https://flask.palletsprojects.com/"
+"en/1.1.x/api/#incoming-request-data>`_ 实例"
 
 #: of pywebio.session:121
 msgid ""
-"When using Django, ``request`` is instance of `django.http.HttpRequest "
-"<https://docs.djangoproject.com/en/3.0/ref/request-"
-"response/#django.http.HttpRequest>`_"
+"When using Django, ``request`` is instance of `django.http.HttpRequest <https://"
+"docs.djangoproject.com/en/3.0/ref/request-response/#django.http.HttpRequest>`_"
 msgstr ""
-"使用Django后端时, ``request`` 为 `django.http.HttpRequest "
-"<https://docs.djangoproject.com/en/3.0/ref/request-"
-"response/#django.http.HttpRequest>`_ 实例"
+"使用Django后端时, ``request`` 为 `django.http.HttpRequest <https://docs."
+"djangoproject.com/en/3.0/ref/request-response/#django.http.HttpRequest>`_ 实例"
 
 #: of pywebio.session:122
 msgid ""
-"When using aiohttp, ``request`` is instance of `aiohttp.web.BaseRequest "
-"<https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.BaseRequest>`_"
+"When using aiohttp, ``request`` is instance of `aiohttp.web.BaseRequest <https://"
+"docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.BaseRequest>`_"
 msgstr ""
-"使用aiohttp后端时, ``request`` 为 `aiohttp.web.BaseRequest "
-"<https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.BaseRequest>`_"
-" 实例"
+"使用aiohttp后端时, ``request`` 为 `aiohttp.web.BaseRequest <https://docs.aiohttp."
+"org/en/stable/web_reference.html#aiohttp.web.BaseRequest>`_ 实例"
 
 #: of pywebio.session:124
 msgid ""
-"The ``user_agent`` attribute of the session information object is parsed by "
-"the user-agents library. See https://github.com/selwin/python-user-"
-"agents#usage"
+"The ``user_agent`` attribute of the session information object is parsed by the "
+"user-agents library. See https://github.com/selwin/python-user-agents#usage"
 msgstr ""
 "会话信息对象的 ``user_agent`` 属性是通过 user-agents 库进行解析生成的。参见 "
 "https://github.com/selwin/python-user-agents#usage"
@@ -610,26 +616,8 @@ msgstr "关闭协程任务"
 msgid "Returns a bool stating whether the coroutine task is closed."
 msgstr "任务是否关闭"
 
-#~ msgid ""
-#~ "import json\n"
-#~ "from pywebio import session\n"
-#~ "\n"
-#~ "put_code(json.dumps({\n"
-#~ "    k: str(getattr(session.info, k))\n"
-#~ "    for k in ['user_agent', 'user_language', 'server_host',\n"
-#~ "              'origin', 'user_ip', 'backend', 'request']\n"
-#~ "}, indent=4), 'json')"
-#~ msgstr ""
-
 #~ msgid "Get the session-local object of current session."
 #~ msgstr "获取当前会话的数据对象(session-local object)。"
 
-#~ msgid "Use `local <pywebio.session.local>` instead."
-#~ msgstr ""
-
 #~ msgid "Get information about the current session"
 #~ msgstr "获取当前会话的相关信息"
-
-#~ msgid "Use `info <pywebio.session.info>` instead."
-#~ msgstr ""
-

+ 12 - 11
pywebio/input.py

@@ -1,6 +1,6 @@
 """
 
-This module provides many functions to get all kinds of input of user from the browser
+This module provides functions to get all kinds of input of user from the browser
 
 There are two ways to use the input functions, one is to call the input function alone to get a single input::
 
@@ -21,7 +21,7 @@ When use `input_group`, you needs to provide the ``name`` parameter in each inpu
 
    PyWebIO determines whether the input function is in `input_group` or is called alone according to whether the ``name`` parameter is passed. So when calling an input function alone, **do not** set the ``name`` parameter; when calling the input function in `input_group`, you **must** provide the ``name`` parameter.
 
-By default, the user can submit an input of empty value. If the user must provide a non-empty input value, you need to pass ``required=True`` to the input function (some input functions do not support the ``required`` parameter)
+By default, the user can submit empty input value. If the user must provide a non-empty input value, you need to pass ``required=True`` to the input function (some input functions do not support the ``required`` parameter)
 
 Functions list
 -----------------
@@ -111,7 +111,7 @@ def input(label='', type=TEXT, *, validate=None, name=None, value=None, action=N
     :param str type: Input type. Currently supported types are:`TEXT` , `NUMBER` , `FLOAT` , `PASSWORD` , `URL` , `DATE` , `TIME`
 
        Note that `DATE` and `TIME` type are not supported on some browsers, for details see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Browser_compatibility
-    :param callable validate: Input value validation function. If provided, the validation function will be called when the user completes input or submits the form.
+    :param callable validate: Input value validation function. If provided, the validation function will be called when user completes the input field or submits the form.
 
         ``validate`` receives the input value as a parameter. When the input value is valid, it returns ``None``. When the input value is invalid, it returns an error message string. For example:
 
@@ -129,7 +129,7 @@ def input(label='', type=TEXT, *, validate=None, name=None, value=None, action=N
     :param str name: A string specifying a name for the input. Used with `input_group()` to identify different input items in the results of the input group. If call the input function alone, this parameter can **not** be set!
     :param str value: The initial value of the input
     :type action: tuple(label:str, callback:callable)
-    :param action: Put a button on the right side of the input field, and you can click the button to set the value for the input.
+    :param action: Put a button on the right side of the input field, and user can click the button to set the value for the input.
 
         ``label`` is the label of the button, and ``callback`` is the callback function to set the input value when clicked.
 
@@ -171,10 +171,10 @@ def input(label='', type=TEXT, *, validate=None, name=None, value=None, action=N
         Note: When using :ref:`Coroutine-based session <coroutine_based_session>` implementation, the ``callback`` function can be a coroutine function.
 
     :param str placeholder: A hint to the user of what can be entered in the input. It will appear in the input field when it has no value set.
-    :param bool required: Whether a value is required for the input to be submittable
+    :param bool required: Whether a value is required for the input to be submittable, default is ``False``
     :param bool readonly: Whether the value is readonly(not editable)
     :param list datalist: A list of predefined values to suggest to the user for this input. Can only be used when ``type=TEXT``
-    :param str help_text: Help text for the input. The text will be displayed below the input field in a small font
+    :param str help_text: Help text for the input. The text will be displayed below the input field with small font
     :param other_html_attrs: Additional html attributes added to the input element. reference: https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input#%E5%B1%9E%E6%80%A7
     :return: The value that user input.
     """
@@ -337,7 +337,7 @@ def checkbox(label='', options=None, *, inline=None, validate=None, name=None, v
     r"""A group of check box that allowing single values to be selected/deselected.
 
     :param list options: List of options. The format is the same as the ``options`` parameter of the `select()` function
-    :param bool inline: Whether to display the options on one line. Default is False
+    :param bool inline: Whether to display the options on one line. Default is ``False``
     :param list value: The value list of the initial selected items.
        You can also set the initial selected option by setting the ``selected`` field in the ``options`` list item.
     :param - label, validate, name, help_text, other_html_attrs: Those arguments have the same meaning as for `input()`
@@ -360,7 +360,7 @@ def radio(label='', options=None, *, inline=None, validate=None, name=None, valu
     r"""A group of radio button. Only a single button can be selected.
 
     :param list options: List of options. The format is the same as the ``options`` parameter of the `select()` function
-    :param bool inline: Whether to display the options on one line. Default is False
+    :param bool inline: Whether to display the options on one line. Default is ``False``
     :param str value: The value of the initial selected items.
        You can also set the initial selected option by setting the ``selected`` field in the ``options`` list item.
     :param bool required: whether to must select one option. (the user can select nothing option by default)
@@ -458,7 +458,8 @@ def actions(label='', buttons=None, name=None, help_text=None):
         :name: actions-select
         :summary: Use `actions()` to perform simple selection
 
-        confirm = actions('Confirm to delete file?', ['confirm', 'cancel'], help_text='Unrecoverable after file deletion')
+        confirm = actions('Confirm to delete file?', ['confirm', 'cancel'],
+                              help_text='Unrecoverable after file deletion')
         if confirm=='confirm':  # ..doc-only
             ...  # ..doc-only
         put_markdown('You clicked the `%s` button' % confirm)  # ..demo-only
@@ -520,7 +521,7 @@ def file_upload(label='', accept=None, name=None, placeholder='Choose file', mul
        E.g: ``max_size=500``, ``max_size='40K'``, ``max_size='3M'``
 
     :param int/str max_total_size: The maximum size of all files. Only available when ``multiple=True``. The default is 0, which means there is no limit to the size. The format is the same as the ``max_size`` parameter
-    :param bool required: Indicates whether the user must specify a file for the input. Default is `False`.
+    :param bool required: Indicates whether the user must specify a file for the input. Default is ``False``.
     :param - label, name, help_text, other_html_attrs: Those arguments have the same meaning as for `input()`
     :return: When ``multiple=False``, a dict is returned::
 
@@ -588,7 +589,7 @@ def input_group(label='', inputs=None, validate=None, cancelable=False):
 
         put_text(data['name'], data['age'])
 
-    :param bool cancelable: Whether the form can be cancelled. Default is False. If ``cancelable=True``, a "Cancel" button will be displayed at the bottom of the form.
+    :param bool cancelable: Whether the form can be cancelled. Default is ``False``. If ``cancelable=True``, a "Cancel" button will be displayed at the bottom of the form.
 
         Note: If the last input item in the group is `actions()`, ``cancelable`` will be ignored.
 

+ 1 - 1
pywebio/output.py

@@ -1,5 +1,5 @@
 r"""
-This module provides many functions to output all kinds of content to the user's browser, and supply flexible output control.
+This module provides functions to output all kinds of content to the user's browser, and supply flexible output control.
 
 
 .. _output_func_list:

+ 3 - 2
pywebio/session/__init__.py

@@ -308,7 +308,8 @@ def download(name, content):
         :name: download
         :summary: `download()` usage
 
-        put_buttons(['Click to download'], [lambda: download('hello-world.txt', b'hello world!')])
+        put_buttons(['Click to download'],
+                    [lambda: download('hello-world.txt', b'hello world!')])
 
     """
     from ..io_ctrl import send_msg
@@ -445,7 +446,7 @@ def defer_call(func):
          def cleanup():
             pass
 
-    .. attention:: PyWebIO interactive functions cannot be called inside the function ``func``.
+    .. attention:: PyWebIO interactive functions cannot be called inside the deferred functions.
 
     """
     get_current_session().defer_call(func)

Неке датотеке нису приказане због велике количине промена