# SOME DESCRIPTIVE TITLE.
# Copyright (C) WangWeimin
# This file is distributed under the same license as the PyWebIO package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: PyWebIO 1.1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-05 13:39+0800\n"
"PO-Revision-Date: 2021-12-02 21:52+0800\n"
"Last-Translator: WangWeimin <wang0.618@qq.com>\n"
"Language: zh_CN\n"
"Language-Team: \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 3.0\n"

#: ../../session.rst:2
msgid "``pywebio.session`` --- More control to session"
msgstr "``pywebio.session`` — 会话相关"

#: of pywebio.session.download:1
msgid "Send file to user, and the user browser will download the file to the local"
msgstr "向用户推送文件，用户浏览器会将文件下载到本地"

#: of pywebio.session.download pywebio.session.eval_js pywebio.session.go_app
#: pywebio.session.register_thread pywebio.session.run_async
#: pywebio.session.run_asyncio_coroutine pywebio.session.run_js
msgid "Parameters"
msgstr ""

#: of pywebio.session.download:3
msgid "File name when downloading"
msgstr "下载保存为的文件名"

#: of pywebio.session.download:4
msgid "File content. It is a bytes-like object"
msgstr "文件内容. 类型为 bytes-like object"

#: of pywebio.session:137 pywebio.session.download:6 pywebio.session.eval_js:12
msgid "Example:"
msgstr ""

#: of pywebio.session.download:8
msgid ""
"put_button('Click to download', lambda: download('hello-world.txt', b'hello "
"world!'))"
msgstr ""

#: of pywebio.session.run_js:1
msgid "Execute JavaScript code in user browser."
msgstr "在用户浏览器中运行JavaScript代码."

#: of pywebio.session.run_js:3
msgid "The code is run in the browser's JS global scope."
msgstr "代码运行在浏览器的JS全局作用域中"

#: of pywebio.session.run_js:5
msgid "JavaScript code"
msgstr "js代码"

#: of pywebio.session.eval_js:6 pywebio.session.run_js:6
msgid "Local variables passed to js code. Variables need to be JSON-serializable."
msgstr "传递给js代码的局部变量。变量值需要可以被json序列化"

#: of pywebio.session.run_asyncio_coroutine:8 pywebio.session.run_js:8
#: pywebio.session.set_env:20
msgid "Example::"
msgstr ""

#: of pywebio.session.run_js:10
msgid "run_js('console.log(a + b)', a=1, b=2)"
msgstr ""

#: of pywebio.session.eval_js:1
msgid ""
"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. "
"If the value of the expression is a `promise <https://developer.mozilla.org/en-US/"
"docs/Web/JavaScript/Reference/Global_Objects/Promise>`_, ``eval_js()`` will wait "
"for the promise to resolve and return the value of it. When the promise is "
"rejected, `None` is returned."
msgstr ""
"JavaScript表达式。表达式的值需要可以被JSON序列化。如果表达式的值是一个 `promise "
"<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/"
"Promise>`_ ， ``eval_js()`` 会一直等待promise被resolve，然后返回它的值，若promise被"
"reject，则返回 `None` 。"

#: of pywebio.session.eval_js pywebio.session.run_async
msgid "Returns"
msgstr ""

#: of pywebio.session.eval_js:7
msgid "The value of the expression."
msgstr "js表达式的值"

#: of pywebio.session.eval_js:9
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."
msgstr ""
"注意⚠️：在 :ref:`基于协程 <coroutine_based_session>` 的会话上下文中，需要使用 "
"``await eval_js(expression)`` 语法来进行调用。"

#: of pywebio.session.eval_js:14
msgid ""
"current_url = eval_js(\"window.location.href\")\n"
"put_text(current_url)  # ..demo-only\n"
"\n"
"## ----\n"
"function_res = eval_js('''(function(){\n"
"    var a = 1;\n"
"    a += b;\n"
"    return a;\n"
"})()''', b=100)\n"
"put_text(function_res)  # ..demo-only\n"
"\n"
"## ----\n"
"promise_res = eval_js('''new Promise(resolve => {\n"
"    setTimeout(() => {\n"
"        resolve('Returned inside callback.');\n"
"    }, 2000);\n"
"});''')\n"
"put_text(promise_res)  # ..demo-only"
msgstr ""

#: of pywebio.session.eval_js:39
msgid "The JS expression support return promise."
msgstr ""

#: of pywebio.session.register_thread:1
msgid ""
"Register the thread so that PyWebIO interactive functions are available in the "
"thread."
msgstr "注册线程，以便在线程内调用 PyWebIO 交互函数。"

#: of pywebio.session.register_thread:3
msgid "Can only be used in the thread-based session."
msgstr "仅能在默认的基于线程的会话上下文中调用。"

#: of pywebio.session.register_thread:5
msgid "See :ref:`Concurrent in Server mode <thread_in_server_mode>`"
msgstr "参见 :ref:`Server模式下并发与会话的结束 <thread_in_server_mode>`"

#: of pywebio.session.register_thread:7
msgid "Thread object"
msgstr "线程对象"

#: of pywebio.session.defer_call:1
msgid "Set the function to be called when the session closes."
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."
msgstr "无论是用户主动关闭会话还是任务结束会话关闭，设置的函数都会被运行。"

#: of pywebio.session.defer_call:6
msgid ""
"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:9
msgid "``defer_call()`` can also be used as decorator::"
msgstr "`defer_call` 同样支持以装饰器的方式使用::"

#: of pywebio.session.defer_call:11
msgid ""
"@defer_call\n"
"def cleanup():\n"
"   pass"
msgstr ""

#: of pywebio.session.defer_call:15
msgid "PyWebIO interactive functions cannot be called inside the deferred functions."
msgstr ""
"通过 `defer_call()` 设置的函数被调用时会话已经关闭，所以在函数体内不可以调用 "
"PyWebIO 的交互函数"

#: of pywebio.session:9
msgid "The session-local object for current session."
msgstr "当前会话的数据对象(session-local object)。"

#: of pywebio.session:11
msgid ""
"``local`` is a dictionary object that can be accessed through attributes, it aim "
"to be used to save some session-local state of your application. Attributes of "
"``local`` are not shared between sessions, each session sees only the attributes "
"it itself placed in there."
msgstr ""
"``local`` 是一个可以通过属性取值的字典，它的目标是用来存储应用中会话独立的状态。 "
"``local`` 中存储的内容不会在会话之间共享，每个会话只能访问到自己存储在其中的数据。"

#: of pywebio.session
msgid "Usage Scenes"
msgstr "使用场景"

#: of pywebio.session:17
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对象保存状态会比通过函"
"数参数传递更方便。"

#: of pywebio.session:20
msgid "Here is a example of a session independent counter implementation::"
msgstr "以下是一个会话独立的计数器的实现示例::"

#: of pywebio.session:22
msgid ""
"from pywebio.session import local\n"
"def add():\n"
"    local.cnt = (local.cnt or 0) + 1\n"
"\n"
"def show():\n"
"    put_text(local.cnt or 0)\n"
"\n"
"def main():\n"
"    put_buttons(['Add counter', 'Show counter'], [add, show])"
msgstr ""

#: of pywebio.session:32
msgid "The way to pass state through function parameters is::"
msgstr "而通过函数参数传递状态的实现方式为::"

#: of pywebio.session:34
msgid ""
"from functools import partial\n"
"def add(cnt):\n"
"    cnt[0] += 1\n"
"\n"
"def show(cnt):\n"
"    put_text(cnt[0])\n"
"\n"
"def main():\n"
"    cnt = [0]  # Trick: to pass by reference\n"
"    put_buttons(['Add counter', 'Show counter'], [partial(add, cnt), partial(show, "
"cnt)])"
msgstr ""

#: of pywebio.session:45
msgid "Of course, you can also use function closures to achieved the same::"
msgstr "当然，还可以通过函数闭包来实现相同的功能::"

#: of pywebio.session:47
msgid ""
"def main():\n"
"    cnt = 0\n"
"\n"
"    def add():\n"
"        nonlocal cnt\n"
"        cnt += 1\n"
"\n"
"    def show():\n"
"        put_text(cnt)\n"
"\n"
"    put_buttons(['Add counter', 'Show counter'], [add, show])"
msgstr ""

#: of pywebio.session
msgid "Operations supported by local object"
msgstr "local对象支持的操作"

#: of pywebio.session:61
msgid ""
"``local`` is a dictionary object 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`` 获取底层的字典表示。"

#: of pywebio.session:68
msgid ""
"local.name = \"Wang\"\n"
"local.age = 22\n"
"assert local.foo is None\n"
"local[10] = \"10\"\n"
"\n"
"for key in local:\n"
"    print(key)\n"
"\n"
"assert 'bar' not in local\n"
"assert 'name' in local\n"
"\n"
"print(local._dict)"
msgstr ""

#: of pywebio.session.set_env:1
msgid "configure the environment of current session."
msgstr "当前会话的环境设置"

#: of pywebio.session.set_env:3
msgid "Available configuration are:"
msgstr "可配置项有:"

#: of pywebio.session.set_env:5
msgid "``title`` (str): Title of current page."
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): 是否启用输出动画（在输出内容时，使用过渡动画），默认启"
"用"

#: 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."
msgstr ""
"``auto_scroll_bottom`` (bool): 是否在内容输出时将页面自动滚动到底部，默认关闭。注"
"意，开启后，只有输出到ROOT Scope才可以触发自动滚动。"

#: of pywebio.session.set_env:9
msgid ""
"``http_pull_interval`` (int): The period of HTTP polling messages (in "
"milliseconds, default 1000ms), only available in sessions based on HTTP connection."
msgstr ""
"``http_pull_interval`` (int): HTTP轮询后端消息的周期（单位为毫秒，默认1000ms），仅"
"在基于HTTP连接的会话（使用Flask或Django后端）中可用"

#: of pywebio.session.set_env:11
msgid ""
"``input_panel_fixed`` (bool): Whether to make input panel fixed at bottom, enabled "
"by default"
msgstr "``input_panel_fixed`` (bool): 是否将输入栏固定在页面底部, 默认启用。"

#: of pywebio.session.set_env:12
msgid ""
"``input_panel_min_height`` (int): The minimum height of input panel (in pixel, "
"default 300px), it should be larger than 75px. Available only when "
"``input_panel_fixed=True``"
msgstr ""
"``input_panel_min_height`` (int): 输入栏的最小高度(像素, 默认为300px，最小允许 "
"75px)。仅当 ``input_panel_fixed=True`` 时可用。"

#: of pywebio.session.set_env:14
msgid ""
"``input_panel_init_height`` (int): The initial height of input panel (in pixel, "
"default 300px), it should be larger than 175px. Available only when "
"``input_panel_fixed=True``"
msgstr ""
"``input_panel_init_height`` (int): 输入栏的初始高度(像素, 默认为300px，最小允许 "
"175px)。仅当 ``input_panel_fixed=True`` 时可用。"

#: of pywebio.session.set_env:16
msgid ""
"``input_auto_focus`` (bool): Whether to focus on input automatically after showing "
"input panel, default is ``True``"
msgstr "``input_auto_focus`` (bool): 输入栏是否自动获取输入焦点，默认为 ``True`` 。"

#: of pywebio.session.set_env:17
msgid ""
"``output_max_width`` (str): The max width of the page content area (in pixel or "
"percentage, e.g. ``'1080px'``, ``'80%'``. Default is 880px)."
msgstr ""
"``output_max_width`` (str): 页面内容区域的最大宽度（像素或百分比，例如： "
"``'1080px'``, ``'80%'``. 默认为 ``'880px'``）"

#: of pywebio.session.set_env:22
msgid "set_env(title='Awesome PyWebIO!!', output_animation=False)"
msgstr ""

#: of pywebio.session.set_env:26
msgid "Added the ``output_max_width`` parameter"
msgstr ""

#: of pywebio.session.go_app:1
msgid ""
"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
msgid "Target PyWebIO task name."
msgstr "目标 PyWebIO 任务名"

#: of pywebio.session.go_app:4
msgid "Whether to open in a new window, the default is `True`"
msgstr "是否在新窗口打开，默认为 `True`"

#: of pywebio.session.go_app:6
msgid "See also: :ref:`Server mode <server_and_script_mode>`"
msgstr "参见： :ref:`Server 模式 <server_and_script_mode>`"

#: of pywebio.session:88
msgid "The session information data object, whose attributes are:"
msgstr "表示会话信息的对象，属性有："

#: of pywebio.session:90
msgid ""
"``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)"
msgstr ""
"``is_mobile`` (bool): 用户使用的设备是否为手机 (比如 iPhone, Android phones, "
"Blackberry, Windows Phone 等设备)"

#: of pywebio.session:94
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 等"
"设备)"

#: of pywebio.session:95
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 的设"
"备)"

#: of pywebio.session:96
msgid "``is_touch_capable`` (bool): whether user agent has touch capabilities"
msgstr "``is_touch_capable`` (bool): 用户使用的设备是否支持触控"

#: of pywebio.session:98
msgid "``browser.family`` (str): Browser family. such as 'Mobile Safari'"
msgstr "``browser.family`` (str): 浏览器家族. 比如 'Mobile Safari'"

#: of pywebio.session:99
msgid "``browser.version`` (tuple): Browser version. such as (5, 1)"
msgstr "``browser.version`` (tuple): 浏览器版本元组. 比如 (5, 1)"

#: of pywebio.session:100
msgid "``browser.version_string`` (str): Browser version string. such as '5.1'"
msgstr "``browser.version_string`` (str): 浏览器版本字符串. 比如  '5.1'"

#: of pywebio.session:102
msgid "``os.family`` (str): User OS family. such as 'iOS'"
msgstr "``os.family`` (str): 操作系统家族. 比如 'iOS'"

#: of pywebio.session:103
msgid "``os.version`` (tuple): User OS version. such as (5, 1)"
msgstr "``os.version`` (tuple): 操作系统版本元组. 比如 (5, 1)"

#: of pywebio.session:104
msgid "``os.version_string`` (str): User OS version string. such as '5.1'"
msgstr "``os.version_string`` (str): 操作系统版本字符串. 比如 '5.1'"

#: of pywebio.session:106
msgid "``device.family`` (str): User agent's device family. such as 'iPhone'"
msgstr "``device.family`` (str): 设备家族. 比如 'iPhone'"

#: of pywebio.session:107
msgid "``device.brand`` (str): Device brand. such as 'Apple'"
msgstr "``device.brand`` (str): 设备品牌. 比如 'Apple'"

#: of pywebio.session:108
msgid "``device.model`` (str): Device model. such as 'iPhone'"
msgstr "``device.model`` (str): 设备型号. 比如 'iPhone'"

#: of pywebio.session:110
msgid ""
"``user_language`` (str): Language used by the user's operating system. (e.g., "
"``'zh-CN'``)"
msgstr "``user_language`` (str): 用户操作系统使用的语言. 比如 ``'zh-CN'``"

#: of pywebio.session:111
msgid ""
"``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:112
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``)."
msgstr ""
"``origin`` (str): 当前用户的页面地址. 包含 协议、主机、端口 部分. 比如 ``'http://"
"localhost:8080'`` .\n"
"可能为空，但保证当用户的页面地址不在当前服务器下(即 主机、端口部分和 "
"``server_host`` 不一致)时有值."

#: of pywebio.session:115
msgid "``user_ip`` (str): User's ip address."
msgstr "``user_ip`` (str): 用户的ip地址."

#: of pywebio.session:116
msgid ""
"``backend`` (str): The current PyWebIO backend server implementation. The possible "
"values are ``'tornado'``, ``'flask'``, ``'django'`` , ``'aiohttp'`` , "
"``'starlette'``."
msgstr ""
"``backend`` (str): 当前PyWebIO使用的后端Server实现. 可能出现的值有 ``'tornado'`` , "
"``'flask'`` , ``'django'`` , ``'aiohttp'`` , ``'starlette'``."

#: of pywebio.session:118
msgid ""
"``protocol`` (str): The communication protocol between PyWebIO server and browser. "
"The possible values are ``'websocket'``, ``'http'``"
msgstr ""
"``protocol`` (str): PyWebIO服务器与浏览器之间的通信协议。可能的值为 "
"``'websocket'`` 或 ``'http'``"

#: of pywebio.session:120
msgid ""
"``request`` (object): The request object when creating the current session. "
"Depending on the backend server, the type of ``request`` can be:"
msgstr ""
"``request`` (object): 创建当前会话时的Web请求对象. 根据PyWebIO使用的后端Server不"
"同，``request`` 的类型也不同:"

#: of pywebio.session:123
msgid ""
"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>`_ 实例"

#: of pywebio.session:125
msgid ""
"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>`_ 实例"

#: of pywebio.session:126
msgid ""
"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>`_ 实例"

#: of pywebio.session:127
msgid ""
"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>`_ 实例"

#: of pywebio.session:128
msgid ""
"When using FastAPI/Starlette, ``request`` is instance of `starlette.websockets."
"WebSocket <https://www.starlette.io/websockets/>`_"
msgstr ""
"当使用FastAPI或Starlette时， ``request`` 属性为 `starlette.websockets.WebSocket "
"<https://www.starlette.io/websockets/>`_ 实例"

#: of pywebio.session:130
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"
msgstr ""
"会话信息对象的 ``user_agent`` 属性是通过 user-agents 库进行解析生成的。参见 "
"https://github.com/selwin/python-user-agents#usage"

#: of pywebio.session:135
msgid "Added the ``protocol`` attribute."
msgstr ""

#: of pywebio.session:139
msgid ""
"import json\n"
"from pywebio.session import info as session_info\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', 'protocol', 'request']\n"
"}, indent=4), 'json')"
msgstr ""

#: of pywebio.session.coroutinebased.TaskHandler:1
msgid "The handler of coroutine task"
msgstr "协程任务句柄"

#: of pywebio.session.coroutinebased.TaskHandler:3
msgid "See also: `run_async() <pywebio.session.run_async>`"
msgstr ""

#: of pywebio.session.coroutinebased.TaskHandler.close:1
msgid "Close the coroutine task."
msgstr "关闭协程任务"

#: of pywebio.session.coroutinebased.TaskHandler.closed:1
msgid "Returns a bool stating whether the coroutine task is closed."
msgstr "任务是否关闭"

#: of pywebio.session.hold:1
msgid "Keep the session alive until the browser page is closed by user."
msgstr "保持会话，直到用户关闭浏览器。"

#: of pywebio.session.hold:5
msgid ""
"Since PyWebIO v1.4, in :ref:`server mode <server_mode>`, it's no need to call this "
"function manually, PyWebIO will automatically hold the session for you when "
"needed. The only case to use it is to prevent the application from exiting in "
"scrip mode."
msgstr ""
"从PyWebIO v1.4之后，在 :ref:`server模式 <server_mode>` 下，不再需要手动调用本函数，"
"PyWebIO会在需要时自动调用。本函数的唯一使用场景为在script模式下阻止脚本退出。"

#: of pywebio.session.hold:9
msgid ""
"In case you use the previous version of PyWebIO (we strongly recommend that you "
"upgrade to the latest version), here is the old document for ``hold()``:"
msgstr ""
"如果你还在使用旧版本的PyWebIO(强烈建议你升级版本)，这是 ``hold()`` 函数旧版本的文"
"档:"

#: of pywebio.session.hold:12
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."
msgstr ""
"在PyWebIO会话结束后，页面和服务端的连接便会断开，\n"
"页面上需要和服务端通信才可实现的功能(比如：下载通过 `put_file() <pywebio.output."
"put_file>` 输出的文件，\n"
"`put_buttons() <pywebio.output.put_buttons>` 按钮回调)便无法使用。\n"
"可以在任务函数末尾处调用 ``hold()`` 函数来将会话保持，这样在用户关闭浏览器页面前，"
"会话将一直保持连接。"

#: of pywebio.session.run_async:1
msgid ""
"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>` 的会话上下文中调用"

#: of pywebio.session.run_async:5
msgid "Coroutine object"
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."
msgstr ""
"`TaskHandle <pywebio.session.coroutinebased.TaskHandle>` 实例。 通过 TaskHandle 可"
"以查询协程运行状态和关闭协程。"

#: of pywebio.session.run_async:9
msgid ""
"See also: :ref:`Concurrency in coroutine-based sessions "
"<coroutine_based_concurrency>`"
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中的协程。"

#: of pywebio.session.run_asyncio_coroutine:4
msgid "Can only be used in :ref:`coroutine-based session <coroutine_based_session>`."
msgstr "仅能在 :ref:`基于协程 <coroutine_based_session>` 的会话上下文中调用。"

#: of pywebio.session.run_asyncio_coroutine:6
msgid "Coroutine object in `asyncio`"
msgstr "`asyncio` 库中的协程对象"

#: of pywebio.session.run_asyncio_coroutine:10
msgid ""
"async def app():\n"
"    put_text('hello')\n"
"    await run_asyncio_coroutine(asyncio.sleep(1))\n"
"    put_text('world')\n"
"\n"
"pywebio.platform.flask.start_server(app)"
msgstr ""

#~ msgid "Get the session-local object of current session."
#~ msgstr "获取当前会话的数据对象(session-local object)。"

#~ msgid "Get information about the current session"
#~ msgstr "获取当前会话的相关信息"

#~ msgid ""
#~ "JavaScript expression. The value of the expression need to be JSON-serializable."
#~ msgstr "js表达式. 表达式的值需要能JSON序列化"

#~ msgid ""
#~ "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()`` 语法来进行调用。"

#~ msgid "``local`` usage"
#~ msgstr "local 支持的操作"
