5
5
#
6
6
# Translators:
7
7
# tomo, 2018
8
+ # Osamu NAKAMURA, 2019
8
9
#
9
10
#, fuzzy
10
11
msgid ""
@@ -13,7 +14,7 @@ msgstr ""
13
14
"Report-Msgid-Bugs-To :\n "
14
15
"POT-Creation-Date :2019-01-01 15:22+0900\n "
15
16
"PO-Revision-Date :2018-06-29 17:45+0000\n "
16
- "Last-Translator :tomo, 2018 \n "
17
+ "Last-Translator :Osamu NAKAMURA, 2019 \n "
17
18
"Language-Team :Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n "
18
19
"MIME-Version :1.0\n "
19
20
"Content-Type :text/plain; charset=UTF-8\n "
@@ -307,6 +308,8 @@ msgid ""
307
308
"to that directory and fire up Python --- you should be able to ``import "
308
309
"custom`` and play around with Custom objects."
309
310
msgstr ""
311
+ "すると :file:`custom.so` ファイルがサブディレクトリに生成されます。そのディレクトリに移動して、Pythonを起動します -- これで"
312
+ " ``import custom`` して、Custom オブジェクトで遊べるようになっているはずです。"
310
313
311
314
#: ../../extending/newtypes_tutorial.rst:210
312
315
msgid "That wasn't so hard, was it?"
@@ -317,6 +320,7 @@ msgid ""
317
320
"Of course, the current Custom type is pretty uninteresting. It has no data "
318
321
"and doesn't do anything. It can't even be subclassed."
319
322
msgstr ""
323
+ "もちろん、現在の Custom 型は面白みに欠けています。何もデータを持っていないし、何もできません。継承してサブクラスを作ることさえできないのです。"
320
324
321
325
#: ../../extending/newtypes_tutorial.rst:216
322
326
msgid ""
@@ -327,6 +331,11 @@ msgid ""
327
331
"Packaging User's Guide <https://packaging.python.org/tutorials/distributing-"
328
332
"packages/>`_."
329
333
msgstr ""
334
+ "この文書では、標準の :mod:`distutils` モジュールを使って C "
335
+ "拡張をビルドしていますが、現実のユースケースでは、より新しく、保守されている ``setuptools`` "
336
+ "ライブラリを利用することを推奨します。これを行う方法を文書化することはこのドキュメントの範囲外ですので、 `Python Packaging "
337
+ "User's Guide <https://packaging.python.org/tutorials/distributing-"
338
+ "packages/>`_ を参照してください。"
330
339
331
340
#: ../../extending/newtypes_tutorial.rst:224
332
341
msgid "Adding data and methods to the Basic example"
@@ -338,6 +347,8 @@ msgid ""
338
347
"make the type usable as a base class. We'll create a new module, "
339
348
":mod:`custom2` that adds these capabilities:"
340
349
msgstr ""
350
+ "この基本のサンプルにデータとメソッドを追加してみましょう。ついでに、この型を基底クラスとしても利用できるようにします。ここでは新しいモジュール "
351
+ ":mod:`custom2` をつくり、これらの機能を追加します:"
341
352
342
353
#: ../../extending/newtypes_tutorial.rst:233
343
354
msgid "This version of the module has a number of changes."
@@ -360,6 +371,9 @@ msgid ""
360
371
"strings containing first and last names. The *number* attribute is a C "
361
372
"integer."
362
373
msgstr ""
374
+ ":class:`Custom` 型は そのC構造体に 3つのデータ属性 *first* 、 *last* 、および *number* "
375
+ "をもつようになりました。 *first* と *last* 属性はファーストネームとラストネームを格納した Python 文字列で、 *number* "
376
+ "属性は (C言語の) 整数の値です。"
363
377
364
378
#: ../../extending/newtypes_tutorial.rst:246
365
379
msgid "The object structure is updated accordingly::"
@@ -386,6 +400,11 @@ msgid ""
386
400
" might not be :class:`CustomType`, because the object may be an instance of "
387
401
"a subclass."
388
402
msgstr ""
403
+ "このメソッドは、まず二つのPython 属性の参照カウントをクリアします。 :c:func:`Py_XDECREF` は引数が *NULL* "
404
+ "のケースを正しく扱えます( これは、``tp_new`` が途中で失敗した場合に起こりえます)。つぎにオブジェクトの型 "
405
+ "(``Py_TYPE(self)`` で算出します)のメンバ :c:member:`~PyTypeObject.tp_free` "
406
+ "を呼び出し、オブジェクトのメモリを開放します。オブジェクトはサブクラスのインスタンスかもしれず、その場合オブジェクトの型が "
407
+ ":class:`CustomType` とは限らない点に注意してください。"
389
408
390
409
#: ../../extending/newtypes_tutorial.rst:279
391
410
msgid ""
@@ -400,7 +419,7 @@ msgstr ""
400
419
msgid ""
401
420
"We want to make sure that the first and last names are initialized to empty "
402
421
"strings, so we provide a ``tp_new`` implementation::"
403
- msgstr ""
422
+ msgstr "ファーストネームとラストネームを空文字列に初期化しておきたいので、``tp_new`` の実装を追加することにしましょう:: "
404
423
405
424
#: ../../extending/newtypes_tutorial.rst:309
406
425
msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::"
@@ -431,19 +450,22 @@ msgstr ""
431
450
msgid ""
432
451
"``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do"
433
452
" it itself."
434
- msgstr ""
453
+ msgstr "``tp_new`` は明示的に ``tp_init`` を呼び出してはいけません、これはインタープリタが自分で行うためです。 "
435
454
436
455
#: ../../extending/newtypes_tutorial.rst:332
437
456
msgid ""
438
457
"The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` "
439
458
"slot to allocate memory::"
440
459
msgstr ""
460
+ "この ``tp_new`` の実装は、:c:member:`~PyTypeObject.tp_alloc` スロットを呼び出してメモリを割り当てます::"
441
461
442
462
#: ../../extending/newtypes_tutorial.rst:337
443
463
msgid ""
444
464
"Since memory allocation may fail, we must check the "
445
465
":c:member:`~PyTypeObject.tp_alloc` result against *NULL* before proceeding."
446
466
msgstr ""
467
+ "メモリ割り当ては失敗するかもしれないので、先に進む前に :c:member:`~PyTypeObject.tp_alloc` "
468
+ "の結果がNULLでないかチェックする必要があります。"
447
469
448
470
#: ../../extending/newtypes_tutorial.rst:341
449
471
msgid ""
@@ -521,7 +543,7 @@ msgstr ""
521
543
522
544
#: ../../extending/newtypes_tutorial.rst:420
523
545
msgid "when we absolutely know that the reference count is greater than 1;"
524
- msgstr ""
546
+ msgstr "その参照カウントが 1 より大きいと確信できる場合 "
525
547
526
548
#: ../../extending/newtypes_tutorial.rst:422
527
549
msgid ""
@@ -575,6 +597,8 @@ msgid ""
575
597
"We define a single method, :meth:`Custom.name()`, that outputs the objects "
576
598
"name as the concatenation of the first and last names. ::"
577
599
msgstr ""
600
+ "ここでは :meth:`Custom.name()` と呼ばれるメソッドを定義しましょう。これはファーストネーム first とラストネーム last "
601
+ "を連結した文字列をそのオブジェクトの名前として返します。 ::"
578
602
579
603
#: ../../extending/newtypes_tutorial.rst:473
580
604
msgid ""
@@ -585,6 +609,9 @@ msgid ""
585
609
" to accept a positional argument tuple or keyword argument dictionary. This "
586
610
"method is equivalent to the Python method:"
587
611
msgstr ""
612
+ "このメソッドは C 関数として実装され、 :class:`Custom` (あるいは :class:`Custom` のサブクラス) "
613
+ "のインスタンスを第一引数として受けとります。メソッドはつねにそのインスタンスを最初の引数として受けとらなければなりません。しばしば位置引数とキーワード引数も受けとりますが、今回はなにも必要ないので、固定引数のタプルもキーワード引数の辞書も取らないことにします。このメソッドは"
614
+ " Python の以下のメソッドと等価です:"
588
615
589
616
#: ../../extending/newtypes_tutorial.rst:485
590
617
msgid ""