Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 39 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# The Rust Programming Language
# El lenguaje de programación Rust

![Build Status](https://github.com/rust-lang/book/workflows/CI/badge.svg)
![Status de compilación](https://github.com/rust-lang/book/workflows/CI/badge.svg)

This repository contains the source of "The Rust Programming Language" book.
Este repositorio contiene el código fuente del libro "The Rust Programming Language".

[The book is available in dead-tree form from No Starch Press][nostarch].
[El libro está disponible en formato de archivo fijo en No Starch Press.][nostarch].

[nostarch]: https://nostarch.com/rust

You can also read the book for free online. Please see the book as shipped with
the latest [stable], [beta], or [nightly] Rust releases. Be aware that issues
in those versions may have been fixed in this repository already, as those
releases are updated less frequently.
También puede leer el libro gratuitamente en línea. Por favor, vea el libro tal y como se envía con
las últimas versiones [estable], [beta], o [nightly] Ten en cuenta que los problemas
de esas versiones pueden haber sido ya corregidos en este repositorio, ya que esas
versiones se actualizan con menos frecuencia.

[stable]: https://doc.rust-lang.org/stable/book/
[estable]: https://doc.rust-lang.org/stable/book/
[beta]: https://doc.rust-lang.org/beta/book/
[nightly]: https://doc.rust-lang.org/nightly/book/

See the [releases] to download just the code of all the code listings that appear in the book.
Vea las [versiones] para descargar sólo el código de todos los listados de código que aparecen en el libro.

[releases]: https://github.com/rust-lang/book/releases
[versiones]: https://github.com/rust-lang/book/releases

## Requirements
## Requisitos

La construcción del libro requiere [mdBook], preferiblemente la misma versión que
utiliza rust-lang/rust en [este archivo][rust-mdbook]. Para conseguirlo:

Building the book requires [mdBook], ideally the same version that
rust-lang/rust uses in [this file][rust-mdbook]. To get it:

[mdBook]: https://github.com/rust-lang-nursery/mdBook
[rust-mdbook]: https://github.com/rust-lang/rust/blob/master/src/tools/rustbook/Cargo.toml
Expand All @@ -33,16 +34,16 @@ rust-lang/rust uses in [this file][rust-mdbook]. To get it:
$ cargo install mdbook --vers [version-num]
```

## Building
## crear

To build the book, type:
Para crear el libro, escriba:

```bash
$ mdbook build
```

The output will be in the `book` subdirectory. To check it out, open it in
your web browser.
El resultado estará en el subdirectorio del `book`. Para comprobarlo, ábralo en
su navegador web.

_Firefox:_
```bash
Expand All @@ -60,34 +61,35 @@ $ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell)
$ start chrome.exe .\book\index.html # Windows (Cmd)
```

To run the tests:

Para ejecutar las pruebas:
```bash
$ mdbook test
```

## Contributing
## Forma de colaborar

We'd love your help! Please see [CONTRIBUTING.md][contrib] to learn about the
kinds of contributions we're looking for.
Nos encantaría que nos ayudaras.[CONTRIBUTING.md][contrib] ara conocer el tipo de
contribuciones que buscamos.

[contrib]: https://github.com/rust-lang/book/blob/master/CONTRIBUTING.md

### Translations
### Traducciones

Nos encantaría que nos ayudaras a traducir el libro. Consulte la etiqueta [Traducciones]
para unirse a los esfuerzos que se están llevando a cabo actualmente. Abra una nueva edición
para empezar a trabajar en un nuevo idioma. Estamos esperando a que el [mdbook] sea
compatible con varios idiomas antes de fusionar alguno, pero ¡no dudes en empezar!
Revisión ortográfica

We'd love help translating the book! See the [Translations] label to join in
efforts that are currently in progress. Open a new issue to start working on
a new language! We're waiting on [mdbook support] for multiple languages
before we merge any in, but feel free to start!
[Traducciones]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations
[mdbook]: https://github.com/rust-lang-nursery/mdBook/issues/5

[Translations]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations
[mdbook support]: https://github.com/rust-lang-nursery/mdBook/issues/5
## Revisión ortográfica

## Spellchecking
Para analizar los archivos fuente en busca de errores ortográficos,
puede utilizar el script `spellcheck.sh` disponible en el directorio `ci`.
Necesita un diccionario de palabras válidas, que se proporciona en `ci/dictionary.txt.`
Si el script produce un falso positivo (por ejemplo, usted utilizó la palabra `
BTreeMap`, que el script considera inválida), debe añadiresta
palabra a `ci/dictionary.txt`(mantenga el orden ordenado para mantener la coherencia).

To scan source files for spelling errors, you can use the `spellcheck.sh`
script available in the `ci` directory. It needs a dictionary of valid words,
which is provided in `ci/dictionary.txt`. If the script produces a false
positive (say, you used word `BTreeMap` which the script considers invalid),
you need to add this word to `ci/dictionary.txt` (keep the sorted order for
consistency).
12 changes: 6 additions & 6 deletions listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ use std::io;
fn main() {
// ANCHOR_END: main
// ANCHOR: print
println!("Guess the number!");
println!("¡Adivina el número!");

println!("Please input your guess.");
println!("Por favor, introduce tu predicción.");
// ANCHOR_END: print

// ANCHOR: string
let mut guess = String::new();
let mut prediccion = String::new();
// ANCHOR_END: string

// ANCHOR: read
io::stdin()
.read_line(&mut guess)
.read_line(&mut prediccion)
// ANCHOR_END: read
// ANCHOR: expect
.expect("Failed to read line");
.expect("Lectura de línea fallida");
// ANCHOR_END: expect

// ANCHOR: print_guess
println!("You guessed: {}", guess);
println!("Predijiste: {}", prediccion);
// ANCHOR_END: print_guess
}
// ANCHOR: all
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
println!("Hello, world!");
println!("¡Hola, mundo!");
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::io;

fn main() {
println!("Guess the number!");
println!("¡Adivina el número!");

println!("Please input your guess.");
println!("Por favor, introduce tu predicción.");

let mut guess = String::new();
let mut prediccion = String::new();

io::stdin().read_line(&mut guess);
io::stdin().read_line(&mut prediccion);

println!("You guessed: {}", guess);
println!("Predijiste: {}", prediccion);
}
66 changes: 33 additions & 33 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# The Rust Programming Language
# El lenguaje de programación Rust

[The Rust Programming Language](title-page.md)
[Foreword](foreword.md)
[Introduction](ch00-00-introduction.md)
[El lenguaje de programación Rust](title-page.md)
[Prólogo](foreword.md)
[Introducción](ch00-00-introduction.md)

## Getting started
## Cómo empezar

- [Getting Started](ch01-00-getting-started.md)
- [Installation](ch01-01-installation.md)
- [Hello, World!](ch01-02-hello-world.md)
- [Hello, Cargo!](ch01-03-hello-cargo.md)
- [Cómo empezar](ch01-00-getting-started.md)
- [Instalación](ch01-01-installation.md)
- [¡Hola, mundo!](ch01-02-hello-world.md)
- [¡Hola, Cargo!](ch01-03-hello-cargo.md)

- [Programming a Guessing Game](ch02-00-guessing-game-tutorial.md)
- [Programación de un juego de adivinanzas](ch02-00-guessing-game-tutorial.md)

- [Common Programming Concepts](ch03-00-common-programming-concepts.md)
- [Variables and Mutability](ch03-01-variables-and-mutability.md)
- [Data Types](ch03-02-data-types.md)
- [Functions](ch03-03-how-functions-work.md)
- [Comments](ch03-04-comments.md)
- [Control Flow](ch03-05-control-flow.md)
- [Conceptos básicos de programación](ch03-00-common-programming-concepts.md)
- [Variables y mutabilidad](ch03-01-variables-and-mutability.md)
- [Tipos de datos](ch03-02-data-types.md)
- [Funciones](ch03-03-how-functions-work.md)
- [Comentarios](ch03-04-comments.md)
- [Control de flujo](ch03-05-control-flow.md)

- [Understanding Ownership](ch04-00-understanding-ownership.md)
- [What is Ownership?](ch04-01-what-is-ownership.md)
- [Comprensión de la propiedad](ch04-00-understanding-ownership.md)
- [¿Qué es la propiedad?](ch04-01-what-is-ownership.md)
- [References and Borrowing](ch04-02-references-and-borrowing.md)
- [The Slice Type](ch04-03-slices.md)
- [El Tipo Slice](ch04-03-slices.md)

- [Using Structs to Structure Related Data](ch05-00-structs.md)
- [Defining and Instantiating Structs](ch05-01-defining-structs.md)
- [An Example Program Using Structs](ch05-02-example-structs.md)
- [Method Syntax](ch05-03-method-syntax.md)
- [Uso de Structs para Estructurar Datos Relacionados](ch05-00-structs.md)
- [Definición e Instanciación de Structs](ch05-01-defining-structs.md)
- [Un Programa de Ejemplo con Structs](ch05-02-example-structs.md)
- [Sintaxis de Métodos](ch05-03-method-syntax.md)

- [Enums and Pattern Matching](ch06-00-enums.md)
- [Defining an Enum](ch06-01-defining-an-enum.md)
- [Enums y Comparación de Patrones](ch06-00-enums.md)
- [Definición de un Enum](ch06-01-defining-an-enum.md)
- [The `match` Control Flow Operator](ch06-02-match.md)
- [Concise Control Flow with `if let`](ch06-03-if-let.md)
- [Flujo de Control Conciso con `if let`](ch06-03-if-let.md)

## Basic Rust Literacy

Expand Down Expand Up @@ -125,11 +125,11 @@
- [Turning Our Single-Threaded Server into a Multithreaded Server](ch20-02-multithreaded.md)
- [Graceful Shutdown and Cleanup](ch20-03-graceful-shutdown-and-cleanup.md)

- [Appendix](appendix-00.md)
- [A - Keywords](appendix-01-keywords.md)
- [B - Operators and Symbols](appendix-02-operators.md)
- [Apéndice](appendix-00.md)
- [A - Palabras clave](appendix-01-keywords.md)
- [B - Operadores y símbolos](appendix-02-operators.md)
- [C - Derivable Traits](appendix-03-derivable-traits.md)
- [D - Useful Development Tools](appendix-04-useful-development-tools.md)
- [E - Editions](appendix-05-editions.md)
- [F - Translations of the Book](appendix-06-translation.md)
- [G - How Rust is Made and “Nightly Rust”](appendix-07-nightly-rust.md)
- [D - Herramientas de desarrollo útiles](appendix-04-useful-development-tools.md)
- [E - Ediciones](appendix-05-editions.md)
- [F - Traducciones del libro](appendix-06-translation.md)
- [G - Cómo se hizo Rust y “Nightly Rust”](appendix-07-nightly-rust.md)
6 changes: 3 additions & 3 deletions src/appendix-00.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Appendix
# Anexo

The following sections contain reference material you may find useful in your
Rust journey.
Las siguientes secciones contienen material de referencia que puede resultar útil en su
en su viaje por Rust.
Loading