1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-06 06:27:53 +02:00

pt-BR: Refresh .po file and clean up new fuzzy entries (#1125)

Part of #330, #317 , #893
This commit is contained in:
Henri Fontana
2023-08-28 04:43:02 -07:00
committed by GitHub
parent e6c1974000
commit e921cb0506

View File

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Comprehensive Rust 🦀\n" "Project-Id-Version: Comprehensive Rust 🦀\n"
"POT-Creation-Date: \n" "POT-Creation-Date: \n"
"PO-Revision-Date: 2023-08-25 12:03+0100\n" "PO-Revision-Date: 2023-08-25 09:32-0700\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: pt_BR\n" "Language: pt_BR\n"
@ -399,7 +399,7 @@ msgstr "Rc"
#: src/SUMMARY.md:116 #: src/SUMMARY.md:116
msgid "Cell/RefCell" msgid "Cell/RefCell"
msgstr "" msgstr "Cell/RefCell"
#: src/SUMMARY.md:117 src/modules.md:1 #: src/SUMMARY.md:117 src/modules.md:1
msgid "Modules" msgid "Modules"
@ -938,9 +938,8 @@ msgid "Join"
msgstr "" msgstr ""
#: src/SUMMARY.md:292 src/async/control-flow/select.md:1 #: src/SUMMARY.md:292 src/async/control-flow/select.md:1
#, fuzzy
msgid "Select" msgid "Select"
msgstr "Configurar" msgstr "Select"
#: src/SUMMARY.md:293 #: src/SUMMARY.md:293
msgid "Pitfalls" msgid "Pitfalls"
@ -1028,7 +1027,6 @@ msgid "Concurrency Afternoon"
msgstr "Concorrência Tarde" msgstr "Concorrência Tarde"
#: src/index.md:3 #: src/index.md:3
#, fuzzy
msgid "" msgid ""
"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" "[![Build workflow](https://img.shields.io/github/actions/workflow/status/"
"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" "google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/"
@ -1039,23 +1037,24 @@ msgid ""
"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." "io/github/stars/google/comprehensive-rust?style=flat-square)](https://github."
"com/google/comprehensive-rust/stargazers)" "com/google/comprehensive-rust/stargazers)"
msgstr "" msgstr ""
"[![Contribuições no GitHub](https://img.shields.io/github/contributors/" "[![Workflow do GitHub](https://img.shields.io/github/actions/workflow/status/"
"google/comprehensive-rust?style=flat-square)](https://github.com/google/" "google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/"
"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!"
"[Contribuições no GitHub](https://img.shields.io/github/contributors/google/"
"comprehensive-rust?style=flat-square)](https://github.com/google/"
"comprehensive-rust/graphs/contributors) [![Estrelas no GitHub](https://img." "comprehensive-rust/graphs/contributors) [![Estrelas no GitHub](https://img."
"shields.io/github/stars/google/comprehensive-rust?style=flat-square)]" "shields.io/github/stars/google/comprehensive-rust?style=flat-square)]"
"(https://github.com/google/comprehensive-rust/stargazers)" "(https://github.com/google/comprehensive-rust/stargazers)"
#: src/index.md:7 #: src/index.md:7
#, fuzzy
msgid "" msgid ""
"This is a free Rust course developed by the Android team at Google. The " "This is a free Rust course developed by the Android team at Google. The "
"course covers the full spectrum of Rust, from basic syntax to advanced " "course covers the full spectrum of Rust, from basic syntax to advanced "
"topics like generics and error handling." "topics like generics and error handling."
msgstr "" msgstr ""
"Este é um curso de Rust de três dias desenvolvido pela equipe do Android. O " "Este é um curso gratuito de Rust desenvolvido pela equipe do Android no "
"curso abrange o espectro completo da linguagem, desde a sintaxe básica até " "Google. O curso abrange o espectro completo da linguagem, desde sintaxe "
"tópicos avançados como 'generics' e tratamento de erros. Também inclui " "básica até tópicos avançados como 'generics' e tratamento de erros."
"conteúdo específico para Android no último dia."
#: src/index.md:11 #: src/index.md:11
msgid "" msgid ""
@ -1082,15 +1081,14 @@ msgstr "Demonstrar expressões idiomáticas comuns de Rust."
#: src/index.md:18 #: src/index.md:18
msgid "We call the first three course days Rust Fundamentals." msgid "We call the first three course days Rust Fundamentals."
msgstr "" msgstr "Nós chamamos os três primeiros dias do curso de Fundamentos do Rust."
#: src/index.md:20 #: src/index.md:20
#, fuzzy
msgid "" msgid ""
"Building on this, you're invited to dive into one or more specialized topics:" "Building on this, you're invited to dive into one or more specialized topics:"
msgstr "" msgstr ""
"Os três primeiros dias lhe mostram os fundamentos de Rust. Em seguida, você " "Em seguida, você está convidado(a) a mergulhar a fundo em um ou mais tópicos "
"está convidado(a) a mergulhar a fundo em um ou mais tópicos especializados:" "especializados:"
#: src/index.md:22 #: src/index.md:22
msgid "" msgid ""
@ -1150,7 +1148,6 @@ msgid "Assumptions"
msgstr "Premissas" msgstr "Premissas"
#: src/index.md:44 #: src/index.md:44
#, fuzzy
msgid "" msgid ""
"The course assumes that you already know how to program. Rust is a " "The course assumes that you already know how to program. Rust is a "
"statically-typed language and we will sometimes make comparisons with C and " "statically-typed language and we will sometimes make comparisons with C and "
@ -1622,7 +1619,6 @@ msgstr ""
"comportamentos inesperados. O comando seria:" "comportamentos inesperados. O comando seria:"
#: src/cargo.md:18 #: src/cargo.md:18
#, fuzzy
msgid "" msgid ""
"```shell\n" "```shell\n"
"sudo apt install cargo rust-src rustfmt\n" "sudo apt install cargo rust-src rustfmt\n"
@ -1959,6 +1955,8 @@ msgid ""
"You can use any later version too since Rust maintains backwards " "You can use any later version too since Rust maintains backwards "
"compatibility." "compatibility."
msgstr "" msgstr ""
"Você também pode usar qualquer versão posterior, pois o Rust mantém "
"compatibilidade com versões anteriores."
#: src/cargo/running-locally.md:17 #: src/cargo/running-locally.md:17
msgid "" msgid ""
@ -2101,13 +2099,12 @@ msgid "Welcome to Day 1"
msgstr "Bem-vindo ao Dia 1" msgstr "Bem-vindo ao Dia 1"
#: src/welcome-day-1.md:3 #: src/welcome-day-1.md:3
#, fuzzy
msgid "" msgid ""
"This is the first day of Rust Fundamentals. We will cover a lot of ground " "This is the first day of Rust Fundamentals. We will cover a lot of ground "
"today:" "today:"
msgstr "" msgstr ""
"Este é o primeiro dia do Comprehensive Rust. Nós cobriremos muitos pontos " "Este é o primeiro dia de Fundamentos do Rust. Nós iremos cobrir muitos "
"hoje:" "pontos hoje:"
#: src/welcome-day-1.md:6 #: src/welcome-day-1.md:6
msgid "" msgid ""
@ -2349,15 +2346,14 @@ msgstr ""
"Unicode." "Unicode."
#: src/hello-world.md:22 #: src/hello-world.md:22
#, fuzzy
msgid "" msgid ""
"This slide tries to make the students comfortable with Rust code. They will " "This slide tries to make the students comfortable with Rust code. They will "
"see a ton of it over the next three days so we start small with something " "see a ton of it over the next three days so we start small with something "
"familiar." "familiar."
msgstr "" msgstr ""
"Este slide tenta deixar os alunos familiarizados com o código em Rust. Eles " "Este slide tenta deixar os alunos familiarizados com o código em Rust. Eles "
"vão ver uma tonelada nos próximos quatro dias, então começamos pequeno e com " "irão ver bastante conteúdo nos próximos três dias, então começamos devagar "
"algo familiar." "com algo familiar."
#: src/hello-world.md:27 #: src/hello-world.md:27
msgid "" msgid ""
@ -3888,13 +3884,12 @@ msgstr ""
#: src/exercises/day-1/morning.md:22 src/exercises/day-2/morning.md:11 #: src/exercises/day-1/morning.md:22 src/exercises/day-2/morning.md:11
#: src/exercises/day-3/morning.md:7 src/exercises/bare-metal/morning.md:7 #: src/exercises/day-3/morning.md:7 src/exercises/bare-metal/morning.md:7
#: src/exercises/concurrency/morning.md:12 #: src/exercises/concurrency/morning.md:12
#, fuzzy
msgid "" msgid ""
"After looking at the exercises, you can look at the [solutions](solutions-" "After looking at the exercises, you can look at the [solutions](solutions-"
"morning.md) provided." "morning.md) provided."
msgstr "" msgstr ""
"Depois de ver o exercício, você pode ver a [solução](solutions-afternoon.md) " "Depois de ver os exercícios, você pode ver as [soluções](solutions-morning."
"fornecida." "md) fornecidas."
#: src/exercises/day-1/implicit-conversions.md:3 #: src/exercises/day-1/implicit-conversions.md:3
msgid "" msgid ""
@ -4049,7 +4044,6 @@ msgstr ""
"intervalos) usando a palavra-chave `for`:" "intervalos) usando a palavra-chave `for`:"
#: src/exercises/day-1/for-loops.md:21 #: src/exercises/day-1/for-loops.md:21
#, fuzzy
msgid "" msgid ""
"```rust,editable\n" "```rust,editable\n"
"fn main() {\n" "fn main() {\n"
@ -4072,7 +4066,7 @@ msgstr ""
"fn main() {\n" "fn main() {\n"
" let matriz = [10, 20, 30];\n" " let matriz = [10, 20, 30];\n"
" print!(\"Iterando sobre a matriz:\");\n" " print!(\"Iterando sobre a matriz:\");\n"
" for n in matriz {\n" " for n in &matriz {\n"
" print!(\" {n}\");\n" " print!(\" {n}\");\n"
" }\n" " }\n"
" println!();\n" " println!();\n"
@ -4210,10 +4204,12 @@ msgid ""
"The use of the reference `&array` within `for n in &array` is a subtle " "The use of the reference `&array` within `for n in &array` is a subtle "
"preview of issues of ownership that will come later in the afternoon." "preview of issues of ownership that will come later in the afternoon."
msgstr "" msgstr ""
"O uso da referência `&matriz` em `for n in &matriz` é uma prévia sutil das "
"questões de propriedade que surgirão à tarde."
#: src/exercises/day-1/for-loops.md:98 #: src/exercises/day-1/for-loops.md:98
msgid "Without the `&`..." msgid "Without the `&`..."
msgstr "" msgstr "Sem o `&`..."
#: src/exercises/day-1/for-loops.md:99 #: src/exercises/day-1/for-loops.md:99
msgid "" msgid ""
@ -4221,12 +4217,17 @@ msgid ""
"[introduced in the 2021 Edition](https://doc.rust-lang.org/edition-guide/" "[introduced in the 2021 Edition](https://doc.rust-lang.org/edition-guide/"
"rust-2021/IntoIterator-for-arrays.html)." "rust-2021/IntoIterator-for-arrays.html)."
msgstr "" msgstr ""
"O loop teria sido o que consome a matriz. Esta é uma mudança [introduzida na "
"Edição de 2021](https://doc.rust-lang.org/edition-guide/rust-2021/"
"IntoIterator-for-arrays.html)."
#: src/exercises/day-1/for-loops.md:102 #: src/exercises/day-1/for-loops.md:102
msgid "" msgid ""
"An implicit array copy would have occured. Since `i32` is a copy type, then " "An implicit array copy would have occured. Since `i32` is a copy type, then "
"`[i32; 3]` is also a copy type." "`[i32; 3]` is also a copy type."
msgstr "" msgstr ""
"Uma cópia implícita da matriz teria ocorrido. Como `i32` é um tipo de cópia "
"(*copy type*), então `[i32; 3]` também é um tipo de cópia."
#: src/basic-syntax/variables.md:3 #: src/basic-syntax/variables.md:3
msgid "" msgid ""
@ -4382,6 +4383,9 @@ msgid ""
"scoped values that cannot be moved or reallocated during the execution of " "scoped values that cannot be moved or reallocated during the execution of "
"the program. " "the program. "
msgstr "" msgstr ""
"Variáveis estáticas e constantes são duas maneiras diferentes de criar "
"valores com escopo global que não podem ser movidos ou realocados durante a "
"execução do programa. "
#: src/basic-syntax/static-and-const.md:6 #: src/basic-syntax/static-and-const.md:6
msgid "`const`" msgid "`const`"
@ -4392,6 +4396,8 @@ msgid ""
"Constant variables are evaluated at compile time and their values are " "Constant variables are evaluated at compile time and their values are "
"inlined wherever they are used:" "inlined wherever they are used:"
msgstr "" msgstr ""
"Constantes são avaliadas em tempo de compilação e seus valores são "
"incorporados onde quer que sejam usados:"
#: src/basic-syntax/static-and-const.md:11 #: src/basic-syntax/static-and-const.md:11
msgid "" msgid ""
@ -4447,6 +4453,9 @@ msgid ""
"Only functions marked `const` can be called at compile time to generate " "Only functions marked `const` can be called at compile time to generate "
"`const` values. `const` functions can however be called at runtime." "`const` values. `const` functions can however be called at runtime."
msgstr "" msgstr ""
"Somente funções marcadas como `const` podem ser chamadas em tempo de "
"compilação para gerar valores `const`. As funções `const` podem, entretanto, "
"ser chamadas em tempo de execução."
#: src/basic-syntax/static-and-const.md:33 #: src/basic-syntax/static-and-const.md:33
msgid "`static`" msgid "`static`"
@ -4457,6 +4466,8 @@ msgid ""
"Static variables will live during the whole execution of the program, and " "Static variables will live during the whole execution of the program, and "
"therefore will not move:" "therefore will not move:"
msgstr "" msgstr ""
"Variáveis estáticas permanecerão válidas durante toda a execução do programa "
"e, portanto, não serão movidas:"
#: src/basic-syntax/static-and-const.md:37 #: src/basic-syntax/static-and-const.md:37
msgid "" msgid ""
@ -4477,7 +4488,6 @@ msgstr ""
"```" "```"
#: src/basic-syntax/static-and-const.md:45 #: src/basic-syntax/static-and-const.md:45
#, fuzzy
msgid "" msgid ""
"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" "As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-"
"vs-static.html), these are not inlined upon use and have an actual " "vs-static.html), these are not inlined upon use and have an actual "
@ -4487,15 +4497,13 @@ msgid ""
"`const` is generally preferred." "`const` is generally preferred."
msgstr "" msgstr ""
"Conforme observado no [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-" "Conforme observado no [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-"
"const-vs-static.html), `static` e `const` não são expandidos em linha " "const-vs-static.html), eles não são expandidos no local (_inlined_) quando "
"(_inlined_) quando utilizados e possuem um local de memória real associado. " "utilizados e possuem um local de memória real associado. Isso é útil para "
"Isso é útil para código inseguro (_unsafe_) e embarcado, e a variável " "código inseguro (_unsafe_) e embarcado, e a variável é válida durante toda a "
"sobrevive durante toda a execução do programa. Quando um valor de escopo " "execução do programa. Quando um valor de escopo global não tem uma razão "
"global não tem uma razão para precisar identidade de objeto, geralmente " "para precisar de identidade de objeto, geralmente `const` é preferido."
"`const` é preferido."
#: src/basic-syntax/static-and-const.md:49 #: src/basic-syntax/static-and-const.md:49
#, fuzzy
msgid "" msgid ""
"Because `static` variables are accessible from any thread, they must be " "Because `static` variables are accessible from any thread, they must be "
"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" "`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-"
@ -4504,111 +4512,109 @@ msgid ""
"access to them requires `unsafe` code. We will look at [mutable statics](../" "access to them requires `unsafe` code. We will look at [mutable statics](../"
"unsafe/mutable-static-variables.md) in the chapter on Unsafe Rust." "unsafe/mutable-static-variables.md) in the chapter on Unsafe Rust."
msgstr "" msgstr ""
"Como variáveis estáticas (`static`) são acessíveis a partir que qualquer " "Como variáveis estáticas (`static`) são acessíveis de qualquer _thread_, "
"_thread_, elas precisam ser guardadas, por exemplo, por um [`Mutex`](https://" "elas precisam ser `Sync`. A mutabilidade interior é possível através de um "
"doc.rust-lang.org/std/sync/struct.Mutex.html), ou acessadas por meio de " "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html), atômico ou "
"código inseguro (`unsafe`). Nós iremos ver [dados estáticos mutáveis](../" "similar. Também é possível ter variáveis estáticas mutáveis, mas elas exigem "
"unsafe/mutable-static-variables.md) no capítulo sobre Rust inseguro " "sincronização manual de forma que qualquer acesso a elas requer código "
"(\"_Unsafe Rust_\")." "“inseguro”. Veremos [variáveis estáticas mutáveis](../unsafe/mutable-static-"
"variables.md) no capítulo sobre _Unsafe Rust_."
#: src/basic-syntax/static-and-const.md:57 #: src/basic-syntax/static-and-const.md:57
#, fuzzy
msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`." msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`."
msgstr "" msgstr ""
"Mencione que `const` se comporta semanticamente similar ao `constexpr` de C+" "Mencione que `const` se comporta semanticamente de maneira similar ao "
"+." "`constexpr` de C++."
#: src/basic-syntax/static-and-const.md:58 #: src/basic-syntax/static-and-const.md:58
#, fuzzy
msgid "" msgid ""
"`static`, on the other hand, is much more similar to a `const` or mutable " "`static`, on the other hand, is much more similar to a `const` or mutable "
"global variable in C++." "global variable in C++."
msgstr "" msgstr ""
"`static` oferece identidade de objeto: um endereço na memória e estado como " "Por outro lado, `static` é muito mais similar a um `const` ou variável "
"requerido por tipos com mutabilidade interna tais como `Mutex<T>`." "global mutável em C++."
#: src/basic-syntax/static-and-const.md:59 #: src/basic-syntax/static-and-const.md:59
#, fuzzy
msgid "" msgid ""
"`static` provides object identity: an address in memory and state as " "`static` provides object identity: an address in memory and state as "
"required by types with interior mutability such as `Mutex<T>`." "required by types with interior mutability such as `Mutex<T>`."
msgstr "" msgstr ""
"Não é muito comum que alguém precise de uma constante avaliada em tempo de " "`static` fornece identidade de objeto: um endereço na memória e estado "
"execução, mas é útil e mais seguro do que usar uma estática." "conforme exigido por tipos com mutabilidade interior tais como `Mutex<T>`."
#: src/basic-syntax/static-and-const.md:60 #: src/basic-syntax/static-and-const.md:60
msgid "" msgid ""
"It isn't super common that one would need a runtime evaluated constant, but " "It isn't super common that one would need a runtime evaluated constant, but "
"it is helpful and safer than using a static." "it is helpful and safer than using a static."
msgstr "" msgstr ""
"Não é muito comum que alguém precise de uma constante avaliada em tempo de "
"execução, mas é útil e mais seguro do que usar uma variável estática."
#: src/basic-syntax/static-and-const.md:61 #: src/basic-syntax/static-and-const.md:61
msgid "`thread_local` data can be created with the macro `std::thread_local`." msgid "`thread_local` data can be created with the macro `std::thread_local`."
msgstr "" msgstr ""
"Dados de `thread_local` podem ser criados com a macro `std::thread_local`."
#: src/basic-syntax/static-and-const.md:63 #: src/basic-syntax/static-and-const.md:63
msgid "Properties table:" msgid "Properties table:"
msgstr "" msgstr "Tabela de propriedades:"
#: src/basic-syntax/static-and-const.md:65 #: src/basic-syntax/static-and-const.md:65
msgid "Property" msgid "Property"
msgstr "" msgstr "Propriedade"
#: src/basic-syntax/static-and-const.md:65 #: src/basic-syntax/static-and-const.md:65
#, fuzzy
msgid "Static" msgid "Static"
msgstr "`static`" msgstr "Static"
#: src/basic-syntax/static-and-const.md:65 #: src/basic-syntax/static-and-const.md:65
msgid "Constant" msgid "Constant"
msgstr "" msgstr "Constant"
#: src/basic-syntax/static-and-const.md:67 #: src/basic-syntax/static-and-const.md:67
msgid "Has an address in memory" msgid "Has an address in memory"
msgstr "" msgstr "Possui um endereço na memória"
#: src/basic-syntax/static-and-const.md:67 #: src/basic-syntax/static-and-const.md:67
#: src/basic-syntax/static-and-const.md:68 #: src/basic-syntax/static-and-const.md:68
#: src/basic-syntax/static-and-const.md:70 #: src/basic-syntax/static-and-const.md:70
#: src/basic-syntax/static-and-const.md:71 #: src/basic-syntax/static-and-const.md:71
msgid "Yes" msgid "Yes"
msgstr "" msgstr "Sim"
#: src/basic-syntax/static-and-const.md:67 #: src/basic-syntax/static-and-const.md:67
msgid "No (inlined)" msgid "No (inlined)"
msgstr "" msgstr "Não (_inlined_, i.e., expandida no local)"
#: src/basic-syntax/static-and-const.md:68 #: src/basic-syntax/static-and-const.md:68
#, fuzzy
msgid "Lives for the entire duration of the program" msgid "Lives for the entire duration of the program"
msgstr "A função `main` é o ponto de entrada do programa." msgstr "É válida durante toda a execução do programa"
#: src/basic-syntax/static-and-const.md:68 #: src/basic-syntax/static-and-const.md:68
#: src/basic-syntax/static-and-const.md:69 #: src/basic-syntax/static-and-const.md:69
#: src/basic-syntax/static-and-const.md:71 #: src/basic-syntax/static-and-const.md:71
msgid "No" msgid "No"
msgstr "" msgstr "Não"
#: src/basic-syntax/static-and-const.md:69 #: src/basic-syntax/static-and-const.md:69
msgid "Can be mutable" msgid "Can be mutable"
msgstr "" msgstr "Pode ser mutável"
#: src/basic-syntax/static-and-const.md:69 #: src/basic-syntax/static-and-const.md:69
msgid "Yes (unsafe)" msgid "Yes (unsafe)"
msgstr "" msgstr "Sim (inseguro)"
#: src/basic-syntax/static-and-const.md:70 #: src/basic-syntax/static-and-const.md:70
#, fuzzy
msgid "Evaluated at compile time" msgid "Evaluated at compile time"
msgstr "Os valores têm tamanhos fixos conhecidos em tempo de compilação." msgstr "Avaliada em tempo de compilação"
#: src/basic-syntax/static-and-const.md:70 #: src/basic-syntax/static-and-const.md:70
msgid "Yes (initialised at compile time)" msgid "Yes (initialised at compile time)"
msgstr "" msgstr "Sim (inicializada em tempo de compilação)"
#: src/basic-syntax/static-and-const.md:71 #: src/basic-syntax/static-and-const.md:71
msgid "Inlined wherever it is used" msgid "Inlined wherever it is used"
msgstr "" msgstr "_Inlined_ (expandida no local) onde quer que seja utilizada"
#: src/basic-syntax/scopes-shadowing.md:3 #: src/basic-syntax/scopes-shadowing.md:3
msgid "" msgid ""
@ -4616,7 +4622,7 @@ msgid ""
"the same scope:" "the same scope:"
msgstr "" msgstr ""
"Você pode sobrepor (_shadow_) variáveis, tanto aquelas de escopos externos " "Você pode sobrepor (_shadow_) variáveis, tanto aquelas de escopos externos "
"quanto de variáveis do mesmo escopo:" "quanto variáveis do mesmo escopo:"
#: src/basic-syntax/scopes-shadowing.md:6 #: src/basic-syntax/scopes-shadowing.md:6
msgid "" msgid ""
@ -4663,11 +4669,11 @@ msgstr ""
"Definição: _Shadowing_ é diferente da mutação, porque após a sobreposição " "Definição: _Shadowing_ é diferente da mutação, porque após a sobreposição "
"(_shadowing_), os locais de memória de ambas as variáveis existem ao mesmo " "(_shadowing_), os locais de memória de ambas as variáveis existem ao mesmo "
"tempo. Ambas estão disponíveis com o mesmo nome, dependendo de onde você as " "tempo. Ambas estão disponíveis com o mesmo nome, dependendo de onde você as "
"usa no código." "usa no código. "
#: src/basic-syntax/scopes-shadowing.md:26 #: src/basic-syntax/scopes-shadowing.md:26
msgid "A shadowing variable can have a different type. " msgid "A shadowing variable can have a different type. "
msgstr "Uma variável sobreposta pode ter um tipo diferente." msgstr "Uma variável sobreposta pode ter um tipo diferente. "
#: src/basic-syntax/scopes-shadowing.md:27 #: src/basic-syntax/scopes-shadowing.md:27
msgid "" msgid ""
@ -4698,6 +4704,14 @@ msgid ""
"}\n" "}\n"
"```" "```"
msgstr "" msgstr ""
"```rust,editable\n"
"fn main() {\n"
" let a = 1;\n"
" let b = &a;\n"
" let a = a + 1;\n"
" println!(\"{a} {b}\");\n"
"}\n"
"```"
#: src/memory-management.md:3 #: src/memory-management.md:3
msgid "Traditionally, languages have fallen into two broad categories:" msgid "Traditionally, languages have fallen into two broad categories:"
@ -6292,13 +6306,12 @@ msgstr "Iteradores e _ownership_ (difícil)."
#: src/exercises/day-1/afternoon.md:11 src/exercises/day-2/afternoon.md:7 #: src/exercises/day-1/afternoon.md:11 src/exercises/day-2/afternoon.md:7
#: src/exercises/bare-metal/afternoon.md:7 #: src/exercises/bare-metal/afternoon.md:7
#: src/exercises/concurrency/afternoon.md:13 #: src/exercises/concurrency/afternoon.md:13
#, fuzzy
msgid "" msgid ""
"After looking at the exercises, you can look at the [solutions](solutions-" "After looking at the exercises, you can look at the [solutions](solutions-"
"afternoon.md) provided." "afternoon.md) provided."
msgstr "" msgstr ""
"Depois de ver o exercício, você pode ver a [solução](solutions-afternoon.md) " "Depois de ver os exercícios, você pode ver as [soluções](solutions-afternoon."
"fornecida." "md) fornecidas."
#: src/exercises/day-1/book-library.md:3 #: src/exercises/day-1/book-library.md:3
msgid "" msgid ""
@ -7880,18 +7893,16 @@ msgstr ""
"podemos manter todo o código de implementação em um local previsível." "podemos manter todo o código de implementação em um local previsível."
#: src/methods.md:34 #: src/methods.md:34
#, fuzzy
msgid "Point out the use of the keyword `self`, a method receiver." msgid "Point out the use of the keyword `self`, a method receiver."
msgstr "Destaque o uso da palavra-chave `self`, um receptor de método." msgstr "Destaque o uso da palavra-chave `self`, um receptor de método."
#: src/methods.md:35 #: src/methods.md:35
#, fuzzy
msgid "" msgid ""
"Show that it is an abbreviated term for `self: Self` and perhaps show how " "Show that it is an abbreviated term for `self: Self` and perhaps show how "
"the struct name could also be used." "the struct name could also be used."
msgstr "" msgstr ""
"Mostre que é um termo abreviado para `self:&Self` e talvez mostre como o " "Mostre que é um termo abreviado para `self:Self` e talvez mostre como o nome "
"nome da struct também poderia ser usado." "da _struct_ também poderia ser usado."
#: src/methods.md:36 #: src/methods.md:36
msgid "" msgid ""
@ -9006,23 +9017,20 @@ msgid "Other interesting parts of the exercise:"
msgstr "Outras partes interessante do exercício:" msgstr "Outras partes interessante do exercício:"
#: src/exercises/day-2/points-polygons.md:122 #: src/exercises/day-2/points-polygons.md:122
#, fuzzy
msgid "" msgid ""
"Derive a `Copy` trait for some structs, as in tests the methods sometimes " "Derive a `Copy` trait for some structs, as in tests the methods sometimes "
"don't borrow their arguments." "don't borrow their arguments."
msgstr "Outras partes interessantes do exercício:" msgstr ""
"Derive um _trait_ `Copy` para algumas _structs_, já que em testes os métodos "
"às vezes não emprestam seus argumentos."
#: src/exercises/day-2/points-polygons.md:123 #: src/exercises/day-2/points-polygons.md:123
#, fuzzy
msgid "" msgid ""
"Discover that `Add` trait must be implemented for two objects to be addable " "Discover that `Add` trait must be implemented for two objects to be addable "
"via \"+\". Note that we do not discuss generics until Day 3." "via \"+\". Note that we do not discuss generics until Day 3."
msgstr "" msgstr ""
"Derive um _trait_ `Copy` para algumas estruturas, já que em testes os "
"métodos às vezes não emprestam seus argumentos.\n"
"\n"
"Descubra que o trait `Add` deve ser implementado para que dois objetos sejam " "Descubra que o trait `Add` deve ser implementado para que dois objetos sejam "
"adicionados via \"+\"." "adicionados via \"+\". Note que nós não discutimos _generics_ até o Dia 3."
#: src/control-flow.md:3 #: src/control-flow.md:3
msgid "" msgid ""
@ -9298,7 +9306,6 @@ msgstr ""
"(`panic`/`return`/`break`/`continue`):" "(`panic`/`return`/`break`/`continue`):"
#: src/control-flow/if-let-expressions.md:28 #: src/control-flow/if-let-expressions.md:28
#, fuzzy
msgid "" msgid ""
"```rust,editable\n" "```rust,editable\n"
"fn main() {\n" "fn main() {\n"
@ -9676,7 +9683,7 @@ msgid ""
"reference/expressions/loop-expr.html#break-expressions)," "reference/expressions/loop-expr.html#break-expressions),"
msgstr "" msgstr ""
"Se você quiser sair de um loop cedo, use [`break`](https://doc.rust-lang.org/" "Se você quiser sair de um loop cedo, use [`break`](https://doc.rust-lang.org/"
"reference/expressions/loop-expr.html#break-expressions)." "reference/expressions/loop-expr.html#break-expressions),"
#: src/control-flow/break-continue.md:4 #: src/control-flow/break-continue.md:4
msgid "" msgid ""
@ -9796,7 +9803,7 @@ msgid ""
"`alloc` and `std`. " "`alloc` and `std`. "
msgstr "" msgstr ""
"Na verdade, o Rust contém várias camadas de Biblioteca Padrão: `core`, " "Na verdade, o Rust contém várias camadas de Biblioteca Padrão: `core`, "
"`alloc` e `std`." "`alloc` e `std`. "
#: src/std.md:26 #: src/std.md:26
msgid "" msgid ""
@ -9804,7 +9811,7 @@ msgid ""
"`libc`, allocator or even the presence of an operating system. " "`libc`, allocator or even the presence of an operating system. "
msgstr "" msgstr ""
"`core` inclui os tipos e funções mais básicos que não dependem de `libc`, " "`core` inclui os tipos e funções mais básicos que não dependem de `libc`, "
"alocador ou até mesmo a presença de um sistema operacional." "alocador ou até mesmo a presença de um sistema operacional. "
#: src/std.md:28 #: src/std.md:28
msgid "" msgid ""
@ -10640,24 +10647,23 @@ msgstr ""
"```" "```"
#: src/std/rc.md:18 #: src/std/rc.md:18
#, fuzzy
msgid "" msgid ""
"See [`Arc`](../concurrency/shared_state/arc.md) and [`Mutex`](https://doc." "See [`Arc`](../concurrency/shared_state/arc.md) and [`Mutex`](https://doc."
"rust-lang.org/std/sync/struct.Mutex.html) if you are in a multi-threaded " "rust-lang.org/std/sync/struct.Mutex.html) if you are in a multi-threaded "
"context." "context."
msgstr "" msgstr ""
"Veja [`Arc`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) e " "Veja [`Arc`](../concurrency/shared_state/arc.md) e [`Mutex`](https://doc."
"[`Mutex`](https://doc.rust-lang.org/std/rc/struct.Weak.html) se você estiver " "rust-lang.org/std/sync/struct.Mutex.html) se você estiver em um contexto "
"em um contexto multi-thread." "multi-thread."
#: src/std/rc.md:19 #: src/std/rc.md:19
#, fuzzy
msgid "" msgid ""
"You can _downgrade_ a shared pointer into a [`Weak`](https://doc.rust-lang." "You can _downgrade_ a shared pointer into a [`Weak`](https://doc.rust-lang."
"org/std/rc/struct.Weak.html) pointer to create cycles that will get dropped." "org/std/rc/struct.Weak.html) pointer to create cycles that will get dropped."
msgstr "" msgstr ""
"Você pode demover (_downgrade_) um ponteiro compartilhado em um ponteiro " "Você pode demover (_downgrade_) um ponteiro compartilhado para um ponteiro "
"\\[`Weak`\\]\\[5\\] para criar ciclos que serão descartados." "[`Weak`](https://doc.rust-lang.org/std/rc/struct.Weak.html) (fraco) para "
"criar ciclos que serão descartados."
#: src/std/rc.md:29 #: src/std/rc.md:29
msgid "" msgid ""
@ -10694,30 +10700,29 @@ msgid "Use `Rc::strong_count` to check the reference count."
msgstr "Use `Rc::strong_count` para verificar a contagem de referência." msgstr "Use `Rc::strong_count` para verificar a contagem de referência."
#: src/std/rc.md:34 #: src/std/rc.md:34
#, fuzzy
msgid "" msgid ""
"`Rc::downgrade` gives you a _weakly reference-counted_ object to create " "`Rc::downgrade` gives you a _weakly reference-counted_ object to create "
"cycles that will be dropped properly (likely in combination with `RefCell`, " "cycles that will be dropped properly (likely in combination with `RefCell`, "
"on the next slide)." "on the next slide)."
msgstr "" msgstr ""
"`Rc::downgrade` lhe fornece um objeto _contador de referências " "`Rc::downgrade` lhe fornece um objeto _contador de referências_ "
"\"fraco\" (weak)_ para criar ciclos que podem ser apropriadamente " "\"fraco\" (weak)_ para criar ciclos que podem ser apropriadamente "
"descartados (provavelmente combinados com `RefCell`)." "descartados (provavelmente combinados com `RefCell`, no próximo slide)."
#: src/std/cell.md:1 #: src/std/cell.md:1
msgid "`Cell` and `RefCell`" msgid "`Cell` and `RefCell`"
msgstr "" msgstr "`Cell` e `RefCell`"
#: src/std/cell.md:3 #: src/std/cell.md:3
#, fuzzy
msgid "" msgid ""
"[`Cell`](https://doc.rust-lang.org/std/cell/struct.Cell.html) and [`RefCell`]" "[`Cell`](https://doc.rust-lang.org/std/cell/struct.Cell.html) and [`RefCell`]"
"(https://doc.rust-lang.org/std/cell/struct.RefCell.html) implement what Rust " "(https://doc.rust-lang.org/std/cell/struct.RefCell.html) implement what Rust "
"calls _interior mutability:_ mutation of values in an immutable context." "calls _interior mutability:_ mutation of values in an immutable context."
msgstr "" msgstr ""
"Veja [`Arc`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) e " "[`Cell`](https://doc.rust-lang.org/std/cell/struct.Cell.html) e [`RefCell`]"
"[`Mutex`](https://doc.rust-lang.org/std/rc/struct.Weak.html) se você estiver " "(https://doc.rust-lang.org/std/cell/struct.RefCell.html) implementam o que "
"em um contexto multi-thread." "Rust chama de _mutabilidade interior:_ mutação de valores em um contexto "
"imutável."
#: src/std/cell.md:8 #: src/std/cell.md:8
msgid "" msgid ""
@ -10725,6 +10730,10 @@ msgid ""
"values. More complex interior types typically use `RefCell`, which tracks " "values. More complex interior types typically use `RefCell`, which tracks "
"shared and exclusive references at runtime and panics if they are misused." "shared and exclusive references at runtime and panics if they are misused."
msgstr "" msgstr ""
"`Cell` é normalmente usado para tipos simples, pois requer copiar ou mover "
"valores. Tipos interiores mais complexos normalmente usam `RefCell`, que "
"rastreia referências compartilhadas e exclusivas em tempo de execução e "
"retorna um pânico (_panic_) se forem mal utilizadas."
#: src/std/cell.md:12 #: src/std/cell.md:12
msgid "" msgid ""
@ -10762,6 +10771,39 @@ msgid ""
"}\n" "}\n"
"```" "```"
msgstr "" msgstr ""
"```rust,editable\n"
"use std::cell::RefCell;\n"
"use std::rc::Rc;\n"
"\n"
"#[derive(Debug, Default)]\n"
"struct Node {\n"
" value: i64,\n"
" children: Vec<Rc<RefCell<Node>>>,\n"
"}\n"
"\n"
"impl Node {\n"
" fn new(value: i64) -> Rc<RefCell<Node>> {\n"
" Rc::new(RefCell::new(Node { value, ..Node::default() }))\n"
" }\n"
"\n"
" fn sum(&self) -> i64 {\n"
" self.value + self.children.iter().map(|c| c.borrow().sum()).sum::"
"<i64>()\n"
" }\n"
"}\n"
"\n"
"fn main() {\n"
" let root = Node::new(1);\n"
" root.borrow_mut().children.push(Node::new(5));\n"
" let subtree = Node::new(10);\n"
" subtree.borrow_mut().children.push(Node::new(11));\n"
" subtree.borrow_mut().children.push(Node::new(12));\n"
" root.borrow_mut().children.push(subtree);\n"
"\n"
" println!(\"graph: {root:#?}\");\n"
" println!(\"graph sum: {}\", root.borrow().sum());\n"
"}\n"
"```"
#: src/std/cell.md:47 #: src/std/cell.md:47
msgid "" msgid ""
@ -10770,18 +10812,26 @@ msgid ""
"This is safe because there's always one, un-referenced value in the cell, " "This is safe because there's always one, un-referenced value in the cell, "
"but it's not ergonomic." "but it's not ergonomic."
msgstr "" msgstr ""
"Se estivéssemos usando `Cell` em vez de `RefCell` neste exemplo, teríamos "
"que mover o `Node` para fora do `Rc` para enviar os filhos e, em seguida, "
"movê-lo de volta. Isso é seguro porque sempre há um, valor não referenciado "
"em `cell`, mas não é ergonômico."
#: src/std/cell.md:48 #: src/std/cell.md:48
msgid "" msgid ""
"To do anything with a Node, you must call a `RefCell` method, usually " "To do anything with a Node, you must call a `RefCell` method, usually "
"`borrow` or `borrow_mut`." "`borrow` or `borrow_mut`."
msgstr "" msgstr ""
"Para fazer qualquer coisa com um Node, você deve chamar um método `RefCell`, "
"geralmente `borrow` ou `borrow_mut`."
#: src/std/cell.md:49 #: src/std/cell.md:49
msgid "" msgid ""
"Demonstrate that reference loops can be created by adding `root` to `subtree." "Demonstrate that reference loops can be created by adding `root` to `subtree."
"children` (don't try to print it!)." "children` (don't try to print it!)."
msgstr "" msgstr ""
"Demonstre que loops de referência podem ser criados adicionando `root` a "
"`subtree.children` (não tente imprimi-lo!)."
#: src/std/cell.md:50 #: src/std/cell.md:50
msgid "" msgid ""
@ -10790,6 +10840,10 @@ msgid ""
"the presence of the reference loop, with `thread 'main' panicked at 'already " "the presence of the reference loop, with `thread 'main' panicked at 'already "
"borrowed: BorrowMutError'`." "borrowed: BorrowMutError'`."
msgstr "" msgstr ""
"Para demonstrar um pânico em tempo de execução, adicione um `fn inc(&mut "
"self)` que incrementa `self.value` e chama o mesmo método em seus filhos. "
"Isso criará um pânico na presença do loop de referência, com `thread 'main' "
"em pânico no 'já emprestado: BorrowMutError'`."
#: src/modules.md:3 #: src/modules.md:3
msgid "We have seen how `impl` blocks let us namespace functions to a type." msgid "We have seen how `impl` blocks let us namespace functions to a type."