# 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.2.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-05 00:44+0800\n"
"PO-Revision-Date: 2021-10-05 16:16+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"

#: of pywebio.pin:2
msgid "``pywebio.pin`` --- Persistent input"
msgstr "``pywebio.pin`` --- 持续性输入"

#: of pywebio.pin:4
msgid "*pin == Persistent input == Pinning input widget to the page*"
msgstr ""

#: of pywebio.pin:7
msgid "Overview"
msgstr ""

#: of pywebio.pin:9
msgid ""
"As you already know, the input function of PyWebIO is blocking and the input form will be destroyed after "
"successful submission. In most cases, it enough to use this way to get input. However in some cases, you may "
"want to make the input form **not** disappear after submission, and can continue to receive input."
msgstr ""
"我们已经知道，PyWebIO中的输入函数是阻塞式的，输入表单会在成功提交后被销毁。在大多数场景下，使用这种方式接收用"
"户输入已经够用了。但在一些场景下，你或许希望输入表单在提交后不消失，并且可以继续接收输入。"

#: of pywebio.pin:15
msgid "So PyWebIO provides the ``pin`` module to achieve persistent input by pinning input widgets to the page."
msgstr "所以，PyWebIO提供了 ``pin`` 模块来实现持续性输入。"

#: of pywebio.pin:17
msgid "The ``pin`` module achieves persistent input in 3 parts:"
msgstr "``pin`` 模块主要有3部分内容:"

#: of pywebio.pin:19
msgid ""
"First, this module provides some pin widgets. Pin widgets are not different from output widgets in ``pywebio."
"output`` module, besides that they can also receive input."
msgstr ""
"首先， ``pin`` 模块提供了一些 pin 组件(widgets)。Pin 组件和 ``pywebio.output`` 模块中的输出组件并没有什么不"
"同，只不过它还可以接收输入。"

#: of pywebio.pin:23
msgid "This code outputs an text input pin widget:"
msgstr "以下代码输出了一个最基本的文本框pin组件:"

#: of pywebio.pin:25
msgid "put_input('input', label='This is a input widget')"
msgstr ""

#: of pywebio.pin:31
msgid ""
"In fact, the usage of pin widget function is same as the output function. You can use it as part of the "
"combined output, or you can output pin widget to a scope:"
msgstr ""
"实际上, pin 组件函数的调用方式和输出函数是一致的，你可以将其作为组合输出的一部分, 也可以将其输出到某个scope中:"

#: of pywebio.pin:34
msgid ""
"put_row([\n"
"    put_input('input'),\n"
"    put_select('select', options=['A', 'B', 'C'])\n"
"])\n"
"\n"
"with use_scope('search-area'):\n"
"    put_input('search', placeholder='Search')"
msgstr ""

#: of pywebio.pin:46
msgid "Then, you can use the `pin` object to get the value of pin widget:"
msgstr "然后，你可以使用 `pin` 对象来获取pin组件的值："

#: of pywebio.pin:48
msgid ""
"put_input('pin_name')\n"
"put_buttons(['Get Pin Value'], lambda _: put_text(pin.pin_name))"
msgstr ""

#: of pywebio.pin:55
msgid ""
"The first parameter that the pin widget function receives is the name of the pin widget. You can get the "
"current value of the pin widget via the attribute of the same name of the `pin` object."
msgstr ""
"Pin组件函数的第一个参数为pin组件的 ``name`` 。你可以使用 `pin` 对象的同名属性来获取对应pin组件的当前值。"

#: of pywebio.pin:58
msgid ""
"In addition, the `pin` object also supports getting the value of the pin widget by index, that is to say::"
msgstr "另外， `pin` 对象同样支持以索引的方式获取pin组件的值，即::"

#: of pywebio.pin:60
msgid "pin['pin_name'] == pin.pin_name"
msgstr ""

#: of pywebio.pin:62
msgid "There are also two useful functions when you use the pin module: `pin_wait_change()` and `pin_update()`."
msgstr "Pin模块中还有两个有用的函数: `pin_wait_change()` 和 `pin_update()`。"

#: of pywebio.pin:64
msgid ""
"Since the pin widget functions is not blocking, `pin_wait_change()` is used to wait for the value of one of a "
"list of pin widget to change, it 's a blocking function."
msgstr ""
"由于pin组件输出函数是非阻塞的， 所以使用 `pin_wait_change()` 来等待一组pin组件的值发生变化，它是一个阻塞式函"
"数。"

#: of pywebio.pin:67
msgid "`pin_update()` can be used to update attributes of pin widgets."
msgstr "`pin_update()` 可以用来更新pin组件的输出属性。"

#: of pywebio.pin:70
msgid "Pin widgets"
msgstr ""

#: of pywebio.pin:71
msgid ""
"Each pin widget function corresponds to an input function of :doc:`input <./input>` module. (For performance "
"reasons, no pin widget for `file_upload() <pywebio.input.file_upload>` input function)"
msgstr ""
"每个pin组件函数都对应一个 :doc:`input <./input>` 模块中的输入函数。(出于性能原因，没有提供 `file_upload() "
"<pywebio.input.file_upload>` 函数对应的pin组件)"

#: of pywebio.pin:74
msgid ""
"The function of pin widget supports most of the parameters of the corresponding input function. Here lists "
"the difference between the two in parameters:"
msgstr "Pin组件函数支持大多数对应的输入函数的参数。这里列举了两者之间的一些不同："

#: of pywebio.pin:77
msgid ""
"The first parameter of pin widget function is always the name of the widget, and if you output two pin "
"widgets with the same name, the previous one will expire."
msgstr "Pin组件函数的第一个参数始终是Pin组件的 ``name`` ，且当输出了同名的pin组件时，旧的pin组件会不可用。"

#: of pywebio.pin:79
msgid ""
"Pin functions don't support the ``on_change`` and ``validate`` callbacks, and the ``required`` parameter."
msgstr "Pin组件函数不支持 ``on_change`` 、 ``validate`` 回调，也不支持 ``required`` 参数。"

#: of pywebio.pin:80
msgid "Pin functions have additional ``scope`` and ``position`` parameters for output control."
msgstr "Pin组件函数多了用于输出控制的 ``scope`` 和 ``position`` 参数。"

#: of pywebio.pin.put_input:1
msgid "Output an input widget. Refer to: `pywebio.input.input()`"
msgstr "输出一个文本输入组件。参见 `pywebio.input.input()`"

#: of pywebio.pin.put_textarea:1
msgid "Output a textarea widget. Refer to: `pywebio.input.textarea()`"
msgstr "输出一个文本域输入组件。参见 `pywebio.input.textarea()`"

#: of pywebio.pin.put_select:1
msgid "Output a select widget. Refer to: `pywebio.input.select()`"
msgstr "输出一个下拉选择输入组件。参见 `pywebio.input.select()`"

#: of pywebio.pin.put_checkbox:1
msgid "Output a checkbox widget. Refer to: `pywebio.input.checkbox()`"
msgstr "输出一个多选框组件。参见 `pywebio.input.checkbox()`"

#: of pywebio.pin.put_radio:1
msgid "Output a radio widget. Refer to: `pywebio.input.radio()`"
msgstr "输出一个单选按钮组件。参见 `pywebio.input.radio()`"

#: of pywebio.pin.put_slider:1
msgid "Output a slide widget. Refer to: `pywebio.input.slider()`"
msgstr "输出一个滑块输入组件。参见 `pywebio.input.slider()`"

#: of pywebio.pin.put_actions:1
msgid "Output a group of action button. Refer to: `pywebio.input.actions()`"
msgstr "输出一组action按钮。参见 `pywebio.input.actions()`"

#: of pywebio.pin.put_actions:3
msgid ""
"Unlike the ``actions()``, ``put_actions()`` won't submit any form, it will only set the value of the pin "
"widget. Only 'submit' type button is available in pin widget version."
msgstr ""
"不像 ``actions()` 函数，``put_actions()`` 不会提交任何表单，它只会设置pin组件的值。 ``put_actions()`` 只接受 "
"'submit' 类型的按钮。"

#: of pywebio.pin:91
msgid "Pin utils"
msgstr ""

#: of pywebio.pin:94
msgid "Pin widgets value getter and setter."
msgstr "获取与设置Pin组件的值"

#: of pywebio.pin:96
msgid ""
"You can use attribute or key index of ``pin`` object to get the current value of a pin widget. When accessing "
"the value of a widget that does not exist, it returns ``None`` instead of throwing an exception."
msgstr ""
"你可以使用属性或索引来从 ``pin`` 对象上获取pin组件的当前值。当访问不存在的pin组件时，会得到 ``None`` 而不会抛"
"出异常。"

#: of pywebio.pin:99
msgid "You can also use the ``pin`` object to set the value of pin widget:"
msgstr "还可以使用 ``pin`` 对象设置pin组件的值:"

#: of pywebio.pin:101
msgid ""
"import time  # ..demo-only\n"
"put_input('counter', type='number', value=0)\n"
"\n"
"while True:\n"
"    pin.counter = pin.counter + 1  # Equivalent to: pin['counter'] = pin['counter'] + 1\n"
"    time.sleep(1)"
msgstr ""

#: of pywebio.pin:112
msgid ""
"Note: When using :ref:`coroutine-based session <coroutine_based_session>`, you need to use the ``await pin."
"name`` (or ``await pin['name']``) syntax to get pin widget value."
msgstr ""
"注：当使用 :ref:`基于协程的会话 <coroutine_based_session>` 时，你需要使用 ``await pin.name`` (或 ``await "
"pin['name']``) 语法来获取pin组件的值。"

#: of pywebio.pin.pin_wait_change:1
msgid ""
"``pin_wait_change()`` listens to a list of pin widgets, when the value of any widgets changes, the function "
"returns with the name and value of the changed widget."
msgstr ""
"``pin_wait_change()`` 监听一组pin组件，当其中任意一个的值发生变化后，函数返回发生变化的组件的 ``name`` 和值。"

#: of pywebio.pin.pin_update pywebio.pin.pin_wait_change
msgid "Parameters"
msgstr ""

#: of pywebio.pin.pin_wait_change:4
msgid "List of names of pin widget"
msgstr "Pin组件 ``name`` 列表"

#: of pywebio.pin.pin_wait_change:5
msgid ""
"If ``timeout`` is a positive number, ``pin_wait_change()`` blocks at most ``timeout`` seconds and returns "
"``None`` if no changes to the widgets within that time. Set to ``None`` (the default) to disable timeout."
msgstr ""
"当 ``timeout`` 为正数时， ``pin_wait_change()`` 会最多阻塞 ``timeout`` 秒然后返回 ``None`` 如果这段时间内监听"
"的pin组件的值没有发生变化的话。 将 ``timeout`` 设置为 ``None`` （默认）来关闭超时。"

#: of pywebio.pin.pin_wait_change
msgid "return dict/None"
msgstr ""

#: of pywebio.pin.pin_wait_change:7
msgid ""
"``{\"name\": name of the changed widget, \"value\": current value of the changed widget }`` , when a timeout "
"occurs, return ``None``."
msgstr ""
"``{\"name\": 发生变化的pin组件的name, \"value\": 发生变化的pin组件的当前值}`` ， 当超时发生后，返回 ``None``"

#: of pywebio.pin.pin_wait_change:10
msgid "Example:"
msgstr ""

#: of pywebio.pin.pin_wait_change:12
#, python-format
msgid ""
"put_input('a', type='number', value=0)\n"
"put_input('b', type='number', value=0)\n"
"\n"
"while True:\n"
"    changed = pin_wait_change('a', 'b')\n"
"    with use_scope('res', clear=True):\n"
"        put_code(changed)\n"
"        put_text(\"a + b = %s\" % (pin.a + pin.b))"
msgstr ""

#: of pywebio.pin.pin_wait_change:25
msgid ""
":demo_host:`Here </markdown_previewer>` is an demo of using `pin_wait_change()` to make a markdown previewer."
msgstr ":demo_host:`这里 </markdown_previewer>` 有一个使用 `pin_wait_change()` 实现markdown实时预览的demo。"

#: of pywebio.pin.pin_wait_change:27
msgid ""
"Note that: updating value with the :data:`pin` object or `pin_update()` does not trigger `pin_wait_change()` "
"to return."
msgstr "注：使用 :data:`pin` 对象或 `pin_update()` 更新pin组件的值不会引发 `pin_wait_change()` 返回"

#: of pywebio.pin.pin_wait_change:30
msgid ""
"When using :ref:`coroutine-based session <coroutine_based_session>`, you need to use the ``await "
"pin_wait_change()`` syntax to invoke this function."
msgstr ""
"当使用 :ref:`基于协程的会话 <coroutine_based_session>` 时，你需要使用 ``await pin_wait_change()`` 语法来调用此"
"函数。"

#: of pywebio.pin.pin_update:1
msgid "Update attributes of pin widgets."
msgstr "更新pin组件的输出属性。"

#: of pywebio.pin.pin_update:3
msgid "The ``name`` of the target input widget."
msgstr "目标pin组件的 ``name`` 。"

#: of pywebio.pin.pin_update:4
msgid ""
"The pin widget parameters need to be updated. Note that those parameters can not be updated: ``type``, "
"``name``, ``code``, ``multiple``"
msgstr "需要被更新的pin组件的参数。注意以下参数无法被更新： ``type``, ``name``, ``code``, ``multiple``"

#~ msgid "The following is the difference between the two in parameters:"
#~ msgstr "以下为两者之间的一些不同:"
