Skip to content

Commit cb978e9

Browse files
Update translations from Transifex
1 parent 8f33e69 commit cb978e9

10 files changed

Lines changed: 359 additions & 51 deletions

File tree

library/__main__.po

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
66
# Translators:
7-
# Henrique Branco, 2022
87
# Rafael Fontenelle <rffontenelle@gmail.com>, 2022
8+
# Henrique Junqueira, 2022
99
#
1010
#, fuzzy
1111
msgid ""
@@ -14,7 +14,7 @@ msgstr ""
1414
"Report-Msgid-Bugs-To: \n"
1515
"POT-Creation-Date: 2022-06-16 06:28+0000\n"
1616
"PO-Revision-Date: 2021-06-28 00:54+0000\n"
17-
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2022\n"
17+
"Last-Translator: Henrique Junqueira, 2022\n"
1818
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/python-doc/"
1919
"teams/5390/pt_BR/)\n"
2020
"MIME-Version: 1.0\n"
@@ -157,16 +157,22 @@ msgid ""
157157
"idiom for conditionally executing code when the module is not initialized "
158158
"from an import statement::"
159159
msgstr ""
160+
"Como resultado, um módulo pode saber se está ou não sendo executado no "
161+
"ambiente principal verificando seu próprio ``__name__``, que habilita um "
162+
"termo comum para executar código condicionalmente quando o módulo não é "
163+
"inicializado a partir de uma instrução de importação::"
160164

161165
#: ../../library/__main__.rst:111
162166
msgid ""
163167
"For a more detailed look at how ``__name__`` is set in all situations, see "
164168
"the tutorial section :ref:`tut-modules`."
165169
msgstr ""
170+
"Para uma visão mais detalhada sobre como ``__name__`` é configurado em todas "
171+
"as situações, veja a sessão :ref:`tut-modules`."
166172

167173
#: ../../library/__main__.rst:116 ../../library/__main__.rst:239
168174
msgid "Idiomatic Usage"
169-
msgstr ""
175+
msgstr "Uso idiomático"
170176

171177
#: ../../library/__main__.rst:118
172178
msgid ""
@@ -175,20 +181,31 @@ msgid ""
175181
"like this was imported from a different module, for example to unit test it, "
176182
"the script code would unintentionally execute as well."
177183
msgstr ""
184+
"Alguns módulos contém códigos que são específicos para serem usados como "
185+
"scripts, como passagem de argumentos através de linha de comando ou leitura/"
186+
"coleta de dados da entrada padrão. Se um módulo como o citado for importado "
187+
"em um outro módulo diferente, por exemplo em testes unitários, o código do "
188+
"script também seria executado de forma indesejada."
178189

179190
#: ../../library/__main__.rst:123
180191
msgid ""
181192
"This is where using the ``if __name__ == '__main__'`` code block comes in "
182193
"handy. Code within this block won't run unless the module is executed in the "
183194
"top-level environment."
184195
msgstr ""
196+
"É aqui onde o uso do trecho de código ``if __name__ == '__main__'`` revela-"
197+
"se útil. Os códigos dentro desta condicional não rodarão ao não ser que o "
198+
"módulo seja executado através do ambiente principal."
185199

186200
#: ../../library/__main__.rst:127
187201
msgid ""
188202
"Putting as few statements as possible in the block below ``if __name___ == "
189203
"'__main__'`` can improve code clarity and correctness. Most often, a "
190204
"function named ``main`` encapsulates the program's primary behavior::"
191205
msgstr ""
206+
"Colocar o mínimo de instruções possível no bloco abaixo pode melhorar a "
207+
"clareza e a precisão do código. Na maioria das vezes, uma função chamada "
208+
"encapsula o comportamento principal do programa::"
192209

193210
#: ../../library/__main__.rst:151
194211
msgid ""
@@ -199,6 +216,12 @@ msgid ""
199216
"the global variable instead of a local name. A ``main`` function solves "
200217
"this problem."
201218
msgstr ""
219+
"Repare quem se o módulo, ao invés de ter encapsulado o código dentro da "
220+
"função ``main``, fosse colocado direto dentro do bloco ``if __name__ == "
221+
"'__main__'``, a variável ``phrase`` seria global para todo o módulo. Isto é "
222+
"suscetível à erros pois outras funções dentro do módulo poderiam "
223+
"inadvertidamente usar a variável global ao invés da local. A função ``main`` "
224+
"resolve este problema."
202225

203226
#: ../../library/__main__.rst:158
204227
msgid ""
@@ -207,6 +230,10 @@ msgid ""
207230
"imported, the ``echo`` and ``main`` functions will be defined, but neither "
208231
"of them will be called, because ``__name__ != '__main__'``."
209232
msgstr ""
233+
"O uso da função ``main`` tem o benefício adicional de a própria função "
234+
"``echo`` ser isolada e importável em outro lugar. Quando ``echo.py``é "
235+
"importado, as funções ``echo`` e ``main`` serão definidas, mas nenhuma delas "
236+
"será chamada por conta do bloco ``__name__ != '__main__'``."
210237

211238
#: ../../library/__main__.rst:165
212239
msgid "Packaging Considerations"

0 commit comments

Comments
 (0)