# 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-02-17 01:11\n"
"PO-Revision-Date: 2013-02-17 01:52+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.4\n"

# 8487026bb92949c197608691e0682922
#: ../../recipes.rst:16
msgid "Recipes"
msgstr "秘诀"

# cfd0882653594f1eae8a9bef70324bc4
#: ../../recipes.rst:18
msgid ""
"This is a collection of code snippets and examples for common use cases."
msgstr "这里收集了一些常见用例的代码片段和例子."

# faa7771e7cda4492b891ae26152c932e
#: ../../recipes.rst:21
msgid "Keeping track of Sessions"
msgstr "使用Session"

# e3a652f4923841fbbdadcb5f3dc5f90d
#: ../../recipes.rst:23
msgid ""
"There is no built-in support for sessions because there is no *right* way to "
"do it (in a micro framework). Depending on requirements and environment you "
"could use beaker_ middleware with a fitting backend or implement it "
"yourself. Here is an example for beaker sessions with a file-based backend::"
msgstr ""
"Bottle自身并没有提供Session的支持，因为在一个迷你框架里面，没有合适的方法来实"
"现。根据需求和使用环境，你可以使用 beaker_ 中间件或自己来实现。下面是一个使用"
"beaker的例子，Session数据存放在\"./data\"目录里面::"

# a2d14fa0a98f44d4982d9d0b96fcbe80
#: ../../recipes.rst:46
msgid "Debugging with Style: Debugging Middleware"
msgstr "Debugging with Style: 调试中间件"

# 9cd203576e7043b484ee096450fed53d
#: ../../recipes.rst:48
msgid ""
"Bottle catches all Exceptions raised in your app code to prevent your WSGI "
"server from crashing. If the built-in :func:`debug` mode is not enough and "
"you need exceptions to propagate to a debugging middleware, you can turn off "
"this behaviour::"
msgstr ""
"Bottle捕获所有应用抛出的异常，防止异常导致WSGI服务器崩溃。如果内置的 :func:"
"`debug` 模式不能满足你的要求，你想在你自己写的中间件里面处理这些异常，那么你"
"可以关闭这个功能。"

# fbc746186f784972877b51c923365560
#: ../../recipes.rst:56
msgid ""
"Now, bottle only catches its own exceptions (:exc:`HTTPError`, :exc:"
"`HTTPResponse` and :exc:`BottleException`) and your middleware can handle "
"the rest."
msgstr ""
"现在，Bottle仅会捕获并处理它自己抛出的异常( :exc:`HTTPError` , :exc:"
"`HTTPResponse` 和 :exc:`BottleException` )，你的中间件可以处理剩下的那些异"
"常。"

# 36c1c52ece8c4f268a7dc278b274b829
#: ../../recipes.rst:58
msgid ""
"The werkzeug_ and paste_ libraries both ship with very powerful debugging "
"WSGI middleware. Look at :class:`werkzeug.debug.DebuggedApplication` for "
"werkzeug_ and :class:`paste.evalexception.middleware.EvalException` for "
"paste_. They both allow you do inspect the stack and even execute python "
"code within the stack context, so **do not use them in production**."
msgstr ""
"werkzeug_ 和 paste_ 这两个第三方库都提供了非常强大的调试中间件。如果是 "
"werkzeug_ ，可看看 :class:`werkzeug.debug.DebuggedApplication` ，如果是 "
"paste_ ，可看看 :class:`paste.evalexception.middleware.EvalException` 。它们"
"都可让你检查运行栈，甚至在保持运行栈上下文的情况下，执行Python代码。所以 **不"
"要在生产环境中使用它们** 。"

# 0bca874b50014d1aa55d3d5a122dad91
#: ../../recipes.rst:62
msgid "Unit-Testing Bottle Applications"
msgstr ""

# abb049c14147472ab7095e6a92438c68
#: ../../recipes.rst:64
msgid ""
"Unit-testing is usually performed against methods defined in your web "
"application without running a WSGI environment."
msgstr "Unit测试一般用于测试应用中的函数，但不需要一个WSGI环境。"

# 8db4441496bf46629c01f66929c54221
#: ../../recipes.rst:66
msgid "A simple example using `Nose <http://readthedocs.org/docs/nose>`_::"
msgstr "使用 `Nose <http://readthedocs.org/docs/nose>`_ 的简单例子。"

# 5215a5269ce1494b8bb619b73916b610
#: ../../recipes.rst:77
msgid "Test script::"
msgstr "测试代码::"

# 8fb6ca337895400991fdb334c3ef1659
#: ../../recipes.rst:84
msgid ""
"In the example the Bottle route() method is never executed - only index() is "
"tested."
msgstr "在这个例子中，Bottle的route()函数没有被执行，仅测试了index()函数。"

# 62f71facf6464ca68babf9bef0a0160a
#: ../../recipes.rst:88
msgid "Functional Testing Bottle Applications"
msgstr "功能测试"

# 39f2c3a094f84d1bb0974af018beaa6a
#: ../../recipes.rst:90
msgid ""
"Any HTTP-based testing system can be used with a running WSGI server, but "
"some testing frameworks work more intimately with WSGI, and provide the "
"ability the call WSGI applications in a controlled environment, with "
"tracebacks and full use of debugging tools. `Testing tools for WSGI <http://"
"www.wsgi.org/en/latest/testing.html>`_ is a good starting point."
msgstr ""
"任何基于HTTP的测试系统都可用于测试WSGI服务器，但是有些测试框架与WSGI服务器工"
"作得更好。它们可以在一个可控环境里运行WSGI应用，充分利用traceback和调试工"
"具。 `Testing tools for WSGI <http://www.wsgi.org/en/latest/testing.html>`_ "
"是一个很好的上手工具。"

# 56ee442ef6714be38dcf951e95112c22
#: ../../recipes.rst:92
msgid ""
"Example using `WebTest <http://webtest.pythonpaste.org/>`_ and `Nose <http://"
"readthedocs.org/docs/nose>`_::"
msgstr ""
"使用 `WebTest <http://webtest.pythonpaste.org/>`_ 和 `Nose <http://"
"readthedocs.org/docs/nose>`_ 的例子。"

# 58fd7a3ba2494e059ba1f0157788af13
#: ../../recipes.rst:112
msgid "Embedding other WSGI Apps"
msgstr "嵌入其他WSGI应用"

# 5f0f337aca4e43a6ac2ad2d8dcb771c0
#: ../../recipes.rst:114
msgid ""
"This is not the recommend way (you should use a middleware in front of "
"bottle to do this) but you can call other WSGI applications from within your "
"bottle app and let bottle act as a pseudo-middleware. Here is an example::"
msgstr ""
"并不建议你使用这个方法，你应该在Bottle前面使用一个中间件来做这样的事情。但你"
"确实可以在Bottle里面调用其他WSGI应用，让Bottle扮演一个中间件的角色。下面是一"
"个例子。"

# a196f1d227dd4d5fbc2ad6f293b24b0e
#: ../../recipes.rst:130
msgid ""
"Again, this is not the recommend way to implement subprojects. It is only "
"here because many people asked for this and to show how bottle maps to WSGI."
msgstr ""
"再次强调，并不建议使用这种方法。之所以介绍这种方法，是因为很多人问起，如何在"
"Bottle中调用WSGI应用。"

# f25d4e33503c43148073e9f81decbf72
#: ../../recipes.rst:134
msgid "Ignore trailing slashes"
msgstr "忽略尾部的反斜杠"

# d28129334ef24183a739ec177f3a322a
#: ../../recipes.rst:136
msgid ""
"For Bottle, ``/example`` and ``/example/`` are two different routes [1]_. To "
"treat both URLs the same you can add two ``@route`` decorators::"
msgstr ""
"在Bottle看来， ``/example`` 和 ``/example/`` 是两个不同的route [1]_ 。为了一"
"致对待这两个URL，你应该添加两个route。"

# 2a6abd0a87e24a6e92fef547a4e3f0b4
#: ../../recipes.rst:142
msgid "or add a WSGI middleware that strips trailing slashes from all URLs::"
msgstr "或者添加一个WSGI中间件来处理这种情况。"

# ff6aaa5c70994fa3955888819121dfa3
#: ../../recipes.rst:156
msgid "Footnotes"
msgstr "脚注"

# 81148a89616b4d358ace32d79e576043
#: ../../recipes.rst:157
msgid "Because they are. See <http://www.ietf.org/rfc/rfc3986.txt>"
msgstr "因为确实如此，见 <http://www.ietf.org/rfc/rfc3986.txt>"

# 33f68df31e094ac2b967015004250f28
#: ../../recipes.rst:161
msgid "Keep-alive requests"
msgstr "Keep-alive 请求"

# 548edbc8dabe4ce4a00458bd74d72d74
#: ../../recipes.rst:165
msgid "For a more detailed explanation, see :doc:`async`."
msgstr "详见 :doc:`async` 。"

# 1ab0b644d6da4fcf943b67f77b19c330
#: ../../recipes.rst:167
msgid ""
"Several \"push\" mechanisms like XHR multipart need the ability to write "
"response data without closing the connection in conjunction with the "
"response header \"Connection: keep-alive\". WSGI does not easily lend itself "
"to this behavior, but it is still possible to do so in Bottle by using the "
"gevent_ async framework. Here is a sample that works with either the gevent_ "
"HTTP server or the paste_ HTTP server (it may work with others, but I have "
"not tried). Just change ``server='gevent'`` to ``server='paste'`` to use the "
"paste_ server::"
msgstr ""
"像XHR这样的\"push\"机制，需要在HTTP响应头中加入 \"Connection: keep-alive\" ，"
"以便在不关闭连接的情况下，写入响应数据。WSGI并不支持这种行为，但如果在Bottle"
"中使用 gevent_ 这个异步框架，还是可以实现的。下面是一个例子，可配合 gevent_ "
"HTTP服务器或 paste_ HTTP服务器使用(也许支持其他服务器，但是我没试过)。在run()"
"函数里面使用 ``server='gevent'`` 或 ``server='paste'`` 即可使用这两种服务器。"

# c7a5e20a91054b07ae82effa317c5b34
#: ../../recipes.rst:184
msgid ""
"If you browse to ``http://localhost:8080/stream``, you should see 'START', "
"'MIDDLE', and 'END' show up one at a time (rather than waiting 8 seconds to "
"see them all at once)."
msgstr ""
"通过浏览器访问 ``http://localhost:8080/stream`` ，可看到'START'，'MIDDLE'，"
"和'END'这三个字眼依次出现，一共用了8秒。"

# fef7a41bbeb84056b2c0cd48f54b78bc
#: ../../recipes.rst:187
msgid "Gzip Compression in Bottle"
msgstr "Gzip压缩"

# cc030b164fa1422fbb0e7c605479a883
#: ../../recipes.rst:190
msgid "For a detailed discussion, see compression_"
msgstr "详见 compression_"

# a0873b5a4e4c4c71937843850c69f371
#: ../../recipes.rst:192
msgid ""
"A common feature request is for Bottle to support Gzip compression, which "
"speeds up sites by compressing static resources (like CSS and JS files) "
"during a request."
msgstr ""
"Gzip压缩，可加速网站静态资源(例如CSS和JS文件)的访问。人们希望Bottle支持Gzip压"
"缩，（但是不支持)......"

# 0cfc5b1cfe7b4f9a90907a25fd6655ca
#: ../../recipes.rst:194
msgid ""
"Supporting Gzip compression is not a straightforward proposition, due to a "
"number of corner cases that crop up frequently. A proper Gzip implementation "
"must:"
msgstr "支持Gzip压缩并不简单，一个合适的Gzip实现应该满足以下条件。"

# 43396b35b1eb43d0875bc745e4adbb6e
#: ../../recipes.rst:196
msgid "Compress on the fly and be fast doing so."
msgstr "压缩速度要快"

# 65c1fd4a55404e008c4a06f0666ab9a8
#: ../../recipes.rst:197
msgid "Do not compress for browsers that don't support it."
msgstr "如果浏览器不支持，则不压缩"

# 73e6653b779e443f9edfc0ec0bfffece
#: ../../recipes.rst:198
msgid "Do not compress files that are compressed already (images, videos)."
msgstr "不压缩那些已经充分压缩的文件(图像，视频)"

# b4c5eaedfa1843deb7bed64b690da0df
#: ../../recipes.rst:199
msgid "Do not compress dynamic files."
msgstr "不压缩动态文件"

# dcf512d9530e4c0a9f82b8b6acef1d99
#: ../../recipes.rst:200
msgid "Support two differed compression algorithms (gzip and deflate)."
msgstr "支持两种压缩算法(gzip和deflate)"

# 8f7b2d1ea78c4c54ad76f0c6e45c4b2c
#: ../../recipes.rst:201
msgid "Cache compressed files that don't change often."
msgstr "缓存那些不经常变化的压缩文件"

# 6a123a9ffb9d404c97b6fe7148082cc8
#: ../../recipes.rst:202
msgid "De-validate the cache if one of the files changed anyway."
msgstr ""
"不验证缓存中那些已经变化的文件(De-validate the cache if one of the files "
"changed anyway)"

# 31ba480ff2e64ac8809f2b5a8ba4d84f
#: ../../recipes.rst:203
msgid "Make sure the cache does not get to big."
msgstr "确保缓存不太大"

# 9cca12e96a2a46d1b0f50d0e191527a4
#: ../../recipes.rst:204
msgid ""
"Do not cache small files because a disk seek would take longer than on-the-"
"fly compression."
msgstr "不缓存小文件，因为寻道时间或许比压缩时间还长"

# fd7d6ff9d37f43a48ccaf1153bb6abbf
#: ../../recipes.rst:206
msgid ""
"Because of these requirements, it is the recommendation of the Bottle "
"project that Gzip compression is best handled by the WSGI server Bottle runs "
"on top of. WSGI servers such as cherrypy_ provide a GzipFilter_ middleware "
"that can be used to accomplish this."
msgstr ""
"因为有上述种种限制，建议由WSGI服务器来处理Gzip压缩而不是Bottle。像 cherrypy_ "
"就提供了一个 GzipFilter_ 中间件来处理Gzip压缩。"

# fa5e82e498e34c77bf4ce53402982640
#: ../../recipes.rst:210
msgid "Using the hooks plugin"
msgstr "使用钩子"

# 69f3eb65c7424b8fa5fafc5bbd19c280
#: ../../recipes.rst:212
msgid ""
"For example, if you want to allow Cross-Origin Resource Sharing for the "
"content returned by all of your URL, you can use the hook decorator and "
"setup a callback function::"
msgstr "例如，你想提供跨域资源共享，可参考下面的例子。"

# 27f25eeca0c140c881b5a82396063aaa
#: ../../recipes.rst:230
msgid ""
"You can also use the ``before_request`` to take an action before every "
"function gets called."
msgstr ""
"你也可以使用 ``before_request`` ，这样在route的回调函数被调用之前，都会调用你"
"的钩子函数。"

# 5882be32dd4040c8a642ff5f40a20229
#: ../../recipes.rst:235
msgid "Using Bottle with Heroku"
msgstr "在Heroku中使用Bottle"

# 2800373fd0754dc4adc7ebbb487dcdc3
#: ../../recipes.rst:237
msgid ""
"Heroku_, a popular cloud application platform now provides support for "
"running Python applications on their infastructure."
msgstr "Heroku_ ，一个流行的云应用平台，提供Python支持。"

# 6aa7d15dbd67437aad2028d56dae34f7
#: ../../recipes.rst:240
msgid ""
"This recipe is based upon the `Heroku Quickstart <http://devcenter.heroku."
"com/articles/quickstart>`_, with Bottle specific code replacing the `Write "
"Your App <http://devcenter.heroku.com/articles/python#write_your_app>`_ "
"section of the `Getting Started with Python on Heroku/Cedar <http://"
"devcenter.heroku.com/articles/python>`_ guide::"
msgstr ""
"这份教程基于 `Heroku Quickstart <http://devcenter.heroku.com/articles/"
"quickstart>`_, 用Bottle特有的代码替换了 `Getting Started with Python on "
"Heroku/Cedar <http://devcenter.heroku.com/articles/python>`_ 中的`Write Your "
"App <http://devcenter.heroku.com/articles/python#write_your_app>`_ 这部分::"

# 526acffa7fd4482db514db6e6da16ee5
#: ../../recipes.rst:256
msgid ""
"Heroku's app stack passes the port that the application needs to listen on "
"for requests, using the `os.environ` dictionary."
msgstr "Heroku使用 `os.environ` 字典来提供Bottle应用需要监听的端口。"
