# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2009-2012, Marcel Hellkamp
# This file is distributed under the same license as the Bottle package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Bottle 0.12-dev\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-08-09 17:22\n"
"PO-Revision-Date: 2013-04-20 16:43+0800\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.5\n"

# 5fc6bab7b7204b6ca1f300b3b00efa24
#: ../../stpl.rst:3
msgid "SimpleTemplate Engine"
msgstr "SimpleTemplate 模板引擎"

# 2d5c4dee0d97442daf778fcc0790930d
#: ../../stpl.rst:7
msgid ""
"Bottle comes with a fast, powerful and easy to learn built-in template "
"engine called *SimpleTemplate* or *stpl* for short. It is the default engine "
"used by the :func:`view` and :func:`template` helpers but can be used as a "
"stand-alone general purpose template engine too. This document explains the "
"template syntax and shows examples for common use cases."
msgstr ""
"Bottle自带了一个快速，强大，易用的模板引擎，名为 *SimpleTemplate* 或简称为 "
"*stpl* 。它是 :func:`view` 和 :func:`template` 两个函数默认调用的模板引擎。接"
"下来会介绍该引擎的模板语法和一些常见用例。"

# a3590cf972a44a07996a3cffabbaaf17
#: ../../stpl.rst:10
msgid "Basic API Usage:"
msgstr "基础API :"

# 2957a430c3f0401cb93c6a495696ee0f
#: ../../stpl.rst:11
msgid ":class:`SimpleTemplate` implements the :class:`BaseTemplate` API::"
msgstr ":class:`SimpleTemplate` 类实现了 :class:`BaseTemplate` 接口"

# 76093537f2404ef1bed6a7669a33ea85
#: ../../stpl.rst:18
msgid ""
"In this document we use the :func:`template` helper in examples for the sake "
"of simplicity::"
msgstr "简单起见，我们在例子中使用 :func:`template` 函数"

# f8681cd955714e8689971c9d04ca50db
#: ../../stpl.rst:24
msgid ""
"Just keep in mind that compiling and rendering templates are two different "
"actions, even if the :func:`template` helper hides this fact. Templates are "
"usually compiled only once and cached internally, but rendered many times "
"with different keyword arguments."
msgstr ""
"注意，编译模板和渲染模板是两件事情，尽管 :func:`template` 函数隐藏了这一事"
"实。通常，模板只会被编译一次，然后会被缓存起来，但是会根据不同的参数，被多次"
"渲染。"

# dbbbb8f7a9f44a509c6679a8530ded31
#: ../../stpl.rst:27
msgid ":class:`SimpleTemplate` Syntax"
msgstr ":class:`SimpleTemplate` 的语法"

# ceece3998fa24734ae64c9830b09a271
#: ../../stpl.rst:29
msgid ""
"Python is a very powerful language but its whitespace-aware syntax makes it "
"difficult to use as a template language. SimpleTemplate removes some of "
"these restrictions and allows you to write clean, readable and maintainable "
"templates while preserving full access to the features, libraries and speed "
"of the Python language."
msgstr ""
"虽然Python是一门强大的语言，但它对空白敏感的语法令其很难作为一个模板语言。"
"SimpleTemplate移除了一些限制，允许你写出干净的，有可读性的，可维护的模板，且"
"保留了Python的强大功能。"

# 5a7cdb21e3fc428880cf986470fc17b8
#: ../../stpl.rst:33
msgid ""
"The :class:`SimpleTemplate` syntax compiles directly to python bytecode and "
"is executed on each :meth:`SimpleTemplate.render` call. Do not render "
"untrusted templates! They may contain and execute harmful python code."
msgstr ""
" :class:`SimpleTemplate` 模板会被编译为Python字节码，且在每次通过 :meth:"
"`SimpleTemplate.render` 渲染的时候执行。请不要渲染不可靠的模板！它们也许包含"
"恶意代码。"

# a95aa9022b2d4506aa82abe27d1a6c54
#: ../../stpl.rst:36
msgid "Inline Expressions"
msgstr "内嵌表达式"

# f6b4616dd997461dbbc1ef9592dd8c0c
#: ../../stpl.rst:38
msgid ""
"You already learned the use of the ``{{...}}`` syntax from the \"Hello World!"
"\" example above, but there is more: any python expression is allowed within "
"the curly brackets as long as it returns a string or something that has a "
"string representation::"
msgstr ""
"你已经在上面的\"Hello World!\"例子中学习到了 ``{{...}}`` 语句的用法。只要在 "
"``{{...}}`` 中的Python语句返回一个字符串或有一个字符串的表达形式，它就是一个"
"有效的语句。"

# af95d092b454488a870691b150c8d99b
#: ../../stpl.rst:47
msgid ""
"The contained python expression is executed at render-time and has access to "
"all keyword arguments passed to the :meth:`SimpleTemplate.render` method. "
"HTML special characters are escaped automatically to prevent `XSS <http://en."
"wikipedia.org/wiki/Cross-Site_Scripting>`_ attacks. You can start the "
"expression with an exclamation mark to disable escaping for that expression::"
msgstr ""
"{{}}中的Python语句会在渲染的时候被执行，可访问传递给 :meth:`SimpleTemplate."
"render` 方法的所有参数。默认情况下，自动转义HTML标签以防止 `XSS <http://en."
"wikipedia.org/wiki/Cross-Site_Scripting>`_ 攻击。可在语句前加上\"!\"来关闭自"
"动转义。"

# 219189873cc441e6b70064bac98d4269
#: ../../stpl.rst:57
msgid "Embedded python code"
msgstr "嵌入Pyhton代码"

# 219eaf58440a432d822e7ae0c7d34856
#: ../../stpl.rst:59
msgid ""
"The ``%`` character marks a line of python code. The only difference between "
"this and real python code is that you have to explicitly close blocks with "
"an ``%end`` statement. In return you can align the code with the surrounding "
"template and don't have to worry about correct indentation of blocks. The "
"*SimpleTemplate* parser handles that for you. Lines *not* starting with a ``"
"%`` are rendered as text as usual::"
msgstr ""
"一行以 ``%`` 开头，表明这一行是Python代码。它和真正的Python代码唯一的区别，在"
"于你需要显式地在末尾添加 ``%end`` 语句，表明一个代码块结束。这样你就不必担心"
"Python代码中的缩进问题， *SimpleTemplate* 模板引擎的parser帮你处理了。不以 ``"
"%`` 开头的行，被当作普通文本来渲染::"

# 835cfd3f9abb473295acd970b1d4db48
#: ../../stpl.rst:67
msgid ""
"The ``%`` character is only recognised if it is the first non-whitespace "
"character in a line. To escape a leading ``%`` you can add a second one. ``%"
"%`` is replaced by a single ``%`` in the resulting template::"
msgstr "只有在行首的 ``%`` 字符才有意义，可以使用 ``%%`` 来转义。"

# 186f77670bf845e88d2b1e2b9cc088e2
#: ../../stpl.rst:74
msgid "Suppressing line breaks"
msgstr "防止换行"

# ae704a6087814ba783495f1313adccb2
#: ../../stpl.rst:76
msgid ""
"You can suppress the line break in front of a code-line by adding a double "
"backslash at the end of the line::"
msgstr "你可以在一行代码前面加上 ``\\`` 来防止换行 ::"

# 6a8217b810154fd49c6953739042465b
#: ../../stpl.rst:84
msgid "This template produces the following output::"
msgstr "该模板的输出::"

# 47b3b914fe874add85a570309194581b
#: ../../stpl.rst:89
msgid "The ``%include`` Statement"
msgstr "``%include`` 语句"

# e7434e79b2724e0aba6628a54f4805c2
#: ../../stpl.rst:91
msgid ""
"You can include other templates using the ``%include sub_template [kwargs]`` "
"statement. The ``sub_template`` parameter specifies the name or path of the "
"template to be included. The rest of the line is interpreted as a comma-"
"separated list of ``key=statement`` pairs similar to keyword arguments in "
"function calls. They are passed to the sub-template analogous to a :meth:"
"`SimpleTemplate.render` call. The ``**kwargs`` syntax for passing a dict is "
"allowed too::"
msgstr ""
"你可以使用 ``%include sub_template [kwargs]`` 语句来包含其他模板。 "
"``sub_template`` 参数是模板的文件名或路径。 ``[kwargs]`` 部分是以逗号分开的键"
"值对，是传给其他模板的参数。 ``**kwargs`` 这样的语法来传递一个字典也是允许"
"的。"

# 335f7d7ba9d54925848f7ab73133604d
#: ../../stpl.rst:98
msgid "The ``%rebase`` Statement"
msgstr "``%rebase`` 语句"

# febe4bbe39794c80b091f79785cc296b
#: ../../stpl.rst:100
msgid ""
"The ``%rebase base_template [kwargs]`` statement causes ``base_template`` to "
"be rendered instead of the original template. The base-template then "
"includes the original template using an empty ``%include`` statement and has "
"access to all variables specified by ``kwargs``. This way it is possible to "
"wrap a template with another template or to simulate the inheritance feature "
"found in some other template engines."
msgstr ""
"``%rebase base_template [kwargs]`` 语句会渲染 ``base_template`` 这个模板，而"
"不是原先的模板。然后base_template中使用一个空 ``%include`` 语句来包含原先的模"
"板，并可访问所有通过 ``kwargs`` 传过来的参数。这样就可以使用模板来封装另一个"
"模板，或者是模拟某些模板引擎中的继承机制。"

# 8ef160400e504cbfabc0c5d6f9992175
#: ../../stpl.rst:102
msgid ""
"Let's say you have a content template and want to wrap it with a common HTML "
"layout frame. Instead of including several header and footer templates, you "
"can use a single base-template to render the layout frame."
msgstr ""
"让我们假设，你现在有一个与内容有关的模板，想在它上面加上一层普通的HTML层。为"
"了避免include一堆模板，你可以使用一个基础模板。"

# 7ad4a7d8bf22490c8c84d8c963eb6c0f
#: ../../stpl.rst:104
msgid "Base-template named ``layout.tpl``::"
msgstr "名为 ``layout.tpl`` 的基础模板::"

# 9879a17dc3e545fd95469706cb53f265
#: ../../stpl.rst:115
msgid "Main-template named ``content.tpl``::"
msgstr "名为 ``content.tpl`` 的主模板"

# cfcf68af997a4c0db33ab9ea5b5e797a
#: ../../stpl.rst:120
msgid "Now you can render ``content.tpl``:"
msgstr "渲染 ``content.tpl``"

# d233dcb3a966484887e6ad8887c8588f
#: ../../stpl.rst:137
msgid ""
"A more complex scenario involves chained rebases and multiple content "
"blocks. The ``block_content.tpl`` template defines two functions and passes "
"them to a ``columns.tpl`` base template::"
msgstr ""
"一个更复杂的使用场景involves chained rebases and multiple content blocks. "
"``block_content.tpl`` 模板定义了两个函数，然后将它们传给 ``columns.tpl`` 这个"
"基础模板。"

# 090e914a15304125b733012a3e3fae5b
#: ../../stpl.rst:147
msgid ""
"The ``columns.tpl`` base-template uses the two callables to render the "
"content of the left and right column. It then wraps itself with the ``layout."
"tpl`` template defined earlier::"
msgstr ""
"``columns.tpl`` 这个基础模板使用两个callable(译者注：Python中除了函数是"
"callable的，类也可以是callable的，在这个例子里，是函数)来渲染分别位于左边和右"
"边的两列。然后将其自身封装在之前定义的 ``layout.tpl`` 模板里面。"

# 3e003ecb08ac4ebbb458ce62560fbacd
#: ../../stpl.rst:157
msgid "Lets see how ``block_content.tpl`` renders:"
msgstr "让我们看一看 ``block_content.tpl`` 模板的输出"

# 567b6630a554497e8cc365713174f327
#: ../../stpl.rst:180
msgid "Namespace Functions"
msgstr "模板内置函数 (Namespace Functions)"

# 009fc91a499645c59e164feb6071b248
#: ../../stpl.rst:182
msgid ""
"Accessing undefined variables in a template raises :exc:`NameError` and "
"stops rendering immediately. This is standard python behavior and nothing "
"new, but vanilla python lacks an easy way to check the availability of a "
"variable. This quickly gets annoying if you want to support flexible inputs "
"or use the same template in different situations. SimpleTemplate helps you "
"out here: The following three functions are defined in the default namespace "
"and accessible from anywhere within a template:"
msgstr ""
"在模板中访问一个未定义的变量会导致 :exc:`NameError` 异常，并立即终止模板的渲"
"染。这是Python的正常行为，并不奇怪。在抛出异常之前，你无法检查变量是否被定"
"义。这在你想让输入更灵活，或想在不同情况下使用同一个模板的时候，就很烦人了。"
"SimpleTemplate模板引擎内置了三个函数来帮你解决这个问题，可以在模板的任何地方"
"使用它们。"

# 51e90c2ce045474e87e5572855d05b09
#: ../../stpl.rst:194
msgid ""
"Return True if the variable is defined in the current template namespace, "
"False otherwise."
msgstr "如果变量已定义则返回True，反之返回False。"

# a5092292ca484cc4b5ddcdedd084c3ce
#: ../../stpl.rst:199
msgid "Return the variable, or a default value."
msgstr "返回该变量，或一个默认值"

# df4a180859de40b3992e693b92335898
#: ../../stpl.rst:203
msgid ""
"If the variable is not defined, create it with the given default value. "
"Return the variable."
msgstr "如果该变量未定义，则定义它，赋一个默认值，返回该变量"

# 99ab3af3116143cb81482d94e2765d4f
#: ../../stpl.rst:206
msgid ""
"Here is an example that uses all three functions to implement optional "
"template variables in different ways::"
msgstr "下面是使用了这三个函数的例子，实现了模板中的可选参数。"

# 9d5e28dff3aa46608cf5025c2a4da88b
#: ../../stpl.rst:220
msgid ":class:`SimpleTemplate` API"
msgstr ":class:`SimpleTemplate` API"

# ba13c2fdbe9d454282446d03080fb37b
#: ../../../bottle.py:docstring of bottle.SimpleTemplate.render:1
msgid "Render the template using keyword arguments as local variables."
msgstr ""

# 49cff8297b4f4092914eae820141d229
#: ../../stpl.rst:226
msgid "Known bugs"
msgstr "已知Bug"

# ca8cb753300042ed8d4dd7d554c04924
#: ../../stpl.rst:228
msgid ""
"Some syntax constructions allowed in python are problematic within a "
"template. The following syntaxes won't work with SimpleTemplate:"
msgstr "不兼容某些Python语法,例子如下:"

# fe81e27342e04c18b17a9f1fdb7eacb8
#: ../../stpl.rst:230
msgid ""
"Multi-line statements must end with a backslash (``\\``) and a comment, if "
"present, must not contain any additional ``#`` characters."
msgstr ""
"多行语句语句必须以 ``\\`` 结束, 如果出现了注释, 则不能再包含其他 ``#`` 字符."

# 404c1aa1c5d4489688aaeeeb8abfdff1
#: ../../stpl.rst:231
msgid "Multi-line strings are not supported yet."
msgstr "不支持多行字符串"

# 1db7677ae77c44f4ae0d6e63772af22e
#~ msgid "Removes comments (#...) from python code."
#~ msgstr "从python代码中去除注释(#...)"
