# 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: 2012-11-09 16:09+0800\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\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"

# 537f3d5bfa4d4be08a712f4f7175e73a
#: ../../routing.rst:3
msgid "Request Routing"
msgstr "URL映射"

# 38a02f16d2ac46c8ad2167320cb71856
#: ../../routing.rst:5
msgid ""
"Bottle uses a powerful routing engine to find the right callback for each "
"request. The :ref:`tutorial <tutorial-routing>` shows you the basics. This "
"document covers advanced techniques and rule mechanics in detail."
msgstr ""
"Bottle内置一个强大的route引擎，可以给每个浏览器请求找到正确的回调函数。 :ref:"
"`tutorial <tutorial-routing>` 中已经介绍了一些基础知识。接下来是一些进阶知识"
"和route的规则。"

# d5bcbcf2c51c4aed93a005830610b16e
#: ../../routing.rst:8
msgid "Rule Syntax"
msgstr "route的语法"

# 5731b172abca42c18ddae8b9338c0db8
#: ../../routing.rst:10
msgid ""
"The :class:`Router` distinguishes between two basic types of routes: "
"**static routes** (e.g. ``/contact``) and **dynamic routes** (e.g. ``/hello/"
"<name>``). A route that contains one or more *wildcards* it is considered "
"dynamic. All other routes are static."
msgstr ""
":class:`Router` 类中明确区分两种类型的route： **静态route** (例如 ``/"
"contact`` )和 **动态route** (例如 ``/hello/<name>`` )。包含了 *通配符* 的"
"route即是动态route，除此之外的都是静态的。"

# 4fb306e63b844e86b7bd02f84f79496c
#: ../../routing.rst:14
msgid ""
"The simplest form of a wildcard consists of a name enclosed in angle "
"brackets (e.g. ``<name>``). The name should be unique for a given route and "
"form a valid python identifier (alphanumeric, starting with a letter). This "
"is because wildcards are used as keyword arguments for the request callback "
"later."
msgstr ""
"包含通配符，最简单的形式就是将其放到一对<>里面(例如 ``<name>`` )。在同一个"
"route里面，这个变量名需要是唯一的。因为稍后会将其当作参数传给回调函数，所以这"
"个变量名的第一个字符应该是字母。"

# 8f5cfd74cc954f25a6343efe2af186f2
#: ../../routing.rst:16
msgid ""
"Each wildcard matches one or more characters, but stops at the first slash "
"(``/``). This equals a regular expression of ``[^/]+`` and ensures that only "
"one path segment is matched and routes with more than one wildcard stay "
"unambiguous."
msgstr ""
"每一个通配符匹配一个或多个字符，直到遇到 ``/`` 。类似于 ``[^/]+`` 这样一个正"
"则表达式，确保在route包含多个通配符的时候不出现歧义。"

# 4995515dd3614738adead1dfdc1e21d1
#: ../../routing.rst:18
msgid "The rule ``/<action>/<item>`` matches as follows:"
msgstr "``/<action>/<item>`` 这个规则匹配的情况如下"

# 360827cedc9d41e780960b5898bb411a
#: ../../routing.rst:21
msgid "Path"
msgstr "路径"

# 936e7668dd0d428c969ba695167d7ad0
#: ../../routing.rst:21
msgid "Result"
msgstr "结果"

# 6cb05a32a5ba4c9c80fccf2ebf3feb55
#: ../../routing.rst:23
msgid "/save/123"
msgstr ""

# db0ca094c764454ba849802125c154d0
#: ../../routing.rst:23
msgid "``{'action': 'save', 'item': '123'}``"
msgstr ""

# 07aed175dbd64f62b841c4a0641efd4a
#: ../../routing.rst:24
msgid "/save/123/"
msgstr ""

# b13e940c425e4a7fb9862bff885e1379
# 4edcee5dd1104375afb1609664f60df6
# dcc8aeb405894ddf8386b936b2758388
#: ../../routing.rst:24 ../../routing.rst:25 ../../routing.rst:26
msgid "`No Match`"
msgstr "不匹配"

# e9c41614ba83410f9ac0ceaea8c6a162
#: ../../routing.rst:25
msgid "/save/"
msgstr ""

# bb2bc503fab04bd1bf9df0cb0dbce8e5
#: ../../routing.rst:26
msgid "//123"
msgstr ""

# c4f0ba8b334445cbb018b7df7a08ff82
#: ../../routing.rst:29
msgid ""
"You can change the exact behaviour in many ways using filters. This is "
"described in the next section."
msgstr "你可通过过滤器来改变这一行为，稍后会介绍。"

# da4ca1ab94694467b37e1ccae2f43873
#: ../../routing.rst:32
msgid "Wildcard Filters"
msgstr "通配符过滤器"

# 841d41d86e4848a49c1adddb668a0eac
#: ../../routing.rst:36
msgid ""
"Filters are used to define more specific wildcards, and/or transform the "
"matched part of the URL before it is passed to the callback. A filtered "
"wildcard is declared as ``<name:filter>`` or ``<name:filter:config>``. The "
"syntax for the optional config part depends on the filter used."
msgstr ""
"过滤器被用于定义更特殊的通配符，可在URL中\"被匹配到的部分\"被传递给回调函数之"
"前，处理其内容。可通过 ``<name:filter>`` 或 ``<name:filer:config>`` 这样的语"
"句来声明一个过滤器。\"config\"部分的语法由被使用的过滤器决定。"

# 4546a3f376d6472299ea23de51c86fb2
#: ../../routing.rst:38
msgid "The following standard filters are implemented:"
msgstr "Bottle中已实现以下过滤器:"

# 9649286b48c846909d6837918e4afe22
#: ../../routing.rst:40
msgid "**:int** matches (signed) digits and converts the value to integer."
msgstr "**:int** 匹配一个整形数，并将其转换为int"

# 1fd36dafc30a444294ef178e778a6c9b
#: ../../routing.rst:41
msgid "**:float** similar to :int but for decimal numbers."
msgstr "**:float** 同上，匹配一个浮点数"

# 44c9df4f4cda41fabd0dd204d6ef6ccb
#: ../../routing.rst:42
msgid ""
"**:path** matches all characters including the slash character in a non-"
"greedy way and may be used to match more than one path segment."
msgstr "**:path** 匹配所有字符，包括'/'"

# 6d04d52e808847ddbc4856bcd9c83741
#: ../../routing.rst:43
msgid ""
"**:re[:exp]** allows you to specify a custom regular expression in the "
"config field. The matched value is not modified."
msgstr "**:re[:exp]** 允许在exp中写一个正则表达式"

# a60af85c82874c5e960dd90455b2882e
#: ../../routing.rst:45
msgid ""
"You can add your own filters to the router. All you need is a function that "
"returns three elements: A regular expression string, a callable to convert "
"the URL fragment to a python value, and a callable that does the opposite. "
"The filter function is called with the configuration string as the only "
"parameter and may parse it as needed::"
msgstr ""
"你可在route中添加自己写的过滤器。过滤器是一个有三个返回值的函数：一个正则表达"
"式，一个callable的对象(转换URL片段为Python对象)，另一个callable对象(转换"
"Python对象为URL片段)。过滤器仅接受一个参数，就是设置字符串(译者注：例如re过滤"
"器的exp部分)。"

# f92df6b1308c4b03856c4a086a7f2dd1
#: ../../routing.rst:71
msgid "Legacy Syntax"
msgstr "旧语法"

# b105532cd9db4a2d81e6f7dd0d0f9f52
#: ../../routing.rst:75
msgid ""
"The new rule syntax was introduce in **Bottle 0.10** to simplify some common "
"use cases, but the old syntax still works and you can find lot code examples "
"still using it. The differences are best described by example:"
msgstr ""
"在 **Bottle 0.10** 版本中引入了新的语法，来简单化一些常见用例，但依然兼容旧的"
"语法。新旧语法的区别如下。"

# 0f54e0bcc13c4c779b5c463dc38e9764
#: ../../routing.rst:78
msgid "Old Syntax"
msgstr "旧语法"

# 8d2fdc1e4e31450d939aa14c9b6ec038
#: ../../routing.rst:78
msgid "New Syntax"
msgstr "新语法"

# dfcd81acea5746aaa54619b1869735a3
#: ../../routing.rst:80
msgid "``:name``"
msgstr ""

# 0fc15b4c779d418a9bb3491821d15bbf
#: ../../routing.rst:80
msgid "``<name>``"
msgstr ""

# 6844e4035cbe487397c7d1ce0daaa376
#: ../../routing.rst:81
msgid "``:name#regexp#``"
msgstr ""

# 578c280850204789b9ac06383e5c6835
#: ../../routing.rst:81
msgid "``<name:re:regexp>``"
msgstr ""

# 1e17245e5d634d658365fef94c51b494
#: ../../routing.rst:82
msgid "``:#regexp#``"
msgstr ""

# 4927c487703e4e4a81e3e16d4e0d17e7
#: ../../routing.rst:82
msgid "``<:re:regexp>``"
msgstr ""

# 6788154d67da4210ba2a49d9f4d27a8c
#: ../../routing.rst:83
msgid "``:##``"
msgstr ""

# 7c26c9d95ce14f6c8412d5809de5928d
#: ../../routing.rst:83
msgid "``<:re>``"
msgstr ""

# 2f5886822d674eb9a42febdb5872a30f
#: ../../routing.rst:86
msgid ""
"Try to avoid the old syntax in future projects if you can. It is not "
"currently deprecated, but will be eventually."
msgstr "请尽量在新项目中避免使用旧的语法，虽然它现在还没被废弃，但终究会的。"

# 37c609a0f4764f848e31917094d031be
#: ../../routing.rst:91
msgid "Explicit routing configuration"
msgstr "显式的route配置"

# 77437235365e4d40943f7fa62801f7c1
#: ../../routing.rst:93
msgid ""
"Route decorator can also be directly called as method. This way provides "
"flexibility in complex setups, allowing you to directly control, when and "
"how routing configuration done."
msgstr ""
"route修饰器也可以直接当作函数来调用。在复杂的部署中，这种方法或许更灵活，直接"
"由你来控制“何时”及“如何”配置route。"

# 499e79b080ea49afbe682e5b737f8674
#: ../../routing.rst:95
msgid ""
"Here is a basic example of explicit routing configuration for default bottle "
"application::"
msgstr "下面是一个简单的例子"

# 6b60a336206e4c7dabf70f7cceca7a30
#: ../../routing.rst:101
msgid ""
"In fact, any :class:`Bottle` instance routing can be configured same way::"
msgstr "实际上，bottle可以是任何 :class:`Bottle` 类的实例"

# b368ae000c2a471c859da22a34176591
#~ msgid "Routing Order"
#~ msgstr "route的顺序 (URL映射的顺序)"

# 9b457321443a4d62b7751efd260d21a9
#~ msgid ""
#~ "With the power of wildcards and regular expressions it is possible to "
#~ "define overlapping routes. If multiple routes match the same URL, things "
#~ "get a bit tricky. To fully understand what happens in this case, you need "
#~ "to know in which order routes are checked by the router."
#~ msgstr ""
#~ "在通配符和正则表达式的支持下，我们是可以定义重叠的route的。如果多个route匹"
#~ "配同一个URL，它们的行为也许会变得难以琢磨。为了了解这里面究竟发生了什么事"
#~ "情，你需要了解route被执行的顺序。(译者注：router会检查route的顺序)"

# 992fd1ac2f7047c5944584ce8b539ddd
#~ msgid ""
#~ "First you should know that routes are grouped by their path rule. Two "
#~ "routes with the same path rule but different methods are grouped together "
#~ "and the first route determines the position of both routes. Fully "
#~ "identical routes (same path rule and method) replace previously defined "
#~ "routes, but keep the position of their predecessor."
#~ msgstr ""
#~ "首先，route是按照它们的路径规则来分组的。两个规则相同但回调函数不同的route"
#~ "分到同一组，第一个route决定这两个route的位置。如果两个route完全相同(同样的"
#~ "规则，同样的回调函数)，则先定义的route会被后来的route替换掉，但它们的先后"
#~ "顺序会被保留下来。"

# 105f6ae2a6a8429db8f4acc8d2d0609a
#~ msgid ""
#~ "Static routes are checked first. This is mostly for performance reasons "
#~ "and can be switched off, but is currently the default. If no static route "
#~ "matches the request, the dynamic routes are checked in the order they "
#~ "were defined. The first hit ends the search. If no rule matched, a \"404 "
#~ "Page not found\" error is returned."
#~ msgstr ""
#~ "基于性能考虑，默认先查找静态route，这个默认设置可以被改掉。如果没有静态"
#~ "route匹配浏览器请求，则会按route被定义的顺序，去查找动态route，只要找到一"
#~ "个匹配的动态route，便不会继续查找。如果也找不到匹配请求的动态route，则返回"
#~ "一个404错误。"

# 5be98f36dfec4d3d84562510d59569bf
#~ msgid ""
#~ "In a second step, the request method is checked. If no exact match is "
#~ "found, and the request method is HEAD, the router checks for a GET route. "
#~ "Otherwise, it checks for an ANY route. If that fails too, a \"405 Method "
#~ "not allowed\" error is returned."
#~ msgstr ""
#~ "第二步，会检查浏览器请求的HTTP方法。如果不能精确匹配，且浏览器发的是HEAD请"
#~ "求，那个router会按照GET方法去查找相应的route，否则便按照ANY方法去查找"
#~ "route。如果都失败了，则返回一个405错误。"

# 9e5a42e18b2949a2b91e3f7b929318dd
#~ msgid "Here is an example where this might bite you::"
#~ msgstr "下面这个例子也许会令你迷惑"

# 9da489b5d4d94eeba231d11e48577619
#~ msgid ""
#~ "The second route will never hit. Even POST requests don't arrive at the "
#~ "second route because the request method is checked in a separate step. "
#~ "The router stops at the first route which matches the request path, then "
#~ "checks for a valid request method, can't find one and raises a 405 error."
#~ msgstr ""
#~ "第二个route永远不会被命中，因为第一个route已经能匹配该URL，所以router会在"
#~ "查找到第一个route后停止查找，接着按照浏览器请求的HTTP方法来查找，如果找不"
#~ "到则返回405错误。"

# 99ce58b0d94d48eba1fe52fc4e9a2b2d
#~ msgid ""
#~ "Sounds complicated, and it is. That is the price for performance. It is "
#~ "best to avoid ambiguous routes at all and choose unique prefixes for each "
#~ "route. This implementation detail may change in the future, though. We "
#~ "are working on it."
#~ msgstr ""
#~ "看起来挺复杂的，确实很复杂。这是为了性能而付出的代价。最好是避免创建容易造"
#~ "成歧义的route。将来或许会改变route实现的细节，我们在慢慢改善中。"
