summaryrefslogtreecommitdiff
path: root/docs/_locale/zh_CN/LC_MESSAGES/routing.po
blob: 0a53ac8575ed301c96e93eb795e25c2f429be169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2009-2017, Marcel Hellkamp
# This file is distributed under the same license as the Bottle package.
# 
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: bottle\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-12-19 14:15+0100\n"
"PO-Revision-Date: 2015-12-13 21:06+0000\n"
"Last-Translator: Thiago Avelino <thiago@avelino.xxx>\n"
"Language-Team: Chinese (China) (http://www.transifex.com/bottle/bottle/language/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"

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

#: ../../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的规则。"

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

#: ../../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,除此之外的都是静态的。"

#: ../../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里面,这个变量名需要是唯一的。因为稍后会将其当作参数传给回调函数,所以这个变量名的第一个字符应该是字母。"

#: ../../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包含多个通配符的时候不出现歧义。"

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

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

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

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

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

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

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

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

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

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

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

#: ../../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\"部分的语法由被使用的过滤器决定。"

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

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

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

#: ../../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** 匹配所有字符,包括'/'"

#: ../../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中写一个正则表达式"

#: ../../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部分)。"

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

#: ../../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** 版本中引入了新的语法,来简单化一些常见用例,但依然兼容旧的语法。新旧语法的区别如下。"

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

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

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

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

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

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

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

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

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

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

#: ../../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 "请尽量在新项目中避免使用旧的语法,虽然它现在还没被废弃,但终究会的。"

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

#: ../../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。"

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

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