Skip to content

Commit a73f666

Browse files
Update translation
Co-Authored-By: Rafael Fontenelle <rffontenelle@gmail.com> Co-Authored-By: Rainer Terroso
1 parent 05568aa commit a73f666

File tree

7 files changed

+344
-24
lines changed

7 files changed

+344
-24
lines changed

extending/newtypes_tutorial.po

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ msgid ""
1212
msgstr ""
1313
"Project-Id-Version: Python 3.12\n"
1414
"Report-Msgid-Bugs-To: \n"
15-
"POT-Creation-Date: 2025-11-17 15:56+0000\n"
15+
"POT-Creation-Date: 2025-11-19 16:35+0000\n"
1616
"PO-Revision-Date: 2025-07-18 19:57+0000\n"
1717
"Last-Translator: Rainer Terroso, 2025\n"
1818
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/"
@@ -779,6 +779,13 @@ msgid ""
779779
"object's type might not be :class:`!CustomType`, because the object may be "
780780
"an instance of a subclass."
781781
msgstr ""
782+
"Esse método primeiro limpa a contagem de referências dos dois atributos "
783+
"Python. :c:func:`Py_XDECREF`lida corretamente com o caso em que seu "
784+
"argumento é ``NULL`` (o que pode acontecer aqui se ``tp_new`` falhou no meio "
785+
"do processo). Em seguida, ele chama o membro :c:member:`~PyTypeObject."
786+
"tp_free` do tipo do objeto (obtido por ``Py_TYPE(self)``) para liberar a "
787+
"memória do objeto. Observe que o tipo do objeto pode não ser :class:`!"
788+
"CustomType`, pois o objeto pode ser uma instância de uma subclasse."
782789

783790
#: ../../extending/newtypes_tutorial.rst:275
784791
msgid ""
@@ -794,6 +801,9 @@ msgid ""
794801
"We want to make sure that the first and last names are initialized to empty "
795802
"strings, so we provide a ``tp_new`` implementation::"
796803
msgstr ""
804+
"Queremos nos certificar de que o primeiro e o último nome sejam "
805+
"inicializados como strings vazias, portanto, fornecemos uma implementação:: "
806+
"``tp_new`` "
797807

798808
#: ../../extending/newtypes_tutorial.rst:284
799809
msgid ""
@@ -818,14 +828,34 @@ msgid ""
818828
" return (PyObject *) self;\n"
819829
"}"
820830
msgstr ""
831+
"static PyObject *\n"
832+
"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n"
833+
"{\n"
834+
"CustomObject *self;\n"
835+
"self = (CustomObject *) type->tp_alloc(type, 0);\n"
836+
"if (self != NULL) {\n"
837+
"self->first = PyUnicode_FromString(\"\");\n"
838+
"if (self->first == NULL) {\n"
839+
"Py_DECREF(self);\n"
840+
"return NULL;\n"
841+
"}\n"
842+
"self->last = PyUnicode_FromString(\"\");\n"
843+
"if (self->last == NULL) {\n"
844+
"Py_DECREF(self);\n"
845+
"return NULL;\n"
846+
"}\n"
847+
"self->number = 0;\n"
848+
"}\n"
849+
"return (PyObject *) self;\n"
850+
"}"
821851

822852
#: ../../extending/newtypes_tutorial.rst:305
823853
msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::"
824-
msgstr ""
854+
msgstr "e instale-o no membro:: :c:member:`~PyTypeObject.tp_new`"
825855

826856
#: ../../extending/newtypes_tutorial.rst:307
827857
msgid ".tp_new = Custom_new,"
828-
msgstr ""
858+
msgstr ".tp_new = Custom_new,"
829859

830860
#: ../../extending/newtypes_tutorial.rst:309
831861
msgid ""
@@ -837,6 +867,13 @@ msgid ""
837867
"type above. In this case, we use the ``tp_new`` handler to initialize the "
838868
"``first`` and ``last`` attributes to non-``NULL`` default values."
839869
msgstr ""
870+
"O manipulador ``tp_new`` é responsável por criar (em oposição a inicializar) "
871+
"os objetos do tipo. Ele é exposto no Python como o método :meth:`~object."
872+
"__new__`. Não é obrigatório definir um membro ``tp_new`` e, de fato, muitos "
873+
"tipos de extensão simplesmente reutilizam :c:func:`PyType_GenericNew`, como "
874+
"na primeira versão do tipo :class:`!Custom` acima. Neste caso, usamos o "
875+
"manipulador ``tp_new`` para inicializar os atributos ``first`` e ``last`` "
876+
"com valores padrão que não sejam ``NULL``."
840877

841878
#: ../../extending/newtypes_tutorial.rst:317
842879
msgid ""
@@ -847,22 +884,33 @@ msgid ""
847884
"often ignore the arguments, leaving the argument handling to initializer (a."
848885
"k.a. ``tp_init`` in C or ``__init__`` in Python) methods."
849886
msgstr ""
887+
"O ``tp_new`` recebe o tipo que está sendo instanciado (não necessariamente "
888+
"``CustomType``, caso uma subclasse esteja sendo instanciada) e quaisquer "
889+
"argumentos passados quando o tipo foi chamado, e deve devolver a instância "
890+
"criada. Manipuladores ``tp_new`` sempre aceitam argumentos posicionais e "
891+
"argumentos nomeados, mas frequentemente os ignoram, deixando o tratamento "
892+
"dos argumentos para os métodos inicializadores (ou seja, ``tp_init`` em C ou "
893+
"``__init__`` em Python)."
850894

851895
#: ../../extending/newtypes_tutorial.rst:325
852896
msgid ""
853897
"``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do "
854898
"it itself."
855899
msgstr ""
900+
"``tp_new`` não deve chamar ``tp_init`` explicitamente, pois o interpretador "
901+
"fará isso por conta própria."
856902

857903
#: ../../extending/newtypes_tutorial.rst:328
858904
msgid ""
859905
"The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` "
860906
"slot to allocate memory::"
861907
msgstr ""
908+
"A implementação de ``tp_new`` chama o slot :c:member:`~PyTypeObject."
909+
"tp_alloc` para alocar memória::"
862910

863911
#: ../../extending/newtypes_tutorial.rst:331
864912
msgid "self = (CustomObject *) type->tp_alloc(type, 0);"
865-
msgstr ""
913+
msgstr "self = (CustomObject *) type->tp_alloc(type, 0);"
866914

867915
#: ../../extending/newtypes_tutorial.rst:333
868916
msgid ""

howto/urllib2.po

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2025-02-21 14:51+0000\n"
14+
"POT-Creation-Date: 2025-11-19 16:35+0000\n"
1515
"PO-Revision-Date: 2025-07-18 19:57+0000\n"
1616
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n"
1717
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/"
@@ -566,6 +566,9 @@ msgid ""
566566
"of response codes in that shows all the response codes used by :rfc:`2616`. "
567567
"The dictionary is reproduced here for convenience ::"
568568
msgstr ""
569+
":attr:`http.server.BaseHTTPRequestHandler.responses` é um dicionário útil de "
570+
"códigos de resposta que mostra todos os códigos de resposta usados ​​pela :rfc:"
571+
"`2616`. O dicionário é reproduzido aqui para sua conveniência."
569572

570573
#: ../../howto/urllib2.rst:251
571574
msgid ""
@@ -637,6 +640,73 @@ msgid ""
637640
" 505: ('HTTP Version Not Supported', 'Cannot fulfill request.'),\n"
638641
" }"
639642
msgstr ""
643+
"# Tabela mapeando códigos de resposta para mensagens. entradas têm a \n"
644+
"# forma {código: (mensagem_curta, mensagem_longa)}.\n"
645+
"responses = {\n"
646+
" 100: ('Continue', 'Request received, please continue'),\n"
647+
" 101: ('Switching Protocols',\n"
648+
" 'Switching to new protocol; obey Upgrade header'),\n"
649+
"\n"
650+
" 200: ('OK', 'Request fulfilled, document follows'),\n"
651+
" 201: ('Created', 'Document created, URL follows'),\n"
652+
" 202: ('Accepted',\n"
653+
" 'Request accepted, processing continues off-line'),\n"
654+
" 203: ('Non-Authoritative Information', 'Request fulfilled from cache'),\n"
655+
" 204: ('No Content', 'Request fulfilled, nothing follows'),\n"
656+
" 205: ('Reset Content', 'Clear input form for further input.'),\n"
657+
" 206: ('Partial Content', 'Partial content follows.'),\n"
658+
"\n"
659+
" 300: ('Multiple Choices',\n"
660+
" 'Object has several resources -- see URI list'),\n"
661+
" 301: ('Moved Permanently', 'Object moved permanently -- see URI list'),\n"
662+
" 302: ('Found', 'Object moved temporarily -- see URI list'),\n"
663+
" 303: ('See Other', 'Object moved -- see Method and URL list'),\n"
664+
" 304: ('Not Modified',\n"
665+
" 'Document has not changed since given time'),\n"
666+
" 305: ('Use Proxy',\n"
667+
" 'You must use proxy specified in Location to access this '\n"
668+
" 'resource.'),\n"
669+
" 307: ('Temporary Redirect',\n"
670+
" 'Object moved temporarily -- see URI list'),\n"
671+
"\n"
672+
" 400: ('Bad Request',\n"
673+
" 'Bad request syntax or unsupported method'),\n"
674+
" 401: ('Unauthorized',\n"
675+
" 'No permission -- see authorization schemes'),\n"
676+
" 402: ('Payment Required',\n"
677+
" 'No payment -- see charging schemes'),\n"
678+
" 403: ('Forbidden',\n"
679+
" 'Request forbidden -- authorization will not help'),\n"
680+
" 404: ('Not Found', 'Nothing matches the given URI'),\n"
681+
" 405: ('Method Not Allowed',\n"
682+
" 'Specified method is invalid for this server.'),\n"
683+
" 406: ('Not Acceptable', 'URI not available in preferred format.'),\n"
684+
" 407: ('Proxy Authentication Required', 'You must authenticate with '\n"
685+
" 'this proxy before proceeding.'),\n"
686+
" 408: ('Request Timeout', 'Request timed out; try again later.'),\n"
687+
" 409: ('Conflict', 'Request conflict.'),\n"
688+
" 410: ('Gone',\n"
689+
" 'URI no longer exists and has been permanently removed.'),\n"
690+
" 411: ('Length Required', 'Client must specify Content-Length.'),\n"
691+
" 412: ('Precondition Failed', 'Precondition in headers is false.'),\n"
692+
" 413: ('Request Entity Too Large', 'Entity is too large.'),\n"
693+
" 414: ('Request-URI Too Long', 'URI is too long.'),\n"
694+
" 415: ('Unsupported Media Type', 'Entity body in unsupported format.'),\n"
695+
" 416: ('Requested Range Not Satisfiable',\n"
696+
" 'Cannot satisfy request range.'),\n"
697+
" 417: ('Expectation Failed',\n"
698+
" 'Expect condition could not be satisfied.'),\n"
699+
"\n"
700+
" 500: ('Internal Server Error', 'Server got itself in trouble'),\n"
701+
" 501: ('Not Implemented',\n"
702+
" 'Server does not support this operation'),\n"
703+
" 502: ('Bad Gateway', 'Invalid responses from another server/proxy.'),\n"
704+
" 503: ('Service Unavailable',\n"
705+
" 'The server cannot process the request due to a high load'),\n"
706+
" 504: ('Gateway Timeout',\n"
707+
" 'The gateway server did not receive a timely response'),\n"
708+
" 505: ('HTTP Version Not Supported', 'Cannot fulfill request.'),\n"
709+
" }"
640710

641711
#: ../../howto/urllib2.rst:319
642712
msgid ""

library/contextvars.po

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2025-10-25 15:50+0000\n"
14+
"POT-Creation-Date: 2025-11-19 16:35+0000\n"
1515
"PO-Revision-Date: 2025-07-18 19:57+0000\n"
1616
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n"
1717
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/"
@@ -322,6 +322,31 @@ msgid ""
322322
"# However, outside of 'ctx', 'var' is still set to 'spam':\n"
323323
"# var.get() == 'spam'"
324324
msgstr ""
325+
"var = ContextVar('var')\n"
326+
"var.set('spam')\n"
327+
"\n"
328+
"def main():\n"
329+
" # 'var' foi definida para 'spam' antes de\n"
330+
" # chamarv 'copy_context()' e 'ctx.run(main)', então:\n"
331+
" # var.get() == ctx[var] == 'spam'\n"
332+
"\n"
333+
" var.set('ham')\n"
334+
"\n"
335+
" # Agora, após definir 'var' para 'ham':\n"
336+
" # var.get() == ctx[var] == 'ham'\n"
337+
"\n"
338+
"ctx = copy_context()\n"
339+
"\n"
340+
"# Qualquer alterações que a função 'main' feitas a 'var'\n"
341+
"# serão contidos em 'ctx'.\n"
342+
"ctx.run(main)\n"
343+
"\n"
344+
"# A função 'main()' era executada no contexto 'ctx',\n"
345+
"# então alterações a 'var' são contidas nela:\n"
346+
"# ctx[var] == 'ham'\n"
347+
"\n"
348+
"# Não entanto, fora de 'ctx', 'var' ainda está definida para 'spam':\n"
349+
"# var.get() == 'spam'"
325350

326351
#: ../../library/contextvars.rst:189
327352
msgid ""

library/email.examples.po

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2025-04-11 14:54+0000\n"
14+
"POT-Creation-Date: 2025-11-19 16:35+0000\n"
1515
"PO-Revision-Date: 2025-07-18 19:58+0000\n"
1616
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n"
1717
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/"
@@ -316,6 +316,89 @@ msgid ""
316316
"if __name__ == '__main__':\n"
317317
" main()\n"
318318
msgstr ""
319+
"#!/usr/bin/env python3\n"
320+
"\n"
321+
"\"\"\"Envia o conteúdo de um diretório como uma mensagem MIME.\"\"\"\n"
322+
"\n"
323+
"import os\n"
324+
"import smtplib\n"
325+
"# Para adivinhar o tipo MIME com base na extensão do nome do arquivo\n"
326+
"import mimetypes\n"
327+
"\n"
328+
"from argparse import ArgumentParser\n"
329+
"\n"
330+
"from email.message import EmailMessage\n"
331+
"from email.policy import SMTP\n"
332+
"\n"
333+
"\n"
334+
"def main():\n"
335+
" parser = ArgumentParser(description=\"\"\"\\\n"
336+
"Envia o conteúdo de um diretório como uma mensagem MIME.\n"
337+
"A menos que a opção -o seja informada, o e-mail será enviado por\n"
338+
"meio de encaminhamento para o seu servidor SMTP local, que então\n"
339+
"realiza o processo de entrega normal. Sua máquina local deve estar\n"
340+
"executando um servidor SMTP.\n"
341+
"\"\"\")\n"
342+
" parser.add_argument('-d', '--directory',\n"
343+
" help=\"\"\"Mail the contents of the specified "
344+
"directory,\n"
345+
" otherwise use the current directory. Only the "
346+
"regular\n"
347+
" files in the directory are sent, and we don't "
348+
"recurse to\n"
349+
" subdirectories.\"\"\")\n"
350+
" parser.add_argument('-o', '--output',\n"
351+
" metavar='FILE',\n"
352+
" help=\"\"\"Print the composed message to FILE "
353+
"instead of\n"
354+
" sending the message to the SMTP server.\"\"\")\n"
355+
" parser.add_argument('-s', '--sender', required=True,\n"
356+
" help='The value of the From: header (required)')\n"
357+
" parser.add_argument('-r', '--recipient', required=True,\n"
358+
" action='append', metavar='RECIPIENT',\n"
359+
" default=[], dest='recipients',\n"
360+
" help='A To: header value (at least one required)')\n"
361+
" args = parser.parse_args()\n"
362+
" directory = args.directory\n"
363+
" if not directory:\n"
364+
" directory = '.'\n"
365+
" # Cria a mensagem\n"
366+
" msg = EmailMessage()\n"
367+
" msg['Subject'] = f'Contents of directory {os.path.abspath(directory)}'\n"
368+
" msg['To'] = ', '.join(args.recipients)\n"
369+
" msg['From'] = args.sender\n"
370+
" msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n"
371+
"\n"
372+
" for filename in os.listdir(directory):\n"
373+
" path = os.path.join(directory, filename)\n"
374+
" if not os.path.isfile(path):\n"
375+
" continue\n"
376+
" # Adivinhe o tipo de conteúdo com base na extensão do arquivo.\n"
377+
" # A codificação será ignorada, embora devamos verificar coisas\n"
378+
" # simples como arquivos compactados ou compactados com gzip.\n"
379+
" ctype, encoding = mimetypes.guess_file_type(path)\n"
380+
" if ctype is None or encoding is not None:\n"
381+
" # Não foi possível fazer nenhuma suposição, ou o arquivo está\n"
382+
" # codificado (compactado), então use um tipo genérico de\n"
383+
" # conjunto de bits.\n"
384+
" ctype = 'application/octet-stream'\n"
385+
" maintype, subtype = ctype.split('/', 1)\n"
386+
" with open(path, 'rb') as fp:\n"
387+
" msg.add_attachment(fp.read(),\n"
388+
" maintype=maintype,\n"
389+
" subtype=subtype,\n"
390+
" filename=filename)\n"
391+
" # Agora envia ou armazena a mensagem\n"
392+
" if args.output:\n"
393+
" with open(args.output, 'wb') as fp:\n"
394+
" fp.write(msg.as_bytes(policy=SMTP))\n"
395+
" else:\n"
396+
" with smtplib.SMTP('localhost') as s:\n"
397+
" s.send_message(msg)\n"
398+
"\n"
399+
"\n"
400+
"if __name__ == '__main__':\n"
401+
" main()\n"
319402

320403
#: ../../library/email.examples.rst:33
321404
msgid ""

0 commit comments

Comments
 (0)