66# Translators:
77# Freesand Leo <[email protected] >, 201988# walkinrain <[email protected] >, 20199+ # Zombie110year <[email protected] >, 2019910#
1011#, fuzzy
1112msgid ""
@@ -14,7 +15,7 @@ msgstr ""
1415"Report-Msgid-Bugs-To : \n "
1516"POT-Creation-Date : 2019-02-12 10:40+0900\n "
1617"PO-Revision-Date : 2017-02-16 23:21+0000\n "
17- "Last-Translator : walkinrain <walkinrain2008@163 .com>, 2019\n "
18+ "Last-Translator : Zombie110year <zombie110year@gmail .com>, 2019\n "
1819"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1920"MIME-Version : 1.0\n "
2021"Content-Type : text/plain; charset=UTF-8\n "
@@ -24,11 +25,11 @@ msgstr ""
2425
2526#: ../../library/pathlib.rst:3
2627msgid ":mod:`pathlib` --- Object-oriented filesystem paths"
27- msgstr ""
28+ msgstr ":mod:`pathlib` --- 面对对象的文件系统路径 "
2829
2930#: ../../library/pathlib.rst:10
3031msgid "**Source code:** :source:`Lib/pathlib.py`"
31- msgstr ""
32+ msgstr "**源代码** :source:`Lib/pathlib.py` "
3233
3334#: ../../library/pathlib.rst:16
3435msgid ""
@@ -38,6 +39,8 @@ msgid ""
3839"operations without I/O, and :ref:`concrete paths <concrete-paths>`, which "
3940"inherit from pure paths but also provide I/O operations."
4041msgstr ""
42+ "该模块提供表示文件系统路径的类,其语义适用于不同的操作系统。路径类被分为提供纯计算操作而没有 I/O 的 :ref:`纯路径 <pure-"
43+ "paths>`,以及从纯路径继承而来但提供 I/O 操作的 :ref:`具体路径 <concrete-paths>`。"
4144
4245#: ../../library/pathlib.rst:25
4346msgid ""
@@ -46,165 +49,176 @@ msgid ""
4649"instantiates a :ref:`concrete path <concrete-paths>` for the platform the "
4750"code is running on."
4851msgstr ""
52+ "如果你以前从未使用过此模块或者不确定在项目中使用哪一个类是正确的,则 :class:`Path` 总是你需要的。它在运行代码的平台上实例化为一个 "
53+ ":ref:`具体路径 <concrete-paths>`。"
4954
5055#: ../../library/pathlib.rst:29
5156msgid "Pure paths are useful in some special cases; for example:"
52- msgstr ""
57+ msgstr "在一些用例中纯路径很有用,例如: "
5358
5459#: ../../library/pathlib.rst:31
5560msgid ""
5661"If you want to manipulate Windows paths on a Unix machine (or vice versa). "
5762"You cannot instantiate a :class:`WindowsPath` when running on Unix, but you "
5863"can instantiate :class:`PureWindowsPath`."
5964msgstr ""
65+ "如果你想要在 Unix 设备上操作 Windows 路径(或者相反)。你不应在 Unix 上实例化一个 "
66+ ":class:`WindowsPath`,但是你可以实例化 :class:`PureWindowsPath`。"
6067
6168#: ../../library/pathlib.rst:34
6269msgid ""
6370"You want to make sure that your code only manipulates paths without actually"
6471" accessing the OS. In this case, instantiating one of the pure classes may "
6572"be useful since those simply don't have any OS-accessing operations."
66- msgstr ""
73+ msgstr "你只想操作路径但不想实际访问操作系统。在这种情况下,实例化一个纯路径是有用的,因为它们没有任何访问操作系统的操作。 "
6774
6875#: ../../library/pathlib.rst:39
6976msgid ":pep:`428`: The pathlib module -- object-oriented filesystem paths."
70- msgstr ""
77+ msgstr ":pep:`428`: pathlib 模块 -- 面对对象的文件系统路径。 "
7178
7279#: ../../library/pathlib.rst:42
7380msgid ""
7481"For low-level path manipulation on strings, you can also use the "
7582":mod:`os.path` module."
76- msgstr ""
83+ msgstr "对于底层的路径字符串操作,你也可以使用 :mod:`os.path` 模块。 "
7784
7885#: ../../library/pathlib.rst:47
7986msgid "Basic use"
80- msgstr ""
87+ msgstr "基础使用 "
8188
8289#: ../../library/pathlib.rst:49
8390msgid "Importing the main class::"
84- msgstr ""
91+ msgstr "导入主类:: "
8592
8693#: ../../library/pathlib.rst:53
8794msgid "Listing subdirectories::"
88- msgstr ""
95+ msgstr "列出子目录:: "
8996
9097#: ../../library/pathlib.rst:60
9198msgid "Listing Python source files in this directory tree::"
92- msgstr ""
99+ msgstr "列出当前目录树下的所有 Python 源代码文件:: "
93100
94101#: ../../library/pathlib.rst:67
95102msgid "Navigating inside a directory tree::"
96- msgstr ""
103+ msgstr "在目录树中移动:: "
97104
98105#: ../../library/pathlib.rst:76
99106msgid "Querying path properties::"
100- msgstr ""
107+ msgstr "查询路径的属性:: "
101108
102109#: ../../library/pathlib.rst:83
103110msgid "Opening a file::"
104- msgstr ""
111+ msgstr "打开一个文件:: "
105112
106113#: ../../library/pathlib.rst:93
107114msgid "Pure paths"
108- msgstr ""
115+ msgstr "纯路径 "
109116
110117#: ../../library/pathlib.rst:95
111118msgid ""
112119"Pure path objects provide path-handling operations which don't actually "
113120"access a filesystem. There are three ways to access these classes, which we"
114121" also call *flavours*:"
115- msgstr ""
122+ msgstr "纯路径对象提供了不实际访问文件系统的路径处理操作。有三种方式来访问这些类,也是不同的风格: "
116123
117124#: ../../library/pathlib.rst:101
118125msgid ""
119126"A generic class that represents the system's path flavour (instantiating it "
120127"creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`)::"
121128msgstr ""
129+ "一个通用的类,代表当前系统的路径风格(实例化为 :class:`PurePosixPath` 或者 "
130+ ":class:`PureWindowsPath`)::"
122131
123132#: ../../library/pathlib.rst:107
124133msgid ""
125134"Each element of *pathsegments* can be either a string representing a path "
126135"segment, an object implementing the :class:`os.PathLike` interface which "
127136"returns a string, or another path object::"
128137msgstr ""
138+ "每一个 *pathsegments* 的元素可能是一个代表路径片段的字符串,一个返回字符串的实现了 :class:`os.PathLike` "
139+ "接口的对象,或者另一个路径对象::"
129140
130141#: ../../library/pathlib.rst:116
131142msgid "When *pathsegments* is empty, the current directory is assumed::"
132- msgstr ""
143+ msgstr "当 *pathsegments* 为空的时候,假定为当前目录:: "
133144
134145#: ../../library/pathlib.rst:121
135146msgid ""
136147"When several absolute paths are given, the last is taken as an anchor "
137148"(mimicking :func:`os.path.join`'s behaviour)::"
138- msgstr ""
149+ msgstr "当给出一些绝对路径,最后一位将被当作锚(模仿 :func:`os.path.join` 的行为):: "
139150
140151#: ../../library/pathlib.rst:129
141152msgid ""
142153"However, in a Windows path, changing the local root doesn't discard the "
143154"previous drive setting::"
144- msgstr ""
155+ msgstr "但是,在 Windows 路径中,改变本地根目录并不会丢弃之前盘符的设置:: "
145156
146157#: ../../library/pathlib.rst:135
147158msgid ""
148159"Spurious slashes and single dots are collapsed, but double dots (``'..'``) "
149160"are not, since this would change the meaning of a path in the face of "
150161"symbolic links::"
151- msgstr ""
162+ msgstr "假斜线和单独的点都会被消除,但是双点 (``‘..’``) 不会,以防改变符号链接的含义。 "
152163
153164#: ../../library/pathlib.rst:146
154165msgid ""
155166"(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to "
156167"``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to "
157168"another directory)"
158169msgstr ""
170+ "(如果你想让 ``PurePosixPath('foo/../bar')`` 等同于 ``PurePosixPath('bar')``,那么 you "
171+ "are too young, too simple, sometimes naive! 如果 ``foo`` "
172+ "是一个指向其他其他目录的符号链接,那就出毛病啦。)"
159173
160174#: ../../library/pathlib.rst:150
161175msgid ""
162176"Pure path objects implement the :class:`os.PathLike` interface, allowing "
163177"them to be used anywhere the interface is accepted."
164- msgstr ""
178+ msgstr "纯路径对象实现了 :class:`os.PathLike` 接口,允许它们在任何接受此接口的地方使用。 "
165179
166180#: ../../library/pathlib.rst:153
167181msgid "Added support for the :class:`os.PathLike` interface."
168- msgstr ""
182+ msgstr "添加了 :class:`os.PathLike` 接口支持。 "
169183
170184#: ../../library/pathlib.rst:158
171185msgid ""
172186"A subclass of :class:`PurePath`, this path flavour represents non-Windows "
173187"filesystem paths::"
174- msgstr ""
188+ msgstr "一个 :class:`PurePath` 的子类,路径风格不同于 Windows 文件系统:: "
175189
176190#: ../../library/pathlib.rst:164 ../../library/pathlib.rst:174
177191#: ../../library/pathlib.rst:595 ../../library/pathlib.rst:605
178192#: ../../library/pathlib.rst:615
179193msgid "*pathsegments* is specified similarly to :class:`PurePath`."
180- msgstr ""
194+ msgstr "*pathsegments* 参数的指定和 :class:`PurePath` 相同。 "
181195
182196#: ../../library/pathlib.rst:168
183197msgid ""
184198"A subclass of :class:`PurePath`, this path flavour represents Windows "
185199"filesystem paths::"
186- msgstr ""
200+ msgstr ":class:`PurePath` 的一个子类,路径风格为 Windows 文件系统路径:: "
187201
188202#: ../../library/pathlib.rst:176
189203msgid ""
190204"Regardless of the system you're running on, you can instantiate all of these"
191205" classes, since they don't provide any operation that does system calls."
192- msgstr ""
206+ msgstr "无论你正运行什么系统,你都可以实例化这些类,因为它们提供的操作不做任何系统调用。 "
193207
194208#: ../../library/pathlib.rst:181
195209msgid "General properties"
196- msgstr ""
210+ msgstr "通用性质 "
197211
198212#: ../../library/pathlib.rst:183
199213msgid ""
200214"Paths are immutable and hashable. Paths of a same flavour are comparable "
201215"and orderable. These properties respect the flavour's case-folding "
202216"semantics::"
203- msgstr ""
217+ msgstr "路径是不可变并可哈希的。相同风格的路径可以排序与比较。这些性质尊重对应风格的大小写转换语义:: "
204218
205219#: ../../library/pathlib.rst:196
206220msgid "Paths of a different flavour compare unequal and cannot be ordered::"
207- msgstr ""
221+ msgstr "不同风格的路径比较得到不等的结果并且无法被排序:: "
208222
209223#: ../../library/pathlib.rst:207
210224msgid "Operators"
@@ -214,26 +228,28 @@ msgstr "运算符"
214228msgid ""
215229"The slash operator helps create child paths, similarly to "
216230":func:`os.path.join`::"
217- msgstr ""
231+ msgstr "斜杠 ``/`` 操作符有助于创建子路径,就像 :func:`os.path.join` 一样:: "
218232
219233#: ../../library/pathlib.rst:220
220234msgid ""
221235"A path object can be used anywhere an object implementing "
222236":class:`os.PathLike` is accepted::"
223- msgstr ""
237+ msgstr "文件对象可用于任何接受 :class:`os.PathLike` 接口实现的地方。 "
224238
225239#: ../../library/pathlib.rst:228
226240msgid ""
227241"The string representation of a path is the raw filesystem path itself (in "
228242"native form, e.g. with backslashes under Windows), which you can pass to any"
229243" function taking a file path as a string::"
230244msgstr ""
245+ "路径的字符串表示法为它自己原始的文件系统路径(以原生形式,例如在 Windows 下使用反斜杠)。你可以传递给任何需要字符串形式路径的函数。"
231246
232247#: ../../library/pathlib.rst:239
233248msgid ""
234249"Similarly, calling :class:`bytes` on a path gives the raw filesystem path as"
235250" a bytes object, as encoded by :func:`os.fsencode`::"
236251msgstr ""
252+ "类似地,在路径上调用 :class:`bytes` 将原始文件系统路径作为字节对象给出,就像被 :func:`os.fsencode` 编码一样::"
237253
238254#: ../../library/pathlib.rst:246
239255msgid ""
0 commit comments