@@ -1734,14 +1734,18 @@ msgid ""
1734
1734
"if the `std` library implemented a single style for all `Vec<T>`, what style "
1735
1735
"should it be? Would it be either of these two?"
1736
1736
msgstr ""
1737
+ "`fmt::Display` puede ser más limpio que `fmt::Debug` pero esto presenta un problema"
1738
+ "para la biblioteca `std`. ¿Cómo se deben mostrar los tipos ambiguos? Por ejemplo, " ,
1739
+ "si la biblioteca `std` implementó un sólo estilo para todos `Vec<T>`, ¿qué estilo "
1740
+ "debería ser? ¿Sería cualquiera de estos dos?"
1737
1741
1738
1742
#: src/hello/print/print_display.md:35
1739
1743
msgid "`Vec<path>`: `/:/etc:/home/username:/bin` (split on `:`)"
1740
- msgstr ""
1744
+ msgstr "`Vec<path>`: `/:/etc:/home/usuario:/bin` (split on `:`) "
1741
1745
1742
1746
#: src/hello/print/print_display.md:36
1743
1747
msgid "`Vec<number>`: `1,2,3` (split on `,`)"
1744
- msgstr ""
1748
+ msgstr "`Vec<numero>`: `1,2,3` (partido en `,`) "
1745
1749
1746
1750
#: src/hello/print/print_display.md:38
1747
1751
msgid ""
@@ -1750,55 +1754,64 @@ msgid ""
1750
1754
"`Vec<T>` or for any other generic containers. `fmt::Debug` must then be used "
1751
1755
"for these generic cases."
1752
1756
msgstr ""
1757
+ "No, porque no hay un estilo ideal para todos los tipos y la biblioteca `std` "
1758
+ "no presume dictar uno. `fmt::Display` no se implementa para "
1759
+ "`Vec<T>` o para cualquier otro contenedor genérico. `Fmt::Debug` debe usarse "
1760
+ "para estos casos genéricos" .
1753
1761
1754
1762
#: src/hello/print/print_display.md:43
1755
1763
msgid ""
1756
1764
"This is not a problem though because for any new _container_ type which is "
1757
1765
"_not_ generic, `fmt::Display` can be implemented."
1758
1766
msgstr ""
1767
+ "Sin embargo, esto no es un problema porque para cualquier nuevo tipo _contenedor_ que sea"
1768
+ "_no_ genérico, se puede implementar `fmt::Display` " .
1759
1769
1760
1770
#: src/hello/print/print_display.md:47
1761
1771
msgid "// Import `fmt`\n"
1762
- msgstr ""
1772
+ msgstr "// Importar `fmt`\n "
1763
1773
1764
1774
#: src/hello/print/print_display.md:48
1765
1775
msgid ""
1766
1776
"// A structure holding two numbers. `Debug` will be derived so the results "
1767
1777
"can\n"
1768
1778
"// be contrasted with `Display`.\n"
1769
1779
msgstr ""
1780
+ "// Una estructura que contiene dos números. Se derivará `Debug` para que los resultados"
1781
+ "puedan"
1782
+ "// ser contrastados con `Display`. \ n "
1770
1783
1771
1784
#: src/hello/print/print_display.md:53
1772
1785
msgid "// Implement `Display` for `MinMax`.\n"
1773
- msgstr ""
1786
+ msgstr "// Implementa `Display` para `MinMax`.\n "
1774
1787
1775
1788
#: src/hello/print/print_display.md:57
1776
1789
msgid "// Use `self.number` to refer to each positional data point.\n"
1777
- msgstr ""
1790
+ msgstr "// Usa `self.number` para referirte a cada dato posicional.\n "
1778
1791
1779
1792
#: src/hello/print/print_display.md:58
1780
1793
msgid "\" ({}, {})\" "
1781
1794
msgstr ""
1782
1795
1783
1796
#: src/hello/print/print_display.md:61
1784
1797
msgid "// Define a structure where the fields are nameable for comparison.\n"
1785
- msgstr ""
1798
+ msgstr "// Define una estructura donde los campos se puedan nombrar para compararse.\n "
1786
1799
1787
1800
#: src/hello/print/print_display.md:68
1788
1801
msgid "// Similarly, implement `Display` for `Point2D`.\n"
1789
- msgstr ""
1802
+ msgstr "// Similarmente, implementa `Display` para `Point2D` "
1790
1803
1791
1804
#: src/hello/print/print_display.md:72
1792
1805
msgid "// Customize so only `x` and `y` are denoted.\n"
1793
- msgstr ""
1806
+ msgstr "// Personalízalo para que sólo `x` y `y` sean denotados.\n "
1794
1807
1795
1808
#: src/hello/print/print_display.md:73
1796
1809
msgid "\" x: {}, y: {}\" "
1797
1810
msgstr ""
1798
1811
1799
1812
#: src/hello/print/print_display.md:80
1800
1813
msgid "\" Compare structures:\" "
1801
- msgstr ""
1814
+ msgstr "\" Compara estructuras: \" "
1802
1815
1803
1816
#: src/hello/print/print_display.md:81 src/hello/print/print_display.md:94
1804
1817
msgid "\" Display: {}\" "
@@ -1810,18 +1823,21 @@ msgstr ""
1810
1823
1811
1824
#: src/hello/print/print_display.md:87
1812
1825
msgid "\" The big range is {big} and the small is {small}\" "
1813
- msgstr ""
1826
+ msgstr "\" El rango grande es {big} y el pequeño es {small} \" "
1814
1827
1815
1828
#: src/hello/print/print_display.md:93
1816
1829
msgid "\" Compare points:\" "
1817
- msgstr ""
1830
+ msgstr "\" Compara Puntos: \" "
1818
1831
1819
1832
#: src/hello/print/print_display.md:97
1820
1833
msgid ""
1821
1834
"// Error. Both `Debug` and `Display` were implemented, but `{:b}`\n"
1822
1835
" // requires `fmt::Binary` to be implemented. This will not work.\n"
1823
1836
" // println!(\" What does Point2D look like in binary: {:b}?\" , point);\n"
1824
1837
msgstr ""
1838
+ "// Error. Ambos `Debug` y `Display` fueron implementados, pero `{:b}`\n"
1839
+ " // requiere implementar `fmt::Binary`. Esto no funcionará. \ n "
1840
+ " // println!(\" ¿Cómo se ve el Punto2D en binario: {:b}? \" , point);\n"
1825
1841
1826
1842
#: src/hello/print/print_display.md:103
1827
1843
msgid ""
@@ -1831,13 +1847,21 @@ msgid ""
1831
1847
"implementation. This is detailed further in [`std::fmt`](https://doc.rust-"
1832
1848
"lang.org/std/fmt/)."
1833
1849
msgstr ""
1850
+ "Entonces, `fmt::Display` se ha implementado pero `fmt::Binary` no, y"
1851
+ "por lo tanto, no se puede usar. `std::fmt` tiene muchos de estos [`traits`](https://doc" .
1852
+ "rust-lang.org/std/fmt/#formatting-traits) y cada uno requiere su"
1853
+ "implementación. Esto se detalla aún más en [`std::fmt`](https://doc.rust-"
1854
+ "lang.org/std/fmt/)" .
1834
1855
1835
1856
#: src/hello/print/print_display.md:109
1836
1857
msgid ""
1837
1858
"After checking the output of the above example, use the `Point2D` struct as "
1838
1859
"a guide to add a `Complex` struct to the example. When printed in the same "
1839
1860
"way, the output should be:"
1840
1861
msgstr ""
1862
+ "Después de verificar la salida del ejemplo anterior, use la estructura `Point2D` como "
1863
+ "una guía para agregar una estructura `Complex` al ejemplo. Cuando se imprime de la misma manera"
1864
+ ", la salida debería ser:"
1841
1865
1842
1866
#: src/hello/print/print_display.md:120
1843
1867
msgid ""
@@ -1846,6 +1870,10 @@ msgid ""
1846
1870
"structs.md), [`trait`](https://doc.rust-lang.org/std/fmt/#formatting-"
1847
1871
"traits), and [`use`](../../mod/use.md)"
1848
1872
msgstr ""
1873
+ "[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/"
1874
+ "std/fmt/), [`macros`](../../macros.md), [`struct`](../../custom_types/"
1875
+ "structs.md), [`trait`](https://doc.rust-lang.org/std/fmt/#formatting-"
1876
+ "traits), y [`use`](../../mod/use.md)"
1849
1877
1850
1878
#: src/hello/print/print_display/testcase_list.md:3
1851
1879
msgid ""
@@ -1854,36 +1882,46 @@ msgid ""
1854
1882
"a `fmt::Result`. Proper handling of this requires dealing with _all_ the "
1855
1883
"results. Rust provides the `?` operator for exactly this purpose."
1856
1884
msgstr ""
1885
+ "Implementar `fmt::Display` para una estructura donde los elementos deben ser cada uno "
1886
+ "manejados secuencialmente es complicado. El problema es que cada `write!` genera "
1887
+ "un `fmt::Result`. El manejo adecuado de esto requiere tratar con _todos_ los"
1888
+ "resultados. Rust proporciona el operador `?` para exactamente este propósito" .
1857
1889
1858
1890
#: src/hello/print/print_display/testcase_list.md:8
1859
1891
msgid "Using `?` on `write!` looks like this:"
1860
- msgstr ""
1892
+ msgstr "Usar `?` con `write!` se ve así: "
1861
1893
1862
1894
#: src/hello/print/print_display/testcase_list.md:11
1863
1895
msgid ""
1864
1896
"// Try `write!` to see if it errors. If it errors, return\n"
1865
1897
"// the error. Otherwise continue.\n"
1866
1898
msgstr ""
1899
+ "// Usa `write!` para ver si falla. Si hay errores, regresa\n"
1900
+ "// el error. En otro caso, continúa.\n"
1867
1901
1868
1902
#: src/hello/print/print_display/testcase_list.md:16
1869
1903
msgid ""
1870
1904
"With `?` available, implementing `fmt::Display` for a `Vec` is "
1871
1905
"straightforward:"
1872
1906
msgstr ""
1907
+ "Si disponemos de `?`, implementar `fmt::Display` para un `Vec` es "
1908
+ "directo:"
1873
1909
1874
1910
#: src/hello/print/print_display/testcase_list.md:20
1875
1911
msgid "// Import the `fmt` module.\n"
1876
- msgstr ""
1912
+ msgstr "// Importar el módulo `fmt`.\n "
1877
1913
1878
1914
#: src/hello/print/print_display/testcase_list.md:21
1879
1915
msgid "// Define a structure named `List` containing a `Vec`.\n"
1880
- msgstr ""
1916
+ msgstr "// Define una estructura llamada `List` que contiene un `Vec`.\n "
1881
1917
1882
1918
#: src/hello/print/print_display/testcase_list.md:27
1883
1919
msgid ""
1884
1920
"// Extract the value using tuple indexing,\n"
1885
1921
" // and create a reference to `vec`.\n"
1886
1922
msgstr ""
1923
+ "// Extrae el valor usando indexación de tuplas,\n"
1924
+ " // y crea una referencia a `vec`.\n"
1887
1925
1888
1926
#: src/hello/print/print_display/testcase_list.md:31
1889
1927
msgid "\" [\" "
@@ -1894,20 +1932,24 @@ msgid ""
1894
1932
"// Iterate over `v` in `vec` while enumerating the iteration\n"
1895
1933
" // count in `count`.\n"
1896
1934
msgstr ""
1935
+ "// Itera sobre `v` en un `vec` mientras enumeras la cuenta\n"
1936
+ " // de la iteración en `count`.\n"
1897
1937
1898
1938
#: src/hello/print/print_display/testcase_list.md:36
1899
1939
msgid ""
1900
1940
"// For every element except the first, add a comma.\n"
1901
1941
" // Use the ? operator to return on errors.\n"
1902
1942
msgstr ""
1943
+ "// Para cada element excepto el primero, agrega una coma.\n"
1944
+ " // Usa el operador ? para regresar errroes.\n"
1903
1945
1904
1946
#: src/hello/print/print_display/testcase_list.md:38 src/std/str.md:36
1905
1947
msgid "\" , \" "
1906
1948
msgstr ""
1907
1949
1908
1950
#: src/hello/print/print_display/testcase_list.md:42
1909
1951
msgid "// Close the opened bracket and return a fmt::Result value.\n"
1910
- msgstr ""
1952
+ msgstr "// Cierra la llave abierta y regresa un valor de `fmt::Result`.\n "
1911
1953
1912
1954
#: src/hello/print/print_display/testcase_list.md:43
1913
1955
msgid "\" ]\" "
@@ -1918,6 +1960,8 @@ msgid ""
1918
1960
"Try changing the program so that the index of each element in the vector is "
1919
1961
"also printed. The new output should look like this:"
1920
1962
msgstr ""
1963
+ "Intente cambiar el programa para que el índice de cada elemento en el vector sea"
1964
+ "también impreso. La nueva salida debería verse así:"
1921
1965
1922
1966
#: src/hello/print/print_display/testcase_list.md:64
1923
1967
msgid ""
@@ -1926,10 +1970,14 @@ msgid ""
1926
1970
"structs.md), [`?`](../../../std/result/question_mark.md), and [`vec!`]"
1927
1971
"(../../../std/vec.md)"
1928
1972
msgstr ""
1973
+ "[`for`](../../../flow_control/for.md), [`ref`](../../../scope/borrow/ref."
1974
+ "md), [`Result`](../../../std/result.md), [`struct`](../../../custom_types/"
1975
+ "structs.md), [`?`](../../../std/result/question_mark.md), y [`vec!`]"
1976
+ "(../../../std/vec.md)"
1929
1977
1930
1978
#: src/hello/print/fmt.md:3
1931
1979
msgid "We've seen that formatting is specified via a _format string_:"
1932
- msgstr ""
1980
+ msgstr "Hemos visto que este formato se especifica via una _cadena de formato_: "
1933
1981
1934
1982
#: src/hello/print/fmt.md:5
1935
1983
msgid "`format!(\" {}\" , foo)` -> `\" 3735928559\" `"
@@ -1950,6 +1998,8 @@ msgid ""
1950
1998
"The same variable (`foo`) can be formatted differently depending on which "
1951
1999
"_argument type_ is used: `X` vs `o` vs _unspecified_."
1952
2000
msgstr ""
2001
+ "La misma variable (`foo`) puede formatearse de manera diferente dependiendo de cuál sea "
2002
+ "_tipo de argumento_ utilizado: `X` vs `o` vs _no especificado_" .
1953
2003
1954
2004
#: src/hello/print/fmt.md:12
1955
2005
msgid ""
@@ -1958,20 +2008,23 @@ msgid ""
1958
2008
"which handles cases where the argument type is left unspecified: `{}` for "
1959
2009
"instance."
1960
2010
msgstr ""
2011
+ "Esta funcionalidad de formato se implementa a través de traits, y hay "
2012
+ "trait para cada tipo de argumento. El trait de formato más común es la `Display`, " ,
2013
+ "que maneja casos en los que el tipo de argumento se deja sin especificar: `{}`, por ejemplo."
1961
2014
1962
2015
#: src/hello/print/fmt.md:21
1963
2016
msgid "// Latitude\n"
1964
- msgstr ""
2017
+ msgstr "// Latitude\n "
1965
2018
1966
2019
#: src/hello/print/fmt.md:23
1967
2020
msgid "// Longitude\n"
1968
- msgstr ""
2021
+ msgstr "// Longitude\n "
1969
2022
1970
2023
#: src/hello/print/fmt.md:28
1971
2024
msgid ""
1972
2025
"// `f` is a buffer, and this method must write the formatted string into "
1973
2026
"it.\n"
1974
- msgstr ""
2027
+ msgstr "// `f` es un búfer, y este método se usa para formatear y meterle una cadena.\n "
1975
2028
1976
2029
#: src/hello/print/fmt.md:30
1977
2030
msgid "'N'"
@@ -1994,6 +2047,8 @@ msgid ""
1994
2047
"// `write!` is like `format!`, but it will write the formatted string\n"
1995
2048
" // into a buffer (the first argument).\n"
1996
2049
msgstr ""
2050
+ "// `write!` es como `format!`, pero escribirá la cadena formateada\n"
2051
+ " // al búfer (el primer argumento).\n"
1997
2052
1998
2053
#: src/hello/print/fmt.md:35
1999
2054
msgid "\" {}: {:.3}°{} {:.3}°{}\" "
@@ -2016,6 +2071,8 @@ msgid ""
2016
2071
"// Switch this to use {} once you've added an implementation\n"
2017
2072
" // for fmt::Display.\n"
2018
2073
msgstr ""
2074
+ "// Cambia esto a {} una vez que hayas añadido una implementación\n"
2075
+ " // para fmt::Display.\n"
2019
2076
2020
2077
#: src/hello/print/fmt.md:62 src/primitives/tuples.md:60
2021
2078
#: src/custom_types/structs.md:47 src/types/inference.md:23
@@ -2032,16 +2089,21 @@ msgid ""
2032
2089
"std/fmt/#formatting-traits) and their argument types in the [`std::fmt`]"
2033
2090
"(https://doc.rust-lang.org/std/fmt/) documentation."
2034
2091
msgstr ""
2092
+ "Puede ver una [lista completa de traits de formato](https://doc.rust-lang.org/"
2093
+ "std/fmt/#formatting-traits) y sus tipos de argumentos en la documentación de [`std::fmt`]"
2094
+ "(https://doc.rust-lang.org/std/fmt/)."
2035
2095
2036
2096
#: src/hello/print/fmt.md:72
2037
2097
msgid ""
2038
2098
"Add an implementation of the `fmt::Display` trait for the `Color` struct "
2039
2099
"above so that the output displays as:"
2040
2100
msgstr ""
2101
+ "Agrega una implementación del trait `fmt::Display` para la estructura `Color`"
2102
+ "arriba para que la salida se muestre como:"
2041
2103
2042
2104
#: src/hello/print/fmt.md:81
2043
2105
msgid "Three hints if you get stuck:"
2044
- msgstr ""
2106
+ msgstr "Tres pistas por si te atoras: "
2045
2107
2046
2108
#: src/hello/print/fmt.md:83
2047
2109
msgid ""
0 commit comments