@@ -25,7 +25,7 @@ msgstr ""
25
25
26
26
#: ../../howto/enum.rst:3
27
27
msgid "Enum HOWTO"
28
- msgstr ""
28
+ msgstr "列挙型 HOWTO "
29
29
30
30
#: ../../howto/enum.rst:0
31
31
msgid "Author"
@@ -45,12 +45,17 @@ msgid ""
45
45
"are similar to global variables, but they offer a more useful :func:"
46
46
"`repr()`, grouping, type-safety, and a few other features."
47
47
msgstr ""
48
+ ":class:`Enum` は、ユニークな値に束縛されたシンボル名の集合です。グローバル変"
49
+ "数に似ていますが、 :func:`repr()` がより便利だったり、グルーピングの機能、型"
50
+ "安全などいくつかの機能があります。"
48
51
49
52
#: ../../howto/enum.rst:18
50
53
msgid ""
51
54
"They are most useful when you have a variable that can take one of a limited "
52
55
"selection of values. For example, the days of the week::"
53
56
msgstr ""
57
+ "これらは、限られた選択肢の値の一つを取る変数がある場合に便利です。例えば、曜"
58
+ "日情報があります:"
54
59
55
60
#: ../../howto/enum.rst:31
56
61
msgid ""
@@ -60,13 +65,16 @@ msgstr ""
60
65
61
66
#: ../../howto/enum.rst:34
62
67
msgid "Case of Enum Members"
63
- msgstr ""
68
+ msgstr "Enumメンバーは大文字/小文字? "
64
69
65
70
#: ../../howto/enum.rst:36
66
71
msgid ""
67
72
"Because Enums are used to represent constants we recommend using UPPER_CASE "
68
73
"names for members, and will be using that style in our examples."
69
74
msgstr ""
75
+ "Enumクラス群は定数を表現するために使われるため、メンバーの名前にはUPPER_CASE"
76
+ "を使うことを推奨します。本ページのドキュメントのサンプルでもそのスタイルを採"
77
+ "用します。"
70
78
71
79
#: ../../howto/enum.rst:39
72
80
msgid ""
@@ -242,6 +250,8 @@ msgstr ""
242
250
msgid ""
243
251
"The :meth:`_generate_next_value_` method must be defined before any members."
244
252
msgstr ""
253
+ ":meth:`_generate_next_value_` メソッドは他のメンバーよりも前に定義される必要"
254
+ "があります。"
245
255
246
256
#: ../../howto/enum.rst:297
247
257
msgid "Iteration"
@@ -344,17 +354,23 @@ msgid ""
344
354
"then any value(s) given to the enum member will be passed into those "
345
355
"methods. See `Planet`_ for an example."
346
356
msgstr ""
357
+ "注意: 列挙型で :meth:`__new__` および/または :meth:`__init__` を定義した場"
358
+ "合、列挙型メンバーに与えられた値はすべてこれらのメソッドに渡されます。例 "
359
+ "`Planet`_ を参照してください。"
347
360
348
361
#: ../../howto/enum.rst:411
349
362
msgid "Restricted Enum subclassing"
350
- msgstr ""
363
+ msgstr "Enumのサブクラス化の制限 "
351
364
352
365
#: ../../howto/enum.rst:413
353
366
msgid ""
354
367
"A new :class:`Enum` class must have one base enum class, up to one concrete "
355
368
"data type, and as many :class:`object`-based mixin classes as needed. The "
356
369
"order of these base classes is::"
357
370
msgstr ""
371
+ "新しい :class:`Enum` クラスは、ベースの enum クラスを1つ、具象データ型を1つ、"
372
+ "複数の :class:`object` ベースのミックスインクラスが許容されます。これらのベー"
373
+ "スクラスの順序は次の通りです::"
358
374
359
375
#: ../../howto/enum.rst:420
360
376
msgid ""
@@ -411,6 +427,8 @@ msgid ""
411
427
"It is possible to modify how enum members are pickled/unpickled by defining :"
412
428
"meth:`__reduce_ex__` in the enumeration class."
413
429
msgstr ""
430
+ "enum のメンバーをどう pickle 化/unpickle 化するかは、列挙型クラス内の :meth:"
431
+ "`__reduce_ex__` で定義することで変更できます。"
414
432
415
433
#: ../../howto/enum.rst:471
416
434
msgid "Functional API"
@@ -502,7 +520,7 @@ msgstr "value"
502
520
503
521
#: ../../howto/enum.rst:541
504
522
msgid "What the new enum class will record as its name."
505
- msgstr ""
523
+ msgstr "新しい enum クラスに記録されるそれ自身の名前です。 "
506
524
507
525
#: ../../howto/enum.rst:0
508
526
msgid "names"
@@ -532,23 +550,23 @@ msgstr "module"
532
550
533
551
#: ../../howto/enum.rst:560
534
552
msgid "name of module where new enum class can be found."
535
- msgstr ""
553
+ msgstr "新しい enum クラスが属するモジュールの名前です。 "
536
554
537
555
#: ../../howto/enum.rst:0
538
556
msgid "qualname"
539
557
msgstr "qualname"
540
558
541
559
#: ../../howto/enum.rst:562
542
560
msgid "where in module new enum class can be found."
543
- msgstr ""
561
+ msgstr "新しい enum クラスが属するモジュールの場所です。 "
544
562
545
563
#: ../../howto/enum.rst:0
546
564
msgid "type"
547
565
msgstr "type"
548
566
549
567
#: ../../howto/enum.rst:564
550
568
msgid "type to mix in to new enum class."
551
- msgstr ""
569
+ msgstr "新しい enum クラスに複合されるデータ型です。 "
552
570
553
571
#: ../../howto/enum.rst:0
554
572
msgid "start"
@@ -595,7 +613,7 @@ msgstr ":class:`IntEnum` の値は他の用途では整数のように振る舞
595
613
596
614
#: ../../howto/enum.rst:623
597
615
msgid "StrEnum"
598
- msgstr ""
616
+ msgstr "StrEnum "
599
617
600
618
#: ../../howto/enum.rst:625
601
619
msgid ""
@@ -631,6 +649,8 @@ msgid ""
631
649
"Any operation on an :class:`IntFlag` member besides the bit-wise operations "
632
650
"will lose the :class:`IntFlag` membership."
633
651
msgstr ""
652
+ ":class:`IntFlag` メンバーに対してビット演算以外のどんな演算をしても、その結果"
653
+ "は :class:`IntFlag` メンバーではなくなります。"
634
654
635
655
#: ../../howto/enum.rst:657
636
656
msgid ""
@@ -789,6 +809,10 @@ msgid ""
789
809
"`int` above. This restriction does not apply to mix-ins which only add "
790
810
"methods and don't specify another type."
791
811
msgstr ""
812
+ ":class:`Enum` のメンバーはどんなデータ型でも構いませんが、追加のデータ型 (例"
813
+ "えば、上の例の :class:`int`) と複合させてしまうと、すべてのメンバーの値はその"
814
+ "データ型でなければならなくなります。この制限は、メソッドの追加するだけの、他"
815
+ "のデータ型を指定しない複合には適用されません。"
792
816
793
817
#: ../../howto/enum.rst:826
794
818
msgid ""
@@ -822,20 +846,25 @@ msgstr ""
822
846
823
847
#: ../../howto/enum.rst:840
824
848
msgid "When to use :meth:`__new__` vs. :meth:`__init__`"
825
- msgstr ""
849
+ msgstr ":meth:`__init__` と :meth:`__init__` のどちらを使うべきか "
826
850
827
851
#: ../../howto/enum.rst:842
828
852
msgid ""
829
853
":meth:`__new__` must be used whenever you want to customize the actual value "
830
854
"of the :class:`Enum` member. Any other modifications may go in either :meth:"
831
855
"`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred."
832
856
msgstr ""
857
+ ":meth:`__new__` は :class:`Enum` メンバーの実際の値をカスタマイズしたいときに"
858
+ "利用します。他の変更を加える場合、 :meth:`__new__` と :meth:`__init__` のどち"
859
+ "らを利用するかは、:meth:`__init__` の方が望ましいでしょう。"
833
860
834
861
#: ../../howto/enum.rst:846
835
862
msgid ""
836
863
"For example, if you want to pass several items to the constructor, but only "
837
864
"want one of them to be the value::"
838
865
msgstr ""
866
+ "例えば、複数の値をコンストラクタに渡すが、その中の1つだけを値として使いたい場"
867
+ "合は次のようにします:"
839
868
840
869
#: ../../howto/enum.rst:873
841
870
msgid "Finer Points"
@@ -909,6 +938,9 @@ msgid ""
909
938
"``_generate_next_value_`` -- used by the `Functional API`_ and by :class:"
910
939
"`auto` to get an appropriate value for an enum member; may be overridden"
911
940
msgstr ""
941
+ "``_generate_next_value_`` -- `Functional API`_ から利用され、 :class:`auto` "
942
+ "が列挙型のメンバーの適切な値を取得するのに使われます。オーバーライドされま"
943
+ "す。"
912
944
913
945
#: ../../howto/enum.rst:905
914
946
msgid ""
@@ -936,16 +968,21 @@ msgid ""
936
968
"can be provided. It will be checked against the actual order of the "
937
969
"enumeration and raise an error if the two do not match::"
938
970
msgstr ""
971
+ "Pythono 2 / Python 3のコードの同期を取りやすくするために :attr:`_order_` 属性"
972
+ "を提供できます。実際の列挙値の順序と比較して一致してなければエラーを送出しま"
973
+ "す::"
939
974
940
975
#: ../../howto/enum.rst:932
941
976
msgid ""
942
977
"In Python 2 code the :attr:`_order_` attribute is necessary as definition "
943
978
"order is lost before it can be recorded."
944
979
msgstr ""
980
+ "Python 2のコードでは :attr:`_order_` 属性は定義順が記録される前消えてしまうた"
981
+ "め、重要です。"
945
982
946
983
#: ../../howto/enum.rst:937
947
984
msgid "_Private__names"
948
- msgstr ""
985
+ msgstr "_Private__names "
949
986
950
987
#: ../../howto/enum.rst:939
951
988
msgid ""
@@ -989,6 +1026,11 @@ msgid ""
989
1026
"enum's boolean evaluation depend on the member's value add the following to "
990
1027
"your class::"
991
1028
msgstr ""
1029
+ "(:class:`int`, :class:`str` などのような) 非 :class:`Enum` 型と複合させた "
1030
+ "enum クラスは、その複合された型の規則に従って評価されます;\n"
1031
+ "そうでない場合は、全てのメンバーは :data:`True` と評価されます。\n"
1032
+ "メンバーの値に依存する独自の enum の真偽値評価を行うには、クラスに次のコード"
1033
+ "を追加してください::"
992
1034
993
1035
#: ../../howto/enum.rst:993
994
1036
msgid "Plain :class:`Enum` classes always evaluate as :data:`True`."
@@ -1128,6 +1170,8 @@ msgid ""
1128
1170
"Enums have a custom metaclass that affects many aspects of both derived :"
1129
1171
"class:`Enum` classes and their instances (members)."
1130
1172
msgstr ""
1173
+ "Enum は :class:`Enum` 派生クラスやそれらのインスタンス (メンバー) 双方の多く"
1174
+ "の側面に影響を及ぼすカスタムメタクラスを持っています。"
1131
1175
1132
1176
#: ../../howto/enum.rst:1123
1133
1177
msgid "Enum Classes"
@@ -1156,6 +1200,10 @@ msgid ""
1156
1200
"new ones are ever instantiated by returning only the existing member "
1157
1201
"instances."
1158
1202
msgstr ""
1203
+ "enum メンバーについて最も興味深いのは、それらがシングルトンであるということで"
1204
+ "す。:class:`EnumType` は enum クラス自身を作成し、メンバーを作成し、新しいイ"
1205
+ "ンスタンスが作成されていないかどうかを確認するために既存のメンバーインスタン"
1206
+ "スだけを返すカスタム :meth:`__new__` を追加します。"
1159
1207
1160
1208
#: ../../howto/enum.rst:1146
1161
1209
msgid ""
@@ -1164,6 +1212,10 @@ msgid ""
1164
1212
"cover them all. Here are recipes for some different types of enumerations "
1165
1213
"that can be used directly, or as examples for creating one's own."
1166
1214
msgstr ""
1215
+ ":class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, :class:"
1216
+ "`IntFlag` は用途の大部分をカバーすると予想されますが、そのすべてをカバーでき"
1217
+ "ているわけではありません。ここでは、そのまま、あるいは独自の列挙型を作る例と"
1218
+ "して使える、様々なタイプの列挙型を紹介します。"
1167
1219
1168
1220
#: ../../howto/enum.rst:1153
1169
1221
msgid "Omitting values"
@@ -1244,12 +1296,16 @@ msgid ""
1244
1296
"To make a more general purpose ``AutoNumber``, add ``*args`` to the "
1245
1297
"signature::"
1246
1298
msgstr ""
1299
+ "``AutoNumber`` をより広い用途で使うには、シグニチャに ``*args`` を追加しま"
1300
+ "す::"
1247
1301
1248
1302
#: ../../howto/enum.rst:1245
1249
1303
msgid ""
1250
1304
"Then when you inherit from ``AutoNumber`` you can write your own "
1251
1305
"``__init__`` to handle any extra arguments::"
1252
1306
msgstr ""
1307
+ "``AutoNumber`` を継承すると、追加の引数を取り扱える独自の ``__init__`` が書け"
1308
+ "ます。"
1253
1309
1254
1310
#: ../../howto/enum.rst:1264
1255
1311
msgid ""
@@ -1309,11 +1365,11 @@ msgstr ""
1309
1365
1310
1366
#: ../../howto/enum.rst:1370
1311
1367
msgid "TimePeriod"
1312
- msgstr ""
1368
+ msgstr "TimePeriod "
1313
1369
1314
1370
#: ../../howto/enum.rst:1372
1315
1371
msgid "An example to show the :attr:`_ignore_` attribute in use::"
1316
- msgstr ""
1372
+ msgstr ":attr:`_ignore_` 属性の使用方法のサンプルです:: "
1317
1373
1318
1374
#: ../../howto/enum.rst:1389
1319
1375
msgid "Conforming input to Flag"
@@ -1328,7 +1384,7 @@ msgstr ""
1328
1384
1329
1385
#: ../../howto/enum.rst:1411
1330
1386
msgid "Subclassing EnumType"
1331
- msgstr ""
1387
+ msgstr "EnumType をサブクラス化する "
1332
1388
1333
1389
#: ../../howto/enum.rst:1413
1334
1390
msgid ""
0 commit comments