1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-05-18 16:33:09 +02:00

pt-BR: Catches up with latest PRs on the original EN text (#1008)

pt-BR: Catches up with latest PRs on the original
EN material
This commit is contained in:
Henri Fontana 2023-07-21 01:39:37 -07:00 committed by GitHub
parent bb6fdeaa09
commit e2038b4897
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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-07-17 12:30-0700\n" "PO-Revision-Date: 2023-07-18 10:33-0700\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: pt_BR\n" "Language: pt_BR\n"
@ -1190,19 +1190,19 @@ msgstr ""
"Se você sabe programar em uma linguagem de tipagem dinâmica, como Python ou\n" "Se você sabe programar em uma linguagem de tipagem dinâmica, como Python ou\n"
"JavaScript, então você também será capaz de acompanhar." "JavaScript, então você também será capaz de acompanhar."
#: src/welcome.md:50 src/cargo/rust-ecosystem.md:19 #: src/welcome.md:50 src/cargo.md:16 src/cargo/rust-ecosystem.md:19
#: src/cargo/code-samples.md:22 src/cargo/running-locally.md:68 #: src/cargo/code-samples.md:22 src/cargo/running-locally.md:68
#: src/welcome-day-1.md:14 src/welcome-day-1/what-is-rust.md:19 #: src/welcome-day-1.md:14 src/welcome-day-1/what-is-rust.md:19
#: src/hello-world.md:20 src/hello-world/small-example.md:21 src/why-rust.md:9 #: src/hello-world.md:20 src/hello-world/small-example.md:21 src/why-rust.md:9
#: src/why-rust/compile-time.md:14 src/why-rust/runtime.md:8 #: src/why-rust/compile-time.md:14 src/why-rust/runtime.md:8
#: src/why-rust/modern.md:19 src/basic-syntax/scalar-types.md:19 #: src/why-rust/modern.md:19 src/basic-syntax/scalar-types.md:19
#: src/basic-syntax/compound-types.md:28 src/basic-syntax/references.md:21 #: src/basic-syntax/compound-types.md:28 src/basic-syntax/references.md:21
#: src/basic-syntax/slices.md:18 src/basic-syntax/string-slices.md:25 #: src/basic-syntax/slices.md:19 src/basic-syntax/string-slices.md:25
#: src/basic-syntax/functions.md:33 src/basic-syntax/rustdoc.md:22 #: src/basic-syntax/functions.md:33 src/basic-syntax/rustdoc.md:22
#: src/basic-syntax/methods.md:32 src/basic-syntax/functions-interlude.md:25 #: src/basic-syntax/methods.md:32 src/basic-syntax/functions-interlude.md:25
#: src/exercises/day-1/morning.md:9 src/exercises/day-1/for-loops.md:90 #: src/exercises/day-1/morning.md:9 src/exercises/day-1/for-loops.md:90
#: src/basic-syntax/variables.md:15 src/basic-syntax/type-inference.md:24 #: src/basic-syntax/variables.md:15 src/basic-syntax/type-inference.md:24
#: src/basic-syntax/static-and-const.md:48 #: src/basic-syntax/static-and-const.md:47
#: src/basic-syntax/scopes-shadowing.md:23 src/memory-management/stack.md:26 #: src/basic-syntax/scopes-shadowing.md:23 src/memory-management/stack.md:26
#: src/memory-management/rust.md:12 src/ownership/move-semantics.md:20 #: src/memory-management/rust.md:12 src/ownership/move-semantics.md:20
#: src/ownership/moves-function-calls.md:18 src/ownership/copy-clone.md:33 #: src/ownership/moves-function-calls.md:18 src/ownership/copy-clone.md:33
@ -1305,19 +1305,19 @@ msgstr ""
"o instrutor deve\n" "o instrutor deve\n"
"cobrir quanto respostas a perguntas típicas que surgem em sala de aula." "cobrir quanto respostas a perguntas típicas que surgem em sala de aula."
#: src/welcome.md:56 src/cargo/rust-ecosystem.md:67 #: src/welcome.md:56 src/cargo.md:28 src/cargo/rust-ecosystem.md:71
#: src/cargo/code-samples.md:35 src/cargo/running-locally.md:74 #: src/cargo/code-samples.md:35 src/cargo/running-locally.md:74
#: src/welcome-day-1.md:42 src/welcome-day-1/what-is-rust.md:29 #: src/welcome-day-1.md:42 src/welcome-day-1/what-is-rust.md:29
#: src/hello-world.md:40 src/hello-world/small-example.md:46 src/why-rust.md:24 #: src/hello-world.md:43 src/hello-world/small-example.md:46 src/why-rust.md:24
#: src/why-rust/compile-time.md:35 src/why-rust/runtime.md:23 #: src/why-rust/compile-time.md:35 src/why-rust/runtime.md:23
#: src/why-rust/modern.md:66 src/basic-syntax/scalar-types.md:43 #: src/why-rust/modern.md:66 src/basic-syntax/scalar-types.md:46
#: src/basic-syntax/compound-types.md:62 src/basic-syntax/references.md:29 #: src/basic-syntax/compound-types.md:62 src/basic-syntax/references.md:29
#: src/basic-syntax/slices.md:36 src/basic-syntax/string-slices.md:44 #: src/basic-syntax/slices.md:36 src/basic-syntax/string-slices.md:44
#: src/basic-syntax/functions.md:41 src/basic-syntax/rustdoc.md:33 #: src/basic-syntax/functions.md:41 src/basic-syntax/rustdoc.md:36
#: src/basic-syntax/methods.md:45 src/basic-syntax/functions-interlude.md:30 #: src/basic-syntax/methods.md:47 src/basic-syntax/functions-interlude.md:30
#: src/exercises/day-1/morning.md:28 src/exercises/day-1/for-loops.md:95 #: src/exercises/day-1/morning.md:28 src/exercises/day-1/for-loops.md:95
#: src/basic-syntax/variables.md:20 src/basic-syntax/type-inference.md:48 #: src/basic-syntax/variables.md:20 src/basic-syntax/type-inference.md:48
#: src/basic-syntax/static-and-const.md:55 #: src/basic-syntax/static-and-const.md:54
#: src/basic-syntax/scopes-shadowing.md:39 src/memory-management/stack.md:49 #: src/basic-syntax/scopes-shadowing.md:39 src/memory-management/stack.md:49
#: src/memory-management/rust.md:18 src/ownership/move-semantics.md:26 #: src/memory-management/rust.md:18 src/ownership/move-semantics.md:26
#: src/ownership/moves-function-calls.md:26 src/ownership/copy-clone.md:51 #: src/ownership/moves-function-calls.md:26 src/ownership/copy-clone.md:51
@ -1755,10 +1755,12 @@ msgstr ""
#: src/running-the-course/translations.md:6 #: src/running-the-course/translations.md:6
msgid "" msgid ""
"* [Brazilian Portuguese][pt-BR] by [@rastringer] and [@hugojacob].\n" "* [Brazilian Portuguese][pt-BR] by [@rastringer], [@hugojacob], "
"[@joaovicmendes] and [@henrif75].\n"
"* [Korean][ko] by [@keispace], [@jiyongp] and [@jooyunghan]." "* [Korean][ko] by [@keispace], [@jiyongp] and [@jooyunghan]."
msgstr "" msgstr ""
"* [Português do Brasil][pt-BR] por [@rastringer] e [@hugojacob].\n" "* [Português do Brasil][pt-BR] por [@rastringer], [@hugojacob], "
"[@joaovicmendes] e [@henrif75].\n"
"* [Coreano][ko] por [@keispace], [@jiyongp] e [@jooyunghan]." "* [Coreano][ko] por [@keispace], [@jiyongp] e [@jooyunghan]."
#: src/running-the-course/translations.md:9 #: src/running-the-course/translations.md:9
@ -1829,18 +1831,18 @@ msgid "## Installation"
msgstr "## Instalação" msgstr "## Instalação"
#: src/cargo.md:10 #: src/cargo.md:10
msgid "### Rustup (Recommended)" msgid "> TL;DR: Visit [rustup.rs][1]."
msgstr "### Rustup (Recomendado)" msgstr "> TL;DR: Veja [rustup.rs][1]."
#: src/cargo.md:12 #: src/cargo.md:12
msgid "" msgid ""
"You can follow the instructions to install cargo and rust compiler, among " "You can follow the instructions to install cargo and rust compiler, among "
"other standard ecosystem tools with the [rustup][3] tool, which is " "other standard ecosystem tools with the [rustup][1] tool, which is "
"maintained by the Rust Foundation." "maintained by the Rust Foundation."
msgstr "" msgstr ""
"Você pode seguir as instruções para instalar o cargo e o compilador de Rust, " "Você pode seguir as instruções para instalar o cargo e o compilador do Rust, "
"entre outras ferramentas padrão do ecossistema com a ferramenta [rustup][3], " "entre outras ferramentas padrão do ecossistema, com a ferramenta [rustup]"
"que é mantida pela Rust Foundation." "[1], que é mantida pela Rust Foundation."
#: src/cargo.md:14 #: src/cargo.md:14
msgid "" msgid ""
@ -1852,24 +1854,19 @@ msgstr ""
"linha de comando que você pode usar para instalar/alternar ferramentas, " "linha de comando que você pode usar para instalar/alternar ferramentas, "
"configurar compilação cruzada, etc." "configurar compilação cruzada, etc."
#: src/cargo.md:16
msgid "### Package Managers"
msgstr "### Gerenciadores de pacotes"
#: src/cargo.md:18 #: src/cargo.md:18
msgid "#### Debian" msgid ""
msgstr "#### Debian" "* On Debian/Ubuntu, you can also install Cargo, the Rust source and the "
"[Rust formatter][6] via `apt`. However, this gets you an outdated rust "
"version and may lead to unexpected behavior. The command would be:"
msgstr ""
"* No Debian/Ubuntu, você também pode instalar o Cargo, o código-fonte do "
"Rust e o [formatador Rust][6] com `apt`. Entretanto, isto lhe fornece uma "
"versão desatualizada do Rust e pode levar a comportamentos inesperados. O "
"comando seria:"
#: src/cargo.md:20 #: src/cargo.md:20
msgid "" msgid ""
"On Debian/Ubuntu, you can install Cargo, the Rust source and the [Rust "
"formatter][6] with"
msgstr ""
"No Debian/Ubuntu, você pode instalar o Cargo, o código-fonte Rust e o "
"[formatador Rust][6] com"
#: src/cargo.md:22
msgid ""
"```shell\n" "```shell\n"
" sudo apt install cargo rust-src rustfmt\n" " sudo apt install cargo rust-src rustfmt\n"
"```" "```"
@ -1878,27 +1875,23 @@ msgstr ""
"sudo apt install cargo rust-src rustfmt\n" "sudo apt install cargo rust-src rustfmt\n"
"```" "```"
#: src/cargo.md:26 #: src/cargo.md:24
msgid "" msgid ""
"This will allow [rust-analyzer][1] to jump to the definitions. We suggest " "* We suggest using [VS Code][2] to edit the code (but any LSP compatible "
"using\n" "editor works with rust-analyzer[3]).\n"
"[VS Code][2] to edit the code (but any LSP compatible editor works)." "\n"
msgstr "" "* Some folks also like to use the [JetBrains][4] family of IDEs, which do "
"Isso permitirá que o [rust-analyzer][1] localize as definições. Sugerimos "
"usar o\n"
"[VS Code][2] para editar o código (mas qualquer editor compatível com LSP "
"funciona)."
#: src/cargo.md:29
msgid ""
"Some folks also like to use the [JetBrains][4] family of IDEs, which do "
"their own analysis but have their own tradeoffs. If you prefer them, you can " "their own analysis but have their own tradeoffs. If you prefer them, you can "
"install the [Rust Plugin][5]. Please take note that as of January 2023 " "install the [Rust Plugin][5]. Please take note that as of January 2023 "
"debugging only works on the CLion version of the JetBrains IDEA suite." "debugging only works on the CLion version of the JetBrains IDEA suite."
msgstr "" msgstr ""
"Algumas pessoas também gostam de usar a família de IDEs [JetBrains][4], que " "* Nós sugerimos a utilização do [VS Code][2] para editar o código (mas "
"fazem suas próprias análises, mas têm suas próprias vantagens e " "qualquer editor LSP - _Language Server Protocol_ - funciona com o rust-"
"desvantagens. Se você preferir, pode instalar o [Plugin Rust][5]. Observe " "analyzer[3]).\n"
"\n"
"* Algumas pessoas também gostam de usar a família de IDEs [JetBrains][4], "
"que fazem suas próprias análises, mas têm suas próprias vantagens e "
"desvantagens. Se você preferi-las, pode instalar o [Plugin Rust][5]. Observe "
"que, a partir de Janeiro de 2023, a depuração funciona apenas na versão " "que, a partir de Janeiro de 2023, a depuração funciona apenas na versão "
"CLion do pacote JetBrains IDEA." "CLion do pacote JetBrains IDEA."
@ -1920,8 +1913,8 @@ msgid ""
" intermediate formats.\n" " intermediate formats.\n"
"\n" "\n"
"* `cargo`: the Rust dependency manager and build tool. Cargo knows how to\n" "* `cargo`: the Rust dependency manager and build tool. Cargo knows how to\n"
" download dependencies hosted on <https://crates.io> and it will pass them " " download dependencies, usually hosted on <https://crates.io>, and it will "
"to\n" "pass them to\n"
" `rustc` when building your project. Cargo also comes with a built-in test\n" " `rustc` when building your project. Cargo also comes with a built-in test\n"
" runner which is used to execute unit tests.\n" " runner which is used to execute unit tests.\n"
"\n" "\n"
@ -1939,8 +1932,8 @@ msgstr ""
"\n" "\n"
"* `cargo`: o gerenciador de dependências e ferramenta de compilação do Rust. " "* `cargo`: o gerenciador de dependências e ferramenta de compilação do Rust. "
"O Cargo sabe como\n" "O Cargo sabe como\n"
" baixar dependências hospedadas em <https://crates.io> e ele as passará para " " baixar dependências, normalmente hospedadas em <https://crates.io>, e as "
"o \n" "passará para o \n"
" `rustc` quando compilar o seu projeto. O Cargo também vem com um " " `rustc` quando compilar o seu projeto. O Cargo também vem com um "
"gerenciador de\n" "gerenciador de\n"
" testes embutido que é utilizado para a execução de testes unitários.\n" " testes embutido que é utilizado para a execução de testes unitários.\n"
@ -1976,6 +1969,9 @@ msgid ""
"* New features are being tested on \"nightly\", \"beta\" is what becomes\n" "* New features are being tested on \"nightly\", \"beta\" is what becomes\n"
" \"stable\" every six weeks.\n" " \"stable\" every six weeks.\n"
"\n" "\n"
"* Dependencies can also be resolved from alternative [registries], git, "
"folders, and more.\n"
"\n"
"* Rust also has [editions]: the current edition is Rust 2021. Previous\n" "* Rust also has [editions]: the current edition is Rust 2021. Previous\n"
" editions were Rust 2015 and Rust 2018.\n" " editions were Rust 2015 and Rust 2018.\n"
"\n" "\n"
@ -2015,6 +2011,9 @@ msgstr ""
"torna\n" "torna\n"
" \"stable\" a cada seis semanas.\n" " \"stable\" a cada seis semanas.\n"
"\n" "\n"
"* Dependências também podem ser resolvidas a partir de [registros]"
"[registries] alternativos, git, pastas, e outros mais.\n"
"\n"
"* O Rust também tem [edições][editions]: a edição atual é o Rust 2021. As " "* O Rust também tem [edições][editions]: a edição atual é o Rust 2021. As "
"edições\n" "edições\n"
" anteriores foram o Rust 2015 e o Rust 2018.\n" " anteriores foram o Rust 2015 e o Rust 2018.\n"
@ -2467,15 +2466,15 @@ msgstr "Rust se encaixa na mesma área que C++:"
msgid "" msgid ""
"* High flexibility.\n" "* High flexibility.\n"
"* High level of control.\n" "* High level of control.\n"
"* Can be scaled down to very constrained devices like mobile phones.\n" "* Can be scaled down to very constrained devices such as microcontrollers.\n"
"* Has no runtime or garbage collection.\n" "* Has no runtime or garbage collection.\n"
"* Focuses on reliability and safety without sacrificing performance." "* Focuses on reliability and safety without sacrificing performance."
msgstr "" msgstr ""
"* Alta flexibilidade.\n" "* Alta flexibilidade.\n"
"* Alto nível de controle.\n" "* Alto nível de controle.\n"
"* Pode ser reduzido para dispositivos com menor poder computacional, como " "* Pode ser reduzido para dispositivos com menor poder computacional, tais "
"telefones celulares.\n" "como microcontroladores.\n"
"* Não tem _runtime_ ou _garbage collection_.\n" "* Não possui _runtime_ ou coletor de lixo (_garbage collection_).\n"
"* Concentra-se em confiabilidade e segurança sem sacrificar o desempenho." "* Concentra-se em confiabilidade e segurança sem sacrificar o desempenho."
#: src/hello-world.md:1 #: src/hello-world.md:1
@ -2538,7 +2537,7 @@ msgstr ""
#: src/hello-world.md:27 #: src/hello-world.md:27
msgid "" msgid ""
"* Rust is very much like other languages in the C/C++/Java tradition. It is\n" "* Rust is very much like other languages in the C/C++/Java tradition. It is\n"
" imperative (not functional) and it doesn't try to reinvent things unless\n" " imperative and it doesn't try to reinvent things unless\n"
" absolutely necessary.\n" " absolutely necessary.\n"
"\n" "\n"
"* Rust is modern with full support for things like Unicode.\n" "* Rust is modern with full support for things like Unicode.\n"
@ -2552,7 +2551,13 @@ msgid ""
"from\n" "from\n"
" the scope they are used in. Rust macros are actually only\n" " the scope they are used in. Rust macros are actually only\n"
" [partially hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/" " [partially hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/"
"hygiene.html)." "hygiene.html).\n"
"\n"
"* Rust is multi-paradigm. For example, it has powerful [object-oriented "
"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html),\n"
" and, while it is not a functional language, it includes a range of "
"[functional concepts](https://doc.rust-lang.org/book/ch13-00-functional-"
"features.html)."
msgstr "" msgstr ""
"* Rust é muito parecido com outras linguagens na tradição C/C++/Java. É\n" "* Rust é muito parecido com outras linguagens na tradição C/C++/Java. É\n"
" imperativo (não funcional) e não tenta reinventar as coisas, a menos que\n" " imperativo (não funcional) e não tenta reinventar as coisas, a menos que\n"
@ -2567,8 +2572,15 @@ msgstr ""
"* Macros \"higiênicas\" significam que elas não capturam acidentalmente\n" "* Macros \"higiênicas\" significam que elas não capturam acidentalmente\n"
" identificadores do escopo em que são usadas. As macros em Rust são, na " " identificadores do escopo em que são usadas. As macros em Rust são, na "
"verdade,\n" "verdade,\n"
"apenas [parcialmente higiênicas](https://veykril.github.io/tlborm/decl-" " apenas [parcialmente \"higiênicas\"](https://veykril.github.io/tlborm/decl-"
"macros/minutiae/hygiene.html)." "macros/minutiae/hygiene.html).\n"
"\n"
"* Rust é multi-paradigma. Por exemplo, ele possui [funcionalidades de "
"programação orientada à objetos](https://doc.rust-lang.org/book/ch17-00-oop."
"html) poderosas,\n"
" e, embora não seja uma linguagem _funcional_, inclui uma série de "
"[conceitos _funcionais_](https://doc.rust-lang.org/book/ch13-00-functional-"
"features.html)."
#: src/hello-world/small-example.md:1 #: src/hello-world/small-example.md:1
msgid "# Small Example" msgid "# Small Example"
@ -2858,9 +2870,9 @@ msgid "# Modern Features"
msgstr "# Recursos Modernos" msgstr "# Recursos Modernos"
#: src/why-rust/modern.md:3 #: src/why-rust/modern.md:3
msgid "Rust is built with all the experience gained in the last 40 years." msgid "Rust is built with all the experience gained in the last decades."
msgstr "" msgstr ""
"O Rust é construído com toda a experiência adquirida nos últimos 40 anos." "O Rust é construído com toda a experiência adquirida nas últimas décadas."
#: src/why-rust/modern.md:5 #: src/why-rust/modern.md:5
msgid "## Language Features" msgid "## Language Features"
@ -3031,13 +3043,13 @@ msgstr "# Tipos Escalares"
msgid "" msgid ""
"| | Types | " "| | Types | "
"Literals |\n" "Literals |\n"
"|------------------------|--------------------------------------------|-------------------------------|\n" "|------------------------|--------------------------------------------|--------------------------------|\n"
"| Signed integers | `i8`, `i16`, `i32`, `i64`, `i128`, `isize` | " "| Signed integers | `i8`, `i16`, `i32`, `i64`, `i128`, `isize` | "
"`-10`, `0`, `1_000`, `123i64` |\n" "`-10`, `0`, `1_000`, `123_i64` |\n"
"| Unsigned integers | `u8`, `u16`, `u32`, `u64`, `u128`, `usize` | `0`, " "| Unsigned integers | `u8`, `u16`, `u32`, `u64`, `u128`, `usize` | `0`, "
"`123`, `10u16` |\n" "`123`, `10_u16` |\n"
"| Floating point numbers | `f32`, `f64` | " "| Floating point numbers | `f32`, `f64` | "
"`3.14`, `-10.0e20`, `2f32` |\n" "`3.14`, `-10.0e20`, `2_f32` |\n"
"| Strings | `&str` | " "| Strings | `&str` | "
"`\"foo\"`, `\"two\\nlines\"` |\n" "`\"foo\"`, `\"two\\nlines\"` |\n"
"| Unicode scalar values | `char` | " "| Unicode scalar values | `char` | "
@ -3047,14 +3059,14 @@ msgid ""
msgstr "" msgstr ""
"| | Tipos | " "| | Tipos | "
"Literais |\n" "Literais |\n"
"|---------------------------|--------------------------------------------|------------------------------ " "|---------------------------|--------------------------------------------|------------------------------- "
"|\n" "|\n"
"| Inteiros com sinal | `i8`, `i16`, `i32`, `i64`, `i128`, `isize` | " "| Inteiros com sinal | `i8`, `i16`, `i32`, `i64`, `i128`, `isize` | "
"`-10`, `0`, `1_000`, `123i64` |\n" "`-10`, `0`, `1_000`, `123_i64` |\n"
"| Inteiros sem sinal | `u8`, `u16`, `u32`, `u64`, `u128`, `usize` | " "| Inteiros sem sinal | `u8`, `u16`, `u32`, `u64`, `u128`, `usize` | "
"`0`, `123`, `10u16` |\n" "`0`, `123`, `10_u16` |\n"
"| Números de ponto flutuante| `f32`, `f64` | " "| Números de ponto flutuante| `f32`, `f64` | "
"`3.14`, `-10.0e20`, `2f32` |\n" "`3.14`, `-10.0e20`, `2_f32` |\n"
"| Strings | `&str` | " "| Strings | `&str` | "
"`\"foo\"`, `\"two\\nlines\"` |\n" "`\"foo\"`, `\"two\\nlines\"` |\n"
"| Valores escalares Unicode | `char` | " "| Valores escalares Unicode | `char` | "
@ -3104,7 +3116,11 @@ msgid ""
" println!(\"{:?}\", b\"abc\");\n" " println!(\"{:?}\", b\"abc\");\n"
" println!(\"{:?}\", &[97, 98, 99]);\n" " println!(\"{:?}\", &[97, 98, 99]);\n"
" }\n" " }\n"
" ```" " ```\n"
"\n"
"- All underscores in numbers can be left out, they are for legibility only.\n"
" So `1_000` can be written as `1000` (or `10_00`), and `123_i64` can be "
"written as `123i64`."
msgstr "" msgstr ""
"- Strings brutas permitem que você crie um valor `&str` com caracteres de " "- Strings brutas permitem que você crie um valor `&str` com caracteres de "
"escape desabilitados: `r\"\\n\"\n" "escape desabilitados: `r\"\\n\"\n"
@ -3126,7 +3142,12 @@ msgstr ""
" println!(\"{:?}\", b\"abc\");\n" " println!(\"{:?}\", b\"abc\");\n"
" println!(\"{:?}\", &[97, 98, 99]);\n" " println!(\"{:?}\", &[97, 98, 99]);\n"
" }\n" " }\n"
" ```" " ```\n"
"\n"
"- Todos os sublinhados em números podem ser omitidos, eles são apenas para "
"legibilidade.\n"
" Por exemplo, `1_000` pode ser escrito como `1000` (ou `10_00`), e "
"`123_i64` pode ser escrito como `123i64`."
#: src/basic-syntax/compound-types.md:1 #: src/basic-syntax/compound-types.md:1
msgid "# Compound Types" msgid "# Compound Types"
@ -3386,6 +3407,7 @@ msgid ""
" println!(\"a: {a:?}\");\n" " println!(\"a: {a:?}\");\n"
"\n" "\n"
" let s: &[i32] = &a[2..4];\n" " let s: &[i32] = &a[2..4];\n"
"\n"
" println!(\"s: {s:?}\");\n" " println!(\"s: {s:?}\");\n"
"}\n" "}\n"
"```" "```"
@ -3396,19 +3418,21 @@ msgstr ""
" println!(\"a: {a:?}\");\n" " println!(\"a: {a:?}\");\n"
"\n" "\n"
" let s: &[i32] = &a[2..4];\n" " let s: &[i32] = &a[2..4];\n"
"\n"
" println!(\"s: {s:?}\");\n" " println!(\"s: {s:?}\");\n"
"}\n" "}\n"
"```" "```"
#: src/basic-syntax/slices.md:15 #: src/basic-syntax/slices.md:16
msgid "" msgid ""
"* Slices borrow data from the sliced type.\n" "* Slices borrow data from the sliced type.\n"
"* Question: What happens if you modify `a[3]`?" "* Question: What happens if you modify `a[3]` right before printing `s`?"
msgstr "" msgstr ""
"* As slices pegam dados emprestados do tipo original.\n" "* Slices pegam dados emprestados do tipo original.\n"
"* Pergunta: O que acontece se você modificar `a[3]`?" "* Pergunta: O que acontece se você modificar `a[3]` imediatamente antes de "
"imprimir `s`?"
#: src/basic-syntax/slices.md:20 #: src/basic-syntax/slices.md:21
msgid "" msgid ""
"* We create a slice by borrowing `a` and specifying the starting and ending " "* We create a slice by borrowing `a` and specifying the starting and ending "
"indexes in brackets.\n" "indexes in brackets.\n"
@ -3432,9 +3456,11 @@ msgid ""
" \n" " \n"
"* The question about modifying `a[3]` can spark an interesting discussion, " "* The question about modifying `a[3]` can spark an interesting discussion, "
"but the answer is that for memory safety reasons\n" "but the answer is that for memory safety reasons\n"
" you cannot do it through `a` after you created a slice, but you can read " " you cannot do it through `a` at this point in the execution, but you can "
"the data from both `a` and `s` safely. \n" "read the data from both `a` and `s` safely.\n"
" More details will be explained in the borrow checker section." " It works before you created the slice, and again after the `println`, when "
"the slice is no longer used. More details will be explained in the borrow "
"checker section."
msgstr "" msgstr ""
"* Nós criamos uma _slice_ emprestando `a` e especificando os índices de " "* Nós criamos uma _slice_ emprestando `a` e especificando os índices de "
"início e fim entre colchetes.\n" "início e fim entre colchetes.\n"
@ -3459,9 +3485,11 @@ msgstr ""
" \n" " \n"
"* A questão sobre a modificação de `a[3]` pode gerar uma discussão " "* A questão sobre a modificação de `a[3]` pode gerar uma discussão "
"interessante, mas a resposta é que por motivos de segurança de memória\n" "interessante, mas a resposta é que por motivos de segurança de memória\n"
" você não pode fazer isso por meio de `a` depois de criar uma _slice_, mas " " você não pode fazer isso por meio de `a` neste ponto durante a execução, "
"você pode ler os dados de `a` e `s` com segurança.\n" "mas você pode ler os dados de `a` e `s` com segurança.\n"
" Mais detalhes serão explicados na seção do verificador de empréstimos." " Isto funciona antes da criação do _slice_, e novamente depois de "
"`println`, quando o _slice_ não é mais necessário. Mais detalhes serão "
"explicados na seção do verificador de empréstimos."
#: src/basic-syntax/string-slices.md:1 #: src/basic-syntax/string-slices.md:1
msgid "# `String` vs `str`" msgid "# `String` vs `str`"
@ -3733,7 +3761,12 @@ msgid ""
"\n" "\n"
"* Inner doc comments are discussed later (in the page on modules) and need " "* Inner doc comments are discussed later (in the page on modules) and need "
"not\n" "not\n"
" be addressed here." " be addressed here.\n"
"\n"
"* Rustdoc comments can contain code snippets that we can run and test using "
"`cargo test`.\n"
" We will discuss these tests in the [Testing section](../testing/doc-tests."
"html)."
msgstr "" msgstr ""
"* Mostre aos alunos os documentos gerados para o crate `rand` em\n" "* Mostre aos alunos os documentos gerados para o crate `rand` em\n"
" [`docs.rs/rand`](https://docs.rs/rand).\n" " [`docs.rs/rand`](https://docs.rs/rand).\n"
@ -3744,7 +3777,12 @@ msgstr ""
"\n" "\n"
"* Os comentários internos do documento são discutidos posteriormente (na " "* Os comentários internos do documento são discutidos posteriormente (na "
"página sobre módulos) e não precisam ser\n" "página sobre módulos) e não precisam ser\n"
" ser abordados aqui." " ser abordados aqui.\n"
"\n"
"* Os comentários do Rustdoc podem conter trechos de código-fonte, que podem "
"ser executados e testados por meio de `cargo test`.\n"
" Nós discutiremos estes testes na [seção de Testes](../testing/doc-tests."
"html)."
#: src/basic-syntax/methods.md:1 src/methods.md:1 #: src/basic-syntax/methods.md:1 src/methods.md:1
msgid "# Methods" msgid "# Methods"
@ -3819,7 +3857,7 @@ msgstr ""
#: src/basic-syntax/methods.md:34 #: src/basic-syntax/methods.md:34
msgid "" msgid ""
"- Add a `Rectangle::new` constructor and call this from `main`:\n" "- Add a static method called `Rectangle::new` and call this from `main`:\n"
"\n" "\n"
" ```rust,editable,compile_fail\n" " ```rust,editable,compile_fail\n"
" fn new(width: u32, height: u32) -> Rectangle {\n" " fn new(width: u32, height: u32) -> Rectangle {\n"
@ -3827,10 +3865,17 @@ msgid ""
" }\n" " }\n"
" ```\n" " ```\n"
"\n" "\n"
"- Add a `Rectangle::new_square(width: u32)` constructor to illustrate that\n" "- While _technically_, rust does not have custom constructors, static "
" constructors can take arbitrary parameters." "methods are commonly used to initialize structs (but don't have to).\n"
" The actual constructor, `Rectangle { width, height }`, could be called "
"directly. See the [Rustnomicon](https://doc.rust-lang.org/nomicon/"
"constructors.html).\n"
"\n"
"- Add a `Rectangle::new_square(width: u32)` constructor to illustrate that "
"such static methods can take arbitrary parameters."
msgstr "" msgstr ""
"- Adicione um construtor `Retangulo::new` e o chame a partir de `main`:\n" "- Adicione um método estático chamado `Retangulo::new` e o chame a partir de "
"`main`:\n"
"\n" "\n"
" ```rust,editable,compile_fail\n" " ```rust,editable,compile_fail\n"
" fn new(largura: u32, altura: u32) -> Retangulo {\n" " fn new(largura: u32, altura: u32) -> Retangulo {\n"
@ -3838,9 +3883,15 @@ msgstr ""
" }\n" " }\n"
" ```\n" " ```\n"
"\n" "\n"
"- Enquanto _tecnicamente_, o Rust não possui construtores customizados, "
"métodos estáticos são normalmente usados para inicializar _structs_ (embora "
"não sejam necessários).\n"
"The construtor propriamente dito, `Retangulo { largura, altura }`, poderia "
"ser chamado diretamente. Veja o [Rustnomicon](https://doc.rust-lang.org/"
"nomicon/constructors.html).\n"
"\n"
"- Adicione um construtor `Rectangle::novo_quadrado(largura: u32)` para " "- Adicione um construtor `Rectangle::novo_quadrado(largura: u32)` para "
"ilustrar que\n" "demonstrar que tais métodos estáticos podem ter parâmetros arbitrários."
" construtores podem ter parâmetros arbitrários."
#: src/basic-syntax/functions-interlude.md:1 #: src/basic-syntax/functions-interlude.md:1
msgid "# Function Overloading" msgid "# Function Overloading"
@ -4440,12 +4491,16 @@ msgstr ""
#: src/basic-syntax/type-inference.md:46 #: src/basic-syntax/type-inference.md:46
msgid "" msgid ""
"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator."
"html#method.collect) relies on `FromIterator`, which [`HashSet`](https://doc." "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/"
"rust-lang.org/std/iter/trait.FromIterator.html) implements." "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-lang."
"org/std/collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-"
"HashSet%3CT,+S%3E) implements."
msgstr "" msgstr ""
"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator."
"html#method.collect) depende de `FromIterator`, que [`HashSet`](https://doc." "html#method.collect) depende de [`FromIterator`](https://doc.rust-lang.org/"
"rust-lang.org/std/iter/trait.FromIterator.html) implementa." "std/iter/trait.FromIterator.html), que [`HashSet`](https://doc.rust-lang.org/"
"std/collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-HashSet%3CT,"
"+S%3E) implementa."
#: src/basic-syntax/static-and-const.md:1 #: src/basic-syntax/static-and-const.md:1
msgid "# Static and Constant Variables" msgid "# Static and Constant Variables"
@ -4555,19 +4610,22 @@ msgstr ""
"Quando um valor de escopo global não tem uma razão para precisar identidade " "Quando um valor de escopo global não tem uma razão para precisar identidade "
"de objeto, geralmente `const` é preferido." "de objeto, geralmente `const` é preferido."
#: src/basic-syntax/static-and-const.md:45 #: src/basic-syntax/static-and-const.md:44
msgid "" msgid ""
"Because `static` variables are accessible from any thread, they need to be "
"guarded, for example by a [`Mutex`](https://doc.rust-lang.org/std/sync/"
"struct.Mutex.html), or accessed using `unsafe` code.\n"
"We will look at [mutating static data](../unsafe/mutable-static-variables." "We will look at [mutating static data](../unsafe/mutable-static-variables."
"md) in the chapter on Unsafe Rust.\n" "md) in the chapter on Unsafe Rust."
"Because `static` variables are accessible from any thread, mutable static "
"variables require manual, unsafe, synchronization of accesses."
msgstr "" msgstr ""
"Como variáveis estáticas (`static`) são acessíveis a partir que qualquer "
"_thread_, elas precisam ser guardadas, por exemplo, por um [`Mutex`](https://"
"doc.rust-lang.org/std/sync/struct.Mutex.html), ou acessadas por meio de "
"código inseguro (`unsafe`).\n"
"Nós iremos ver [dados estáticos mutáveis](../unsafe/mutable-static-variables." "Nós iremos ver [dados estáticos mutáveis](../unsafe/mutable-static-variables."
"md) no capítulo sobre Rust _inseguro_.\n" "md) no capítulo sobre Rust inseguro (\"_Unsafe Rust_\")."
"Variáveis estáticas mutáveis são acessíveis por qualquer _thread_ e por isso "
"necessitam de sincronização de acessos manual e insegura (_unsafe_)."
#: src/basic-syntax/static-and-const.md:50 #: src/basic-syntax/static-and-const.md:49
msgid "" msgid ""
"* Mention that `const` behaves semantically similar to C++'s `constexpr`.\n" "* Mention that `const` behaves semantically similar to C++'s `constexpr`.\n"
"* `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 "
@ -4738,18 +4796,17 @@ msgstr ""
" * Sem garantias de localidade de memória." " * Sem garantias de localidade de memória."
#: src/memory-management/stack.md:1 #: src/memory-management/stack.md:1
msgid "# Stack Memory" msgid "# Stack and Heap Example"
msgstr "# Memória de Pilha (_Stack Memory_)" msgstr "# Exemplo de Pilha e _Heap_"
#: src/memory-management/stack.md:3 #: src/memory-management/stack.md:3
msgid "" msgid ""
"Creating a `String` puts fixed-sized data on the stack and dynamically " "Creating a `String` puts fixed-sized metadata on the stack and dynamically "
"sized\n" "sized\n"
"data on the heap:" "data, the actual string, on the heap:"
msgstr "" msgstr ""
"A criação de uma `String` coloca dados de tamanho fixo na pilha e dados " "A criação de uma `String` coloca metadados de tamanho fixo na pilha e dados "
"dimensionados dinamicamente\n" "dinamicamente dimensionados - a string propriamente dita - no _heap_:"
"no heap:"
#: src/memory-management/stack.md:6 #: src/memory-management/stack.md:6
msgid "" msgid ""
@ -4817,7 +4874,7 @@ msgid ""
"lead to\n" "lead to\n"
" // undefined behavior.\n" " // undefined behavior.\n"
" unsafe {\n" " unsafe {\n"
" let (capacity, ptr, len): (usize, usize, usize) = std::mem::" " let (ptr, capacity, len): (usize, usize, usize) = std::mem::"
"transmute(s1);\n" "transmute(s1);\n"
" println!(\"ptr = {ptr:#x}, len = {len}, capacity = " " println!(\"ptr = {ptr:#x}, len = {len}, capacity = "
"{capacity}\");\n" "{capacity}\");\n"
@ -4844,10 +4901,10 @@ msgstr ""
" s1.push_str(\"mundo\");\n" " s1.push_str(\"mundo\");\n"
" // NÃO FAÇA ISSO EM CASA! Somente com propósito educacional.\n" " // NÃO FAÇA ISSO EM CASA! Somente com propósito educacional.\n"
" // String não fornece nenhuma garantia sobre o seu layout, então isso " " // String não fornece nenhuma garantia sobre o seu layout, então isso "
"pode levar\n" "pode causar\n"
" // a um comportamento indefinido.\n" " // um comportamento indefinido.\n"
" unsafe {\n" " unsafe {\n"
" let (capacity, ptr, len): (usize, usize, usize) = std::mem::" " let (ptr, capacity, len): (usize, usize, usize) = std::mem::"
"transmute(s1);\n" "transmute(s1);\n"
" println!(\"Ponteiro = {ptr:#x}, tamanho = {len}, capacidade = " " println!(\"Ponteiro = {ptr:#x}, tamanho = {len}, capacidade = "
"{capacity}\");\n" "{capacity}\");\n"
@ -4905,10 +4962,14 @@ msgstr ""
msgid "" msgid ""
"Memory is leaked if the function returns early between `malloc` and `free`: " "Memory is leaked if the function returns early between `malloc` and `free`: "
"the\n" "the\n"
"pointer is lost and we cannot deallocate the memory." "pointer is lost and we cannot deallocate the memory.\n"
"Worse, freeing the pointer twice, or accessing a freed pointer can lead to "
"exploitable security vulnerabilities."
msgstr "" msgstr ""
"Memória é vazada se a função retornar mais cedo entre `malloc` e `free`: o\n" "Memória é vazada se a função retornar mais cedo entre `malloc` e `free`: o\n"
"ponteiro é perdido e não podemos desalocar a memória." "ponteiro é perdido e não podemos liberar a memória.\n"
"Pior ainda, liberando o ponteiro duas vezes, ou acessando um ponteiro já "
"liberado pode levar a vulnerabilidades de segurança."
#: src/memory-management/scope-based.md:1 #: src/memory-management/scope-based.md:1
msgid "# Scope-Based Memory Management" msgid "# Scope-Based Memory Management"
@ -5372,8 +5433,8 @@ msgstr ""
"```" "```"
#: src/ownership/double-free-modern-cpp.md:1 #: src/ownership/double-free-modern-cpp.md:1
msgid "# Double Frees in Modern C++" msgid "# Extra Work in Modern C++ "
msgstr "# Liberações Duplas (_Double Frees_) em C++ Moderno" msgstr "# Trabalho Extra em C++ Moderno"
#: src/ownership/double-free-modern-cpp.md:3 #: src/ownership/double-free-modern-cpp.md:3
msgid "Modern C++ solves this differently:" msgid "Modern C++ solves this differently:"
@ -6965,11 +7026,11 @@ msgid ""
" }\n" " }\n"
" fn create_default() {\n" " fn create_default() {\n"
" let tmp = Person {\n" " let tmp = Person {\n"
" ..Default::default()\n" " ..Person::default()\n"
" };\n" " };\n"
" let tmp = Person {\n" " let tmp = Person {\n"
" name: \"Sam\".to_string(),\n" " name: \"Sam\".to_string(),\n"
" ..Default::default()\n" " ..Person::default()\n"
" };\n" " };\n"
" }\n" " }\n"
" ```\n" " ```\n"
@ -7013,11 +7074,11 @@ msgstr ""
" }\n" " }\n"
" fn create_default() {\n" " fn create_default() {\n"
" let tmp = Pessoa {\n" " let tmp = Pessoa {\n"
" ..Default::default()\n" " ..Pessoa::default()\n"
" };\n" " };\n"
" let tmp = Pessoa {\n" " let tmp = Pessoa {\n"
" nome: \"Sam\".to_string(),\n" " nome: \"Sam\".to_string(),\n"
" ..Default::default()\n" " ..Pessoa::default()\n"
" };\n" " };\n"
" }\n" " }\n"
" ```\n" " ```\n"
@ -25226,6 +25287,46 @@ msgid ""
"```" "```"
msgstr "" msgstr ""
#~ msgid "### Rustup (Recommended)"
#~ msgstr "### Rustup (Recomendado)"
#~ msgid "### Package Managers"
#~ msgstr "### Gerenciadores de pacotes"
#~ msgid "#### Debian"
#~ msgstr "#### Debian"
#~ msgid ""
#~ "On Debian/Ubuntu, you can install Cargo, the Rust source and the [Rust "
#~ "formatter][6] with"
#~ msgstr ""
#~ "No Debian/Ubuntu, você pode instalar o Cargo, o código-fonte Rust e o "
#~ "[formatador Rust][6] com"
#~ msgid ""
#~ "This will allow [rust-analyzer][1] to jump to the definitions. We suggest "
#~ "using\n"
#~ "[VS Code][2] to edit the code (but any LSP compatible editor works)."
#~ msgstr ""
#~ "Isso permitirá que o [rust-analyzer][1] localize as definições. Sugerimos "
#~ "usar o\n"
#~ "[VS Code][2] para editar o código (mas qualquer editor compatível com LSP "
#~ "funciona)."
#~ msgid ""
#~ "We will look at [mutating static data](../unsafe/mutable-static-variables."
#~ "md) in the chapter on Unsafe Rust.\n"
#~ "Because `static` variables are accessible from any thread, mutable static "
#~ "variables require manual, unsafe, synchronization of accesses."
#~ msgstr ""
#~ "Nós iremos ver [dados estáticos mutáveis](../unsafe/mutable-static-"
#~ "variables.md) no capítulo sobre Rust _inseguro_.\n"
#~ "Variáveis estáticas mutáveis são acessíveis por qualquer _thread_ e por "
#~ "isso necessitam de sincronização de acessos manual e insegura (_unsafe_)."
#~ msgid "# Stack Memory"
#~ msgstr "# Memória de Pilha (_Stack Memory_)"
#~ msgid "Global state is managed with static and constant variables." #~ msgid "Global state is managed with static and constant variables."
#~ msgstr "O estado global é gerenciado com variáveis estáticas e constantes." #~ msgstr "O estado global é gerenciado com variáveis estáticas e constantes."