Repository navigation
Expand file tree
/
Copy pathstring.po
More file actions
1187 lines (1015 loc) · 54.9 KB
/
Copy pathstring.po
File metadata and controls
1187 lines (1015 loc) · 54.9 KB
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2021, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Shengjing Zhu <zsj950618@gmail.com>, 2019
# Woko <banbooliu@gmail.com>, 2019
# df2dc1c92e792f7ae8417c51df43db8f_594d92a <0f49be28017426edb1db1a2ab6e67088_717605>, 2019
# Nasy, 2019
# ppcfish <ppcfish@gmail.com>, 2019
# Iterator <xicheng.li@ucdconnect.ie>, 2019
# Yuwei Tu <yt1209@nyu.edu>, 2019
# Freesand Leo <yuqinju@163.com>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-01 16:02+0000\n"
"PO-Revision-Date: 2019-09-01 03:17+0000\n"
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2020\n"
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/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"
#: ../../library/string.rst:2
msgid ":mod:`string` --- Common string operations"
msgstr ":mod:`string` --- 常见的字符串操作"
#: ../../library/string.rst:7
msgid "**Source code:** :source:`Lib/string.py`"
msgstr "**源代码:** :source:`Lib/string.py`"
#: ../../library/string.rst:13
msgid ":ref:`textseq`"
msgstr ":ref:`textseq`"
#: ../../library/string.rst:15
msgid ":ref:`string-methods`"
msgstr ":ref:`string-methods`"
#: ../../library/string.rst:18
msgid "String constants"
msgstr "字符串常量"
#: ../../library/string.rst:20
msgid "The constants defined in this module are:"
msgstr "此模块中定义的常量为:"
#: ../../library/string.rst:25
msgid ""
"The concatenation of the :const:`ascii_lowercase` and "
":const:`ascii_uppercase` constants described below. This value is not "
"locale-dependent."
msgstr ""
"下文所述 :const:`ascii_lowercase` 和 :const:`ascii_uppercase` 常量的拼连。 该值不依赖于语言区域。"
#: ../../library/string.rst:31
msgid ""
"The lowercase letters ``'abcdefghijklmnopqrstuvwxyz'``. This value is not "
"locale-dependent and will not change."
msgstr "小写字母 ``'abcdefghijklmnopqrstuvwxyz'``。 该值不依赖于语言区域,不会发生改变。"
#: ../../library/string.rst:37
msgid ""
"The uppercase letters ``'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. This value is not "
"locale-dependent and will not change."
msgstr "大写字母 ``'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``。 该值不依赖于语言区域,不会发生改变。"
#: ../../library/string.rst:43
msgid "The string ``'0123456789'``."
msgstr "字符串 ``'0123456789'``。"
#: ../../library/string.rst:48
msgid "The string ``'0123456789abcdefABCDEF'``."
msgstr "字符串 ``'0123456789abcdefABCDEF'``。"
#: ../../library/string.rst:53
msgid "The string ``'01234567'``."
msgstr "字符串 ``'01234567'``。"
#: ../../library/string.rst:58
msgid ""
"String of ASCII characters which are considered punctuation characters in "
"the ``C`` locale."
msgstr "由在 ``C`` 语言区域中被视为标点符号的 ASCII 字符组成的字符串。"
#: ../../library/string.rst:64
msgid ""
"String of ASCII characters which are considered printable. This is a "
"combination of :const:`digits`, :const:`ascii_letters`, "
":const:`punctuation`, and :const:`whitespace`."
msgstr ""
"由被视为可打印符号的 ASCII 字符组成的字符串。 这是 :const:`digits`, :const:`ascii_letters`, "
":const:`punctuation` 和 :const:`whitespace` 的总和。"
#: ../../library/string.rst:71
msgid ""
"A string containing all ASCII characters that are considered whitespace. "
"This includes the characters space, tab, linefeed, return, formfeed, and "
"vertical tab."
msgstr "由被视为空白符号的 ASCII 字符组成的字符串。 其中包括空格、制表、换行、回车、进纸和纵向制表符。"
#: ../../library/string.rst:79
msgid "Custom String Formatting"
msgstr "自定义字符串格式化"
#: ../../library/string.rst:81
msgid ""
"The built-in string class provides the ability to do complex variable "
"substitutions and value formatting via the :meth:`~str.format` method "
"described in :pep:`3101`. The :class:`Formatter` class in the :mod:`string`"
" module allows you to create and customize your own string formatting "
"behaviors using the same implementation as the built-in :meth:`~str.format` "
"method."
msgstr ""
"内置的字符串类提供了通过使用 :pep:`3101` 所描述的 :meth:`~str.format` 方法进行复杂变量替换和值格式化的能力。 "
":mod:`string` 模块中的 :class:`Formatter` 类允许你使用与内置 :meth:`~str.format` "
"方法相同的实现来创建并定制你自己的字符串格式化行为。"
#: ../../library/string.rst:90
msgid "The :class:`Formatter` class has the following public methods:"
msgstr ":class:`Formatter` 类包含下列公有方法:"
#: ../../library/string.rst:94
msgid ""
"The primary API method. It takes a format string and an arbitrary set of "
"positional and keyword arguments. It is just a wrapper that calls "
":meth:`vformat`."
msgstr "首要的 API 方法。 它接受一个格式字符串和任意一组位置和关键字参数。 它只是一个调用 :meth:`vformat` 的包装器。"
#: ../../library/string.rst:98
msgid ""
"A format string argument is now :ref:`positional-only <positional-"
"only_parameter>`."
msgstr "格式字符串参数现在是 :ref:`仅限位置参数 <positional-only_parameter>`。"
#: ../../library/string.rst:104
msgid ""
"This function does the actual work of formatting. It is exposed as a "
"separate function for cases where you want to pass in a predefined "
"dictionary of arguments, rather than unpacking and repacking the dictionary "
"as individual arguments using the ``*args`` and ``**kwargs`` syntax. "
":meth:`vformat` does the work of breaking up the format string into "
"character data and replacement fields. It calls the various methods "
"described below."
msgstr ""
"此函数执行实际的格式化操作。 它被公开为一个单独的函数,用于需要传入一个预定义字母作为参数,而不是使用 ``*args`` 和 ``**kwargs``"
" 语法将字典解包为多个单独参数并重打包的情况。 :meth:`vformat` 完成将格式字符串分解为字符数据和替换字段的工作。 "
"它会调用下文所述的几种不同方法。"
#: ../../library/string.rst:112
msgid ""
"In addition, the :class:`Formatter` defines a number of methods that are "
"intended to be replaced by subclasses:"
msgstr "此外,:class:`Formatter` 还定义了一些旨在被子类替换的方法:"
#: ../../library/string.rst:117
msgid ""
"Loop over the format_string and return an iterable of tuples "
"(*literal_text*, *field_name*, *format_spec*, *conversion*). This is used "
"by :meth:`vformat` to break the string into either literal text, or "
"replacement fields."
msgstr ""
"循环遍历 format_string 并返回一个由可迭代对象组成的元组 (*literal_text*, *field_name*, "
"*format_spec*, *conversion*)。 它会被 :meth:`vformat` 用来将字符串分解为文本字面值或替换字段。"
#: ../../library/string.rst:122
msgid ""
"The values in the tuple conceptually represent a span of literal text "
"followed by a single replacement field. If there is no literal text (which "
"can happen if two replacement fields occur consecutively), then "
"*literal_text* will be a zero-length string. If there is no replacement "
"field, then the values of *field_name*, *format_spec* and *conversion* will "
"be ``None``."
msgstr ""
"元组中的值在概念上表示一段字面文本加上一个替换字段。 如果没有字面文本(如果连续出现两个替换字段就会发生这种情况),则 *literal_text* "
"将是一个长度为零的字符串。 如果没有替换字段,则 *field_name*, *format_spec* 和 *conversion* 的值将为 "
"``None``。"
#: ../../library/string.rst:131
msgid ""
"Given *field_name* as returned by :meth:`parse` (see above), convert it to "
"an object to be formatted. Returns a tuple (obj, used_key). The default "
"version takes strings of the form defined in :pep:`3101`, such as "
"\"0[name]\" or \"label.title\". *args* and *kwargs* are as passed in to "
":meth:`vformat`. The return value *used_key* has the same meaning as the "
"*key* parameter to :meth:`get_value`."
msgstr ""
"给定 *field_name* 作为 :meth:`parse` (见上文) 的返回值,将其转换为要格式化的对象。 返回一个元组 (obj, "
"used_key)。 默认版本接受在 :pep:`3101` 所定义形式的字符串,例如 \"0[name]\" 或 \"label.title\"。 "
"*args* 和 *kwargs* 与传给 :meth:`vformat` 的一样。 返回值 *used_key* 与 "
":meth:`get_value` 的 *key* 形参具有相同的含义。"
#: ../../library/string.rst:140
msgid ""
"Retrieve a given field value. The *key* argument will be either an integer "
"or a string. If it is an integer, it represents the index of the positional"
" argument in *args*; if it is a string, then it represents a named argument "
"in *kwargs*."
msgstr ""
"提取给定的字段值。 *key* 参数将为整数或字符串。 如果是整数,它表示 *args* 中位置参数的索引;如果是字符串,它表示 *kwargs* "
"中的关键字参数名。"
#: ../../library/string.rst:145
msgid ""
"The *args* parameter is set to the list of positional arguments to "
":meth:`vformat`, and the *kwargs* parameter is set to the dictionary of "
"keyword arguments."
msgstr "*args* 形参会被设为 :meth:`vformat` 的位置参数列表,而 *kwargs* 形参会被设为由关键字参数组成的字典。"
#: ../../library/string.rst:149
msgid ""
"For compound field names, these functions are only called for the first "
"component of the field name; Subsequent components are handled through "
"normal attribute and indexing operations."
msgstr "对于复合字段名称,仅会为字段名称的第一个组件调用这些函数;后续组件会通过普通属性和索引操作来进行处理。"
#: ../../library/string.rst:153
msgid ""
"So for example, the field expression '0.name' would cause :meth:`get_value` "
"to be called with a *key* argument of 0. The ``name`` attribute will be "
"looked up after :meth:`get_value` returns by calling the built-in "
":func:`getattr` function."
msgstr ""
"因此举例来说,字段表达式 '0.name' 将导致调用 :meth:`get_value` 时附带 *key* 参数值 0。 在 "
":meth:`get_value` 通过调用内置的 :func:`getattr` 函数返回后将会查找 ``name`` 属性。"
#: ../../library/string.rst:158
msgid ""
"If the index or keyword refers to an item that does not exist, then an "
":exc:`IndexError` or :exc:`KeyError` should be raised."
msgstr "如果索引或关键字引用了一个不存在的项,则将引发 :exc:`IndexError` 或 :exc:`KeyError`。"
#: ../../library/string.rst:163
msgid ""
"Implement checking for unused arguments if desired. The arguments to this "
"function is the set of all argument keys that were actually referred to in "
"the format string (integers for positional arguments, and strings for named "
"arguments), and a reference to the *args* and *kwargs* that was passed to "
"vformat. The set of unused args can be calculated from these parameters. "
":meth:`check_unused_args` is assumed to raise an exception if the check "
"fails."
msgstr ""
"在必要时实现对未使用参数进行检测。 此函数的参数是是格式字符串中实际引用的所有参数键的集合(整数表示位置参数,字符串表示名称参数),以及被传给 "
"vformat 的 *args* 和 *kwargs* 的引用。 未使用参数的集合可以根据这些形参计算出来。 如果检测失败则 "
":meth:`check_unused_args` 应会引发一个异常。"
#: ../../library/string.rst:173
msgid ""
":meth:`format_field` simply calls the global :func:`format` built-in. The "
"method is provided so that subclasses can override it."
msgstr ":meth:`format_field` 会简单地调用内置全局函数 :func:`format`。 提供该方法是为了让子类能够重载它。"
#: ../../library/string.rst:178
msgid ""
"Converts the value (returned by :meth:`get_field`) given a conversion type "
"(as in the tuple returned by the :meth:`parse` method). The default version"
" understands 's' (str), 'r' (repr) and 'a' (ascii) conversion types."
msgstr ""
"使用给定的转换类型(来自 :meth:`parse` 方法所返回的元组)来转换(由 :meth:`get_field` 所返回的)值。 默认版本支持 "
"'s' (str), 'r' (repr) 和 'a' (ascii) 等转换类型。"
#: ../../library/string.rst:187
msgid "Format String Syntax"
msgstr "格式字符串语法"
#: ../../library/string.rst:189
msgid ""
"The :meth:`str.format` method and the :class:`Formatter` class share the "
"same syntax for format strings (although in the case of :class:`Formatter`, "
"subclasses can define their own format string syntax). The syntax is "
"related to that of :ref:`formatted string literals <f-strings>`, but there "
"are differences."
msgstr ""
":meth:`str.format` 方法和 :class:`Formatter` 类共享相同的格式字符串语法(虽然对于 "
":class:`Formatter` 来说,其子类可以定义它们自己的格式字符串语法)。 具体语法与 :ref:`格式化字符串字面值 "
"<f-strings>` 相似,但也存在区别。"
#: ../../library/string.rst:202
msgid ""
"Format strings contain \"replacement fields\" surrounded by curly braces "
"``{}``. Anything that is not contained in braces is considered literal text,"
" which is copied unchanged to the output. If you need to include a brace "
"character in the literal text, it can be escaped by doubling: ``{{`` and "
"``}}``."
msgstr ""
"格式字符串包含有以花括号 ``{}`` 括起来的“替换字段”。 不在花括号之内的内容被视为字面文本,会不加修改地复制到输出中。 "
"如果你需要在字面文本中包含花括号字符,可以通过重复来转义: ``{{`` and ``}}``。"
#: ../../library/string.rst:207
msgid "The grammar for a replacement field is as follows:"
msgstr "替换字段的语法如下:"
#: ../../library/string.rst:219
msgid ""
"In less formal terms, the replacement field can start with a *field_name* "
"that specifies the object whose value is to be formatted and inserted into "
"the output instead of the replacement field. The *field_name* is optionally "
"followed by a *conversion* field, which is preceded by an exclamation point"
" ``'!'``, and a *format_spec*, which is preceded by a colon ``':'``. These "
"specify a non-default format for the replacement value."
msgstr ""
"用不太正式的术语来描述,替换字段开头可以用一个 *field_name* 指定要对值进行格式化并取代替换字符被插入到输出结果的对象。 "
"*field_name* 之后有可选的 *conversion* 字段,它是一个感叹号 ``'!'`` 加一个 "
"*format_spec*,并以一个冒号 ``':'`` 打头。 这些指明了替换值的非默认格式。"
#: ../../library/string.rst:226
msgid "See also the :ref:`formatspec` section."
msgstr "另请参阅 :ref:`formatspec` 一节。"
#: ../../library/string.rst:228
msgid ""
"The *field_name* itself begins with an *arg_name* that is either a number or"
" a keyword. If it's a number, it refers to a positional argument, and if "
"it's a keyword, it refers to a named keyword argument. If the numerical "
"arg_names in a format string are 0, 1, 2, ... in sequence, they can all be "
"omitted (not just some) and the numbers 0, 1, 2, ... will be automatically "
"inserted in that order. Because *arg_name* is not quote-delimited, it is not"
" possible to specify arbitrary dictionary keys (e.g., the strings ``'10'`` "
"or ``':-]'``) within a format string. The *arg_name* can be followed by any "
"number of index or attribute expressions. An expression of the form "
"``'.name'`` selects the named attribute using :func:`getattr`, while an "
"expression of the form ``'[index]'`` does an index lookup using "
":func:`__getitem__`."
msgstr ""
"*field_name* 本身以一个数字或关键字 *arg_name* 打头。 "
"如果为数字,则它指向一个位置参数,而如果为关键字,则它指向一个命名关键字参数。 如果格式字符串中的数字 arg_names 为 0, 1, 2, ..."
" 的序列,它们可以全部省略(而非部分省略),数字 0, 1, 2, ... 将会按顺序自动插入。 由于 *arg_name* "
"不使用引号分隔,因此无法在格式字符串中指定任意的字典键 (例如字符串 ``'10'`` 或 ``':-]'``)。 *arg_name* "
"之后可以带上任意数量的索引或属性表达式。 ``'.name'`` 形式的表达式会使用 :func:`getattr` 选择命名属性,而 "
"``'[index]'`` 形式的表达式会使用 :func:`__getitem__` 执行索引查找。"
#: ../../library/string.rst:240
msgid ""
"The positional argument specifiers can be omitted for :meth:`str.format`, so"
" ``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``."
msgstr ""
"位置参数说明符对于 :meth:`str.format` 可以省略,因此 ``'{} {}'.format(a, b)`` 等价于 ``'{0} "
"{1}'.format(a, b)``。"
#: ../../library/string.rst:244
msgid ""
"The positional argument specifiers can be omitted for :class:`Formatter`."
msgstr "位置参数说明符对于 :class:`Formatter` 可以省略。"
#: ../../library/string.rst:247
msgid "Some simple format string examples::"
msgstr "一些简单的格式字符串示例"
#: ../../library/string.rst:256
msgid ""
"The *conversion* field causes a type coercion before formatting. Normally, "
"the job of formatting a value is done by the :meth:`__format__` method of "
"the value itself. However, in some cases it is desirable to force a type to"
" be formatted as a string, overriding its own definition of formatting. By "
"converting the value to a string before calling :meth:`__format__`, the "
"normal formatting logic is bypassed."
msgstr ""
"使用 *conversion* 字段在格式化之前进行类型强制转换。 通常,格式化值的工作由值本身的 :meth:`__format__` 方法来完成。 "
"但是,在某些情况下最好强制将类型格式化为一个字符串,覆盖其本身的格式化定义。 通过在调用 :meth:`__format__` "
"之前将值转换为字符串,可以绕过正常的格式化逻辑。"
#: ../../library/string.rst:263
msgid ""
"Three conversion flags are currently supported: ``'!s'`` which calls "
":func:`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!a'`` "
"which calls :func:`ascii`."
msgstr ""
"目前支持的转换旗标有三种: ``'!s'`` 会对值调用 :func:`str`,``'!r'`` 调用 :func:`repr` 而 ``'!a'``"
" 则调用 :func:`ascii`。"
#: ../../library/string.rst:267
msgid "Some examples::"
msgstr "几个例子::"
#: ../../library/string.rst:273
msgid ""
"The *format_spec* field contains a specification of how the value should be "
"presented, including such details as field width, alignment, padding, "
"decimal precision and so on. Each value type can define its own "
"\"formatting mini-language\" or interpretation of the *format_spec*."
msgstr ""
"*format_spec* 字段包含值应如何呈现的规格描述,例如字段宽度、对齐、填充、小数精度等细节信息。 "
"每种值类型可以定义自己的“格式化迷你语言”或对 *format_spec* 的解读方式。"
#: ../../library/string.rst:278
msgid ""
"Most built-in types support a common formatting mini-language, which is "
"described in the next section."
msgstr "大多数内置类型都支持同样的格式化迷你语言,具体描述见下一节。"
#: ../../library/string.rst:281
msgid ""
"A *format_spec* field can also include nested replacement fields within it. "
"These nested replacement fields may contain a field name, conversion flag "
"and format specification, but deeper nesting is not allowed. The "
"replacement fields within the format_spec are substituted before the "
"*format_spec* string is interpreted. This allows the formatting of a value "
"to be dynamically specified."
msgstr ""
"*format_spec* 字段还可以在其内部包含嵌套的替换字段。 "
"这些嵌套的替换字段可能包括字段名称、转换旗标和格式规格描述,但是不再允许更深层的嵌套。 format_spec 内部的替换字段会在解读 "
"*format_spec* 字符串之前先被解读。 这将允许动态地指定特定值的格式。"
#: ../../library/string.rst:288
msgid "See the :ref:`formatexamples` section for some examples."
msgstr "请参阅 :ref:`formatexamples` 一节查看相关示例。"
#: ../../library/string.rst:294
msgid "Format Specification Mini-Language"
msgstr "格式规格迷你语言"
#: ../../library/string.rst:296
msgid ""
"\"Format specifications\" are used within replacement fields contained "
"within a format string to define how individual values are presented (see "
":ref:`formatstrings` and :ref:`f-strings`). They can also be passed directly"
" to the built-in :func:`format` function. Each formattable type may define "
"how the format specification is to be interpreted."
msgstr ""
"“格式规格”在格式字符串所包含的替换字段内部使用,用于定义单个值应如何呈现 (参见 :ref:`formatstrings` 和 "
":ref:`f-strings`)。 它们也可以被直接传给内置的 :func:`format` 函数。 "
"每种可格式化的类型都可以自行定义如何对格式规格进行解读。"
#: ../../library/string.rst:303
msgid ""
"Most built-in types implement the following options for format "
"specifications, although some of the formatting options are only supported "
"by the numeric types."
msgstr "大多数内置类型都为格式规格实现了下列选项,不过某些格式化选项只被数值类型所支持。"
#: ../../library/string.rst:306
msgid ""
"A general convention is that an empty format specification produces the same"
" result as if you had called :func:`str` on the value. A non-empty format "
"specification typically modifies the result."
msgstr "一般约定空的格式描述将产生与在值上调用 :func:`str` 相同的结果。 非空格式描述通常会修改此结果。"
#: ../../library/string.rst:310
msgid "The general form of a *standard format specifier* is:"
msgstr "*标准格式说明符* 的一般形式如下:"
#: ../../library/string.rst:322
msgid ""
"If a valid *align* value is specified, it can be preceded by a *fill* "
"character that can be any character and defaults to a space if omitted. It "
"is not possible to use a literal curly brace (\"``{``\" or \"``}``\") as the"
" *fill* character in a :ref:`formatted string literal <f-strings>` or when "
"using the :meth:`str.format` method. However, it is possible to insert a "
"curly brace with a nested replacement field. This limitation doesn't affect"
" the :func:`format` function."
msgstr ""
"如果指定了一个有效的 *align* 值,则可以在该值前面加一个 *fill* 字符,它可以为任意字符,如果省略则默认为空格符。 在 "
":ref:`格式化字符串字面值 <f-strings>` 或在使用 :meth:`str.format` 方法时是无法使用花括号字面值 "
"(\"``{``\" or \"``}``\") 作为 *fill* 字符的。 但是,通过嵌套替换字段插入花括号则是可以的。 这个限制不会影响 "
":func:`format` 函数。"
#: ../../library/string.rst:331
msgid "The meaning of the various alignment options is as follows:"
msgstr "各种对齐选项的含义如下:"
#: ../../library/string.rst:340 ../../library/string.rst:371
msgid "Option"
msgstr "选项"
#: ../../library/string.rst:340 ../../library/string.rst:371
#: ../../library/string.rst:440 ../../library/string.rst:451
#: ../../library/string.rst:483
msgid "Meaning"
msgstr "含义"
#: ../../library/string.rst:342
msgid "``'<'``"
msgstr "``'<'``"
#: ../../library/string.rst:342
msgid ""
"Forces the field to be left-aligned within the available space (this is the "
"default for most objects)."
msgstr "强制字段在可用空间内左对齐(这是大多数对象的默认值)。"
#: ../../library/string.rst:345
msgid "``'>'``"
msgstr "``'>'``"
#: ../../library/string.rst:345
msgid ""
"Forces the field to be right-aligned within the available space (this is the"
" default for numbers)."
msgstr "强制字段在可用空间内右对齐(这是数字的默认值)。"
#: ../../library/string.rst:348
msgid "``'='``"
msgstr "``'='``"
#: ../../library/string.rst:348
msgid ""
"Forces the padding to be placed after the sign (if any) but before the "
"digits. This is used for printing fields in the form '+000000120'. This "
"alignment option is only valid for numeric types. It becomes the default "
"when '0' immediately precedes the field width."
msgstr ""
"强制将填充放置在符号(如果有)之后但在数字之前。这用于以“+000000120”形式打印字段。此对齐选项仅对数字类型有效。当'0'紧接在字段宽度之前时,它成为默认值。"
#: ../../library/string.rst:354
msgid "``'^'``"
msgstr "``'^'``"
#: ../../library/string.rst:354
msgid "Forces the field to be centered within the available space."
msgstr "强制字段在可用空间内居中。"
#: ../../library/string.rst:358
msgid ""
"Note that unless a minimum field width is defined, the field width will "
"always be the same size as the data to fill it, so that the alignment option"
" has no meaning in this case."
msgstr "请注意,除非定义了最小字段宽度,否则字段宽度将始终与填充它的数据大小相同,因此在这种情况下,对齐选项没有意义。"
#: ../../library/string.rst:362
msgid ""
"The *sign* option is only valid for number types, and can be one of the "
"following:"
msgstr "*sign* 选项仅对数字类型有效,可以是以下之一:"
#: ../../library/string.rst:373
msgid "``'+'``"
msgstr "``'+'``"
#: ../../library/string.rst:373
msgid ""
"indicates that a sign should be used for both positive as well as negative "
"numbers."
msgstr "表示标志应该用于正数和负数。"
#: ../../library/string.rst:376
msgid "``'-'``"
msgstr "``'-'``"
#: ../../library/string.rst:376
msgid ""
"indicates that a sign should be used only for negative numbers (this is the "
"default behavior)."
msgstr "表示标志应仅用于负数(这是默认行为)。"
#: ../../library/string.rst:379
msgid "space"
msgstr "space"
#: ../../library/string.rst:379
msgid ""
"indicates that a leading space should be used on positive numbers, and a "
"minus sign on negative numbers."
msgstr "表示应在正数上使用前导空格,在负数上使用减号。"
#: ../../library/string.rst:386
msgid ""
"The ``'#'`` option causes the \"alternate form\" to be used for the "
"conversion. The alternate form is defined differently for different types."
" This option is only valid for integer, float, complex and Decimal types. "
"For integers, when binary, octal, or hexadecimal output is used, this option"
" adds the prefix respective ``'0b'``, ``'0o'``, or ``'0x'`` to the output "
"value. For floats, complex and Decimal the alternate form causes the result "
"of the conversion to always contain a decimal-point character, even if no "
"digits follow it. Normally, a decimal-point character appears in the result "
"of these conversions only if a digit follows it. In addition, for ``'g'`` "
"and ``'G'`` conversions, trailing zeros are not removed from the result."
msgstr ""
"``'#'`` 选项可以让“替代形式”被用于转换。 替代形式可针对不同类型分别定义。 此选项仅对整数、浮点、复数和 Decimal 类型有效。 "
"对于整数类型,当使用二进制、八进制或十六进制输出时,此选项会为输出值添加相应的 ``'0b'``, ``'0o'`` 或 ``'0x'`` 前缀。 "
"对于浮点数、复数和 Decimal 类型,替代形式会使得转换结果总是包含小数点符号,即使其不带小数。 "
"通常只有在带有小数的情况下,此类转换的结果中才会出现小数点符号。 此外,对于 ``'g'`` 和 ``'G'`` 转换,末尾的零不会从结果中被移除。"
#: ../../library/string.rst:400
msgid ""
"The ``','`` option signals the use of a comma for a thousands separator. For"
" a locale aware separator, use the ``'n'`` integer presentation type "
"instead."
msgstr "``','`` 选项表示使用逗号作为千位分隔符。 对于感应区域设置的分隔符,请改用 ``'n'`` 整数表示类型。"
#: ../../library/string.rst:404
msgid "Added the ``','`` option (see also :pep:`378`)."
msgstr "添加了 ``','`` 选项 (另请参阅 :pep:`378`)。"
#: ../../library/string.rst:409
msgid ""
"The ``'_'`` option signals the use of an underscore for a thousands "
"separator for floating point presentation types and for integer presentation"
" type ``'d'``. For integer presentation types ``'b'``, ``'o'``, ``'x'``, "
"and ``'X'``, underscores will be inserted every 4 digits. For other "
"presentation types, specifying this option is an error."
msgstr ""
"``'_'`` 选项表示对浮点表示类型和整数表示类型 ``'d'`` 使用下划线作为千位分隔符。 对于整数表示类型 ``'b'``, ``'o'``, "
"``'x'`` 和 ``'X'``,将为每 4 个数位插入一个下划线。 对于其他表示类型指定此选项则将导致错误。"
#: ../../library/string.rst:416
msgid "Added the ``'_'`` option (see also :pep:`515`)."
msgstr "添加了 ``'_'`` 选项 (另请参阅 :pep:`515`)。"
#: ../../library/string.rst:419
msgid ""
"*width* is a decimal integer defining the minimum total field width, "
"including any prefixes, separators, and other formatting characters. If not "
"specified, then the field width will be determined by the content."
msgstr "*width* 是一个定义最小总字段宽度的十进制整数,包括任何前缀、分隔符和其他格式化字符。 如果未指定,则字段宽度将由内容确定。"
#: ../../library/string.rst:423
msgid ""
"When no explicit alignment is given, preceding the *width* field by a zero "
"(``'0'``) character enables sign-aware zero-padding for numeric types. This"
" is equivalent to a *fill* character of ``'0'`` with an *alignment* type of "
"``'='``."
msgstr ""
"当未显式给出对齐方式时,在 *width* 字段前加一个零 (``'0'``) 字段将为数字类型启用感知正负号的零填充。 这相当于设置 *fill* "
"字符为 ``'0'`` 且 *alignment* 类型为 ``'='``。"
#: ../../library/string.rst:428
msgid ""
"The *precision* is a decimal number indicating how many digits should be "
"displayed after the decimal point for a floating point value formatted with "
"``'f'`` and ``'F'``, or before and after the decimal point for a floating "
"point value formatted with ``'g'`` or ``'G'``. For non-number types the "
"field indicates the maximum field size - in other words, how many characters"
" will be used from the field content. The *precision* is not allowed for "
"integer values."
msgstr ""
"*precision* 是一个十进制数字,表示对于以 ``'f'`` and ``'F'`` 格式化的浮点数值要在小数点后显示多少个数位,或者对于以 "
"``'g'`` 或 ``'G'`` 格式化的浮点数值要在小数点前后共显示多少个数位。 对于非数字类型,该字段表示最大字段大小 —— "
"换句话说就是要使用多少个来自字段内容的字符。 对于整数值则不允许使用 *precision*。"
#: ../../library/string.rst:435
msgid "Finally, the *type* determines how the data should be presented."
msgstr "最后,*type* 确定了数据应如何呈现。"
#: ../../library/string.rst:437
msgid "The available string presentation types are:"
msgstr "可用的字符串表示类型是:"
#: ../../library/string.rst:440 ../../library/string.rst:451
#: ../../library/string.rst:483
msgid "Type"
msgstr "类型"
#: ../../library/string.rst:442
msgid "``'s'``"
msgstr "``'s'``"
#: ../../library/string.rst:442
msgid ""
"String format. This is the default type for strings and may be omitted."
msgstr "字符串格式。这是字符串的默认类型,可以省略。"
#: ../../library/string.rst:445 ../../library/string.rst:472
#: ../../library/string.rst:534
msgid "None"
msgstr "None"
#: ../../library/string.rst:445
msgid "The same as ``'s'``."
msgstr "和 ``'s'`` 一样。"
#: ../../library/string.rst:448
msgid "The available integer presentation types are:"
msgstr "可用的整数表示类型是:"
#: ../../library/string.rst:453
msgid "``'b'``"
msgstr "``'b'``"
#: ../../library/string.rst:453
msgid "Binary format. Outputs the number in base 2."
msgstr "二进制格式。 输出以 2 为基数的数字。"
#: ../../library/string.rst:455
msgid "``'c'``"
msgstr "``'c'``"
#: ../../library/string.rst:455
msgid ""
"Character. Converts the integer to the corresponding unicode character "
"before printing."
msgstr "字符。在打印之前将整数转换为相应的unicode字符。"
#: ../../library/string.rst:458
msgid "``'d'``"
msgstr "``'d'``"
#: ../../library/string.rst:458
msgid "Decimal Integer. Outputs the number in base 10."
msgstr "十进制整数。 输出以 10 为基数的数字。"
#: ../../library/string.rst:460
msgid "``'o'``"
msgstr "``'o'``"
#: ../../library/string.rst:460
msgid "Octal format. Outputs the number in base 8."
msgstr "八进制格式。 输出以 8 为基数的数字。"
#: ../../library/string.rst:462
msgid "``'x'``"
msgstr "``'x'``"
#: ../../library/string.rst:462
msgid ""
"Hex format. Outputs the number in base 16, using lower-case letters for the "
"digits above 9."
msgstr "十六进制格式。 输出以 16 为基数的数字,使用小写字母表示 9 以上的数码。"
#: ../../library/string.rst:465
msgid "``'X'``"
msgstr "``'X'``"
#: ../../library/string.rst:465
msgid ""
"Hex format. Outputs the number in base 16, using upper-case letters for the "
"digits above 9."
msgstr "十六进制格式。 输出以 16 为基数的数字,使用大写字母表示 9 以上的数码。"
#: ../../library/string.rst:468 ../../library/string.rst:527
msgid "``'n'``"
msgstr "``'n'``"
#: ../../library/string.rst:468
msgid ""
"Number. This is the same as ``'d'``, except that it uses the current locale "
"setting to insert the appropriate number separator characters."
msgstr "数字。 这与 ``'d'`` 相似,不同之处在于它会使用当前区域设置来插入适当的数字分隔字符。"
#: ../../library/string.rst:472
msgid "The same as ``'d'``."
msgstr "和 ``'d'`` 相同。"
#: ../../library/string.rst:475
msgid ""
"In addition to the above presentation types, integers can be formatted with "
"the floating point presentation types listed below (except ``'n'`` and "
"``None``). When doing so, :func:`float` is used to convert the integer to a "
"floating point number before formatting."
msgstr ""
"在上述的表示类型之外,整数还可以通过下列的浮点表示类型来格式化 (除了 ``'n'`` 和 ``None``)。 当这样做时,会在格式化之前使用 "
":func:`float` 将整数转换为浮点数。"
#: ../../library/string.rst:480
msgid ""
"The available presentation types for floating point and decimal values are:"
msgstr "浮点数和小数值可用的表示类型有:"
#: ../../library/string.rst:485
msgid "``'e'``"
msgstr "``'e'``"
#: ../../library/string.rst:485
msgid ""
"Exponent notation. Prints the number in scientific notation using the letter"
" 'e' to indicate the exponent. The default precision is ``6``."
msgstr "指数表示。 以使用字母 'e' 来标示指数的科学计数法打印数字。 默认的精度为 ``6``。"
#: ../../library/string.rst:489
msgid "``'E'``"
msgstr "``'E'``"
#: ../../library/string.rst:489
msgid ""
"Exponent notation. Same as ``'e'`` except it uses an upper case 'E' as the "
"separator character."
msgstr "指数表示。 与 ``'e'`` 相似,不同之处在于它使用大写字母 'E' 作为分隔字符。"
#: ../../library/string.rst:492
msgid "``'f'``"
msgstr "``'f'``"
#: ../../library/string.rst:492
msgid ""
"Fixed-point notation. Displays the number as a fixed-point number. The "
"default precision is ``6``."
msgstr "定点表示。 将数字显示为一个定点数。 默认的精确度为 ``6``。"
#: ../../library/string.rst:495
msgid "``'F'``"
msgstr "``'F'``"
#: ../../library/string.rst:495
msgid ""
"Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and "
"``inf`` to ``INF``."
msgstr "定点表示。 与 ``'f'`` 相似,但会将 ``nan`` 转为 ``NAN`` 并将 ``inf`` 转为 ``INF``。"
#: ../../library/string.rst:498
msgid "``'g'``"
msgstr "``'g'``"
#: ../../library/string.rst:498
msgid ""
"General format. For a given precision ``p >= 1``, this rounds the number to"
" ``p`` significant digits and then formats the result in either fixed-point "
"format or in scientific notation, depending on its magnitude."
msgstr ""
"常规格式。 对于给定的精度 ``p >= 1``,这会将数值舍入到 ``p`` "
"位有效数字,再将结果以定点格式或科学计数法进行格式化,具体取决于其值的大小。"
#: ../../library/string.rst:503
msgid ""
"The precise rules are as follows: suppose that the result formatted with "
"presentation type ``'e'`` and precision ``p-1`` would have exponent ``exp``."
" Then if ``-4 <= exp < p``, the number is formatted with presentation type "
"``'f'`` and precision ``p-1-exp``. Otherwise, the number is formatted with "
"presentation type ``'e'`` and precision ``p-1``. In both cases insignificant"
" trailing zeros are removed from the significand, and the decimal point is "
"also removed if there are no remaining digits following it, unless the "
"``'#'`` option is used."
msgstr ""
"准确的规则如下:假设使用表示类型 ``'e'`` 和精度 ``p-1`` 进行格式化的结果具有指数值 ``exp``。 则如果 ``-4 <= exp "
"< p``,该数字将使用表示类型 ``'f'`` 和精度 ``p-1-exp`` 进行格式化。 否则的话,该数字将使用表示类型 ``'e'`` 和精度 "
"``p-1`` 进行格式化。 在两种情况下,都会从有效数字中移除无意义的末尾零,并且如果小数点之后没有数字则小数点也会被移除,除非使用了 ``'#'``"
" 选项。"
#: ../../library/string.rst:515
msgid ""
"Positive and negative infinity, positive and negative zero, and nans, are "
"formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, "
"regardless of the precision."
msgstr ""
"正负无穷,正负零和 nan 会分别被格式化为 ``inf``, ``-inf``, ``0``, ``-0`` 和 ``nan``,无论精度如何设定。"
#: ../../library/string.rst:520
msgid ""
"A precision of ``0`` is treated as equivalent to a precision of ``1``. The "
"default precision is ``6``."
msgstr "精度 ``0`` 会被视为等同于精度 ``1``。 默认精度为 ``6``。"
#: ../../library/string.rst:523
msgid "``'G'``"
msgstr "``'G'``"
#: ../../library/string.rst:523
msgid ""
"General format. Same as ``'g'`` except switches to ``'E'`` if the number "
"gets too large. The representations of infinity and NaN are uppercased, too."
msgstr "常规格式。 类似于 ``'g'``,不同之处在于当数值非常大时会切换为 ``'E'``。 无穷与 NaN 也会表示为大写形式。"
#: ../../library/string.rst:527
msgid ""
"Number. This is the same as ``'g'``, except that it uses the current locale "
"setting to insert the appropriate number separator characters."
msgstr "数字。 这与 ``'g'`` 相似,不同之处在于它会使用当前区域设置来插入适当的数字分隔字符。"
#: ../../library/string.rst:531
msgid "``'%'``"
msgstr "``'%'``"
#: ../../library/string.rst:531
msgid ""
"Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) "
"format, followed by a percent sign."
msgstr "百分比。 将数字乘以 100 并显示为定点 (``'f'``) 格式,后面带一个百分号。"
#: ../../library/string.rst:534
msgid ""
"Similar to ``'g'``, except that fixed-point notation, when used, has at "
"least one digit past the decimal point. The default precision is as high as "
"needed to represent the particular value. The overall effect is to match the"
" output of :func:`str` as altered by the other format modifiers."
msgstr ""
"类似于 ``'g'``,不同之处在于当使用定点表示法时,小数点后将至少显示一位。 默认精度与表示给定值所需的精度一样。 "
"整体效果为与其他格式修饰符所调整的 :func:`str` 输出保持一致。"
#: ../../library/string.rst:546
msgid "Format examples"
msgstr "格式示例"
#: ../../library/string.rst:548
msgid ""
"This section contains examples of the :meth:`str.format` syntax and "
"comparison with the old ``%``-formatting."
msgstr "本节包含 :meth:`str.format` 语法的示例以及与旧式 ``%`` 格式化的比较。"
#: ../../library/string.rst:551
msgid ""
"In most of the cases the syntax is similar to the old ``%``-formatting, with"
" the addition of the ``{}`` and with ``:`` used instead of ``%``. For "
"example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``."
msgstr ""
"该语法在大多数情况下与旧式的 ``%`` 格式化类似,只是增加了 ``{}`` 和 ``:`` 来取代 ``%``。 例如,,``'%03.2f'`` "
"可以被改写为 ``'{:03.2f}'``。"
#: ../../library/string.rst:555
msgid ""
"The new format syntax also supports new and different options, shown in the "
"following examples."
msgstr "新的格式语法还支持新增的不同选项,将在以下示例中说明。"
#: ../../library/string.rst:558
msgid "Accessing arguments by position::"
msgstr "按位置访问参数::"
#: ../../library/string.rst:571
msgid "Accessing arguments by name::"
msgstr "按名称访问参数::"
#: ../../library/string.rst:579
msgid "Accessing arguments' attributes::"
msgstr "访问参数的属性::"
#: ../../library/string.rst:594
msgid "Accessing arguments' items::"
msgstr "访问参数的项::"
#: ../../library/string.rst:600
msgid "Replacing ``%s`` and ``%r``::"
msgstr "替代 ``%s`` 和 ``%r``::"
#: ../../library/string.rst:605
msgid "Aligning the text and specifying a width::"
msgstr "对齐文本以及指定宽度::"
#: ../../library/string.rst:616
msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::"
msgstr "替代 ``%+f``, ``%-f`` 和 ``% f`` 以及指定正负号::"
#: ../../library/string.rst:625
msgid ""
"Replacing ``%x`` and ``%o`` and converting the value to different bases::"
msgstr "替代 ``%x`` 和 ``%o`` 以及转换基于不同进位制的值::"
#: ../../library/string.rst:634
msgid "Using the comma as a thousands separator::"
msgstr "使用逗号作为千位分隔符::"
#: ../../library/string.rst:639
msgid "Expressing a percentage::"
msgstr "表示为百分数::"
#: ../../library/string.rst:646
msgid "Using type-specific formatting::"
msgstr "使用特定类型的专属格式化::"
#: ../../library/string.rst:653
msgid "Nesting arguments and more complex examples::"
msgstr "嵌套参数以及更复杂的示例::"
#: ../../library/string.rst:687
msgid "Template strings"
msgstr "模板字符串"
#: ../../library/string.rst:689
msgid ""
"Template strings provide simpler string substitutions as described in "
":pep:`292`. A primary use case for template strings is for "
"internationalization (i18n) since in that context, the simpler syntax and "
"functionality makes it easier to translate than other built-in string "
"formatting facilities in Python. As an example of a library built on "
"template strings for i18n, see the `flufl.i18n "
"<http://flufli18n.readthedocs.io/en/latest/>`_ package."
msgstr ""
"模板字符串提供了由 :pep:`292` 所描述的更简便的字符串替换方式。 模板字符串的一个主要用例是文本国际化 "
"(i18n),因为在此场景下,更简单的语法和功能使得文本翻译过程比使用 Python 的其他内置字符串格式化工具更为方便。 作为基于模板字符串构建以实现"
" i18n 的库的一个示例,请参看 `flufl.i18n <http://flufli18n.readthedocs.io/en/latest/>`_"
" 包。"
#: ../../library/string.rst:699
msgid ""
"Template strings support ``$``-based substitutions, using the following "
"rules:"
msgstr "模板字符串支持基于 ``$`` 的替换,使用以下规则:"
#: ../../library/string.rst:701
msgid "``$$`` is an escape; it is replaced with a single ``$``."
msgstr "``$$`` 为转义符号;它会被替换为单个的 ``$``。"
#: ../../library/string.rst:703
msgid ""
"``$identifier`` names a substitution placeholder matching a mapping key of "
"``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any "
"case-insensitive ASCII alphanumeric string (including underscores) that "
"starts with an underscore or ASCII letter. The first non-identifier "
"character after the ``$`` character terminates this placeholder "
"specification."
msgstr ""
"``$identifier`` 为替换占位符,它会匹配一个名为 ``\"identifier\"`` 的映射键。 "
"在默认情况下,``\"identifier\"`` 限制为任意 ASCII 字母数字(包括下划线)组成的字符串,不区分大小写,以下划线或 ASCII "
"字母开头。 在 ``$`` 字符之后的第一个非标识符字符将表明占位符的终结。"
#: ../../library/string.rst:710
msgid ""
"``${identifier}`` is equivalent to ``$identifier``. It is required when "
"valid identifier characters follow the placeholder but are not part of the "
"placeholder, such as ``\"${noun}ification\"``."
msgstr ""
"``${identifier}`` 等价于 ``$identifier``。 当占位符之后紧跟着有效的但又不是占位符一部分的标识符字符时需要使用,例如 "
"``\"${noun}ification\"``。"
#: ../../library/string.rst:714
msgid ""