-
Notifications
You must be signed in to change notification settings - Fork 226
FormData #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormData #335
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cambios sugeridos.
Estás mandando PR desde tu master.
No afecta envio y revision, pero:
Lo que se hace con GIT es mantener tu master intacto.
Cuando quieras hacer modificaciones, creas un "branch", lo modificas y haces el PR desde ahí.
🧉
5-network/02-formdata/article.md
Outdated
|
||
From the server point of view, that looks like a usual form submission. | ||
Desde el punto de vista del servidor, se vé como una entrega normal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Desde el punto de vista del servidor, se vé como una entrega normal. | |
Desde el punto de vista del servidor, se ve como una entrega normal. |
5-network/02-formdata/article.md
Outdated
- `formData.has(name)` - if there exists a field with the given `name`, returns `true`, otherwise `false` | ||
- `formData.append(name, value)` - agrega un campo al formulario con el nombre `name` y el valor `value`, | ||
- `formData.append(name, blob, fileName)` - agrega un campo tal como si se tratara de un `<input type="file">`, el tercer argumento `fileName` establece el nombre del archivo (no el nombre del campo), tal como si se tratara del nombre del archivo en el sistema de archivos del usuario, | ||
- `formData.delete(name)` - remove el campo de nombre `name`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `formData.delete(name)` - remove el campo de nombre `name`, | |
- `formData.delete(name)` - elimina el campo de nombre `name`, |
5-network/02-formdata/article.md
Outdated
- `formData.append(name, blob, fileName)` - agrega un campo tal como si se tratara de un `<input type="file">`, el tercer argumento `fileName` establece el nombre del archivo (no el nombre del campo), tal como si se tratara del nombre del archivo en el sistema de archivos del usuario, | ||
- `formData.delete(name)` - remove el campo de nombre `name`, | ||
- `formData.get(name)` - obtiene el valor del campo con el nombre `name`, | ||
- `formData.has(name)` - en caso de que exista el campo con el nombre `name`, retorna `true`, de lo contrario `false` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solemos traducir "devuelve"
"retorna" está bien, pero por consistencia con el resto de los art preferimos devuelve
- `formData.has(name)` - en caso de que exista el campo con el nombre `name`, retorna `true`, de lo contrario `false` | |
- `formData.has(name)` - en caso de que exista el campo con el nombre `name`, devuelve `true`, de lo contrario `false` |
5-network/02-formdata/article.md
Outdated
|
||
```html run autorun | ||
<form id="formElem"> | ||
<input type="text" name="name" value="John"> | ||
<input type="text" name="surname" value="Smith"> | ||
<input type="text" name="nombre" value="John"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solamente como nota:
No traducimos nombres de variables, htm clases o id,
(incluso debemos ser cuidadosos al traducir contenido entre comillas)
en HTML ' name="xxx" ', xxx es un nombre referenciable por codigo como "class="
Lo dejamos a criterio del traductor, pero recomendamos cuidado y probarlo la página con un server local.
En este caso no importa porque es un ej y no se referencia en todo el articulo,
lo comento para futuras traducciones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De acuerdo con @joaquinelio
5-network/02-formdata/article.md
Outdated
|
||
There's also method `set`, with the same syntax as `append`. The difference is that `.set` removes all fields with the given `name`, and then appends a new field. So it makes sure there's only one field with such `name`, the rest is just like `append`: | ||
Por otra parte existe un método `set`, con la misma sintáxis que `append`. La diferencia está en que `.set` remueve todos los campos con el `name` que se le ha pasado, y luego agrega el nuevo campo. De este modo nos aseguramos de que sólo un campo éxiste con determinado `name`, el resto es tal cómo en `append`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Por otra parte existe un método `set`, con la misma sintáxis que `append`. La diferencia está en que `.set` remueve todos los campos con el `name` que se le ha pasado, y luego agrega el nuevo campo. De este modo nos aseguramos de que sólo un campo éxiste con determinado `name`, el resto es tal cómo en `append`: | |
Por otra parte existe un método `set`, con la misma sintáxis que `append`. La diferencia está en que `.set` remueve todos los campos con el `name` que se le ha pasado, y luego agrega el nuevo campo. De este modo nos aseguramos de que sólo un campo éxiste con determinado `name`, el resto es tal como en `append`: |
5-network/02-formdata/article.md
Outdated
|
||
As we've seen in the chapter <info:fetch>, it's easy to send dynamically generated binary data e.g. an image, as `Blob`. We can supply it directly as `fetch` parameter `body`. | ||
Tal como pudimos ver en el capítulo <info:fetch>, es fácil enviar datos binarios generados dinámicamente ej. una imagen, como `Blob`. Podemos simplemente proporcionarla a `fetch` como un parametro en el `body`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La norma de las comas encerrando un bloque.
No sé por qué el ruso se enrosca tanto explicando, fetch('ruta imagen ', { method: 'POST' , body: blob }
Tal como pudimos ver en el capítulo info:fetch, es fácil enviar datos binarios generados dinámicamente, por ej. una imagen, como Blob
. Podemos proporcionarlos directamente a un fetch
con el parámetro body
.
Cambié de opinión. Creo que es más facil de leer.
Tal como pudimos ver en el capítulo <info:fetch>, es fácil enviar datos binarios generados dinámicamente ej. una imagen, como `Blob`. Podemos simplemente proporcionarla a `fetch` como un parametro en el `body`. | |
Tal como pudimos ver en el capítulo <info:fetch>, es fácil enviar datos binarios generados dinámicamente (por ejemplo una imagen) como `Blob`. Podemos proporcionarlos directamente en un `fetch` con el parámetro `body`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De acuerdo con @joaquinelio
5-network/02-formdata/article.md
Outdated
|
||
```js | ||
formData.append("image", imageBlob, "image.png"); | ||
``` | ||
|
||
That's same as if there were `<input type="file" name="image">` in the form, and the visitor submitted a file named `"image.png"` (3rd argument) with the data `imageBlob` (2nd argument) from their filesystem. | ||
Se obtiene el mismo resultado tal como si se tuviese un campo `<input type="file" name="image">` en el formulario, y el usuario enviara un archivo con nombre `"image.png"` (3er argumento) con los datos `imageBlob` (2do argumento) desde su sistema de archivos. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Medio denso... ¿puedo? El original es mas corto, si te parece:
(Aunque tampoco me gusta el original, lo haría más esquemático menos verboso )
Se obtiene el mismo resultado tal como si se tuviese un campo `<input type="file" name="image">` en el formulario, y el usuario enviara un archivo con nombre `"image.png"` (3er argumento) con los datos `imageBlob` (2do argumento) desde su sistema de archivos. | |
Es lo mismo que si hubiera un campo `<input type="file" name="image">` en el formulario, y el usuario enviara un archivo con nombre `"image.png"` (3er argumento) con los datos `imageBlob` (2do argumento) desde su sistema de archivos. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No olvides el exceso de comas @joaquinelio, jajajaja
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debí quitar esa coma delante de la "y"... @maksumi
No recuerdo si la noté, pero queda demasiado largo.
De acuerdo, la coma NO marca pausas al lector sino estructura, habría que reescribirlo.
Ni se me ocurre hacerlo. Good enough.
5-network/02-formdata/article.md
Outdated
|
||
We can either create `new FormData(form)` from an HTML form, or create a object without a form at all, and then append fields with methods: | ||
Podemos de este modo utilizar `new FormData(form)` tal que from es un elemento formulario HTML, o crear un objeto sin un formulario en absoluto, y agregar los campos con los siguientes métodos: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Es inconsistente en el original pero en ingles se disimula porque usa el new como parte de la explicación.
Podemos de este modo utilizar `new FormData(form)` tal que from es un elemento formulario HTML, o crear un objeto sin un formulario en absoluto, y agregar los campos con los siguientes métodos: | |
Podemos crear el objeto con `new FormData(form)` desde un formulario HTML , o crearlo sin un formulario en absoluto y agregar los campos con los siguientes métodos: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Podemos de este modo utilizar `new FormData(form)` tal que from es un elemento formulario HTML, o crear un objeto sin un formulario en absoluto, y agregar los campos con los siguientes métodos: | |
Podemos crear el objeto con `new FormData(form)` desde un formulario HTML, o crearlo sin un formulario en absoluto y agregar los campos con los siguientes métodos: |
Lo que dijo @joaquinelio pero sin ese espacio
5-network/02-formdata/article.md
Outdated
|
||
1. The `set` method removes fields with the same name, `append` doesn't. That's the only difference between them. | ||
2. To send a file, 3-argument syntax is needed, the last argument is a file name, that normally is taken from user filesystem for `<input type="file">`. | ||
1. El método `set` remueve campos con el mismo nombre, mientras que `append` no. Esta es la única diferencia entre estos dos metodos. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. El método `set` remueve campos con el mismo nombre, mientras que `append` no. Esta es la única diferencia entre estos dos metodos. | |
1. El método `set` remueve campos con el mismo nombre, mientras que `append` no. Esta es la única diferencia entre estos dos métodos. |
|
||
That's it! | ||
¡Esto es todo! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's all folks!
jeje
infancia de... mediados del siglo pasado
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pa, que te dí trabajo che...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the requested changes. After it, add a comment "/done". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excelente traducción, algunas sugerencias a tomar en cuenta, otras como una alternativa solamente y unos cuantos typos a corregir
5-network/02-formdata/article.md
Outdated
@@ -1,31 +1,31 @@ | |||
|
|||
# FormData | |||
|
|||
This chapter is about sending HTML forms: with or without files, with additional fields and so on. | |||
Éste capítulo se trata del envío de formularios HTML: con o sin archivos, con campos adicionales y cosas similares. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Éste capítulo se trata del envío de formularios HTML: con o sin archivos, con campos adicionales y cosas similares. | |
Éste capítulo trata sobre el envío de formularios HTML: con o sin archivos, con campos adicionales y cosas similares. |
#Opcional
5-network/02-formdata/article.md
Outdated
|
||
## Sending a simple form | ||
## Enviando un simple formulario |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Enviando un simple formulario | |
## Enviando un formulario simple |
Sugiero el adjetivo calificativo después, tal como lo haces en la linea 21, ya que guarda más sentido en la definición del tipo de formulario y no parece centrarse en el valor de este mismo.
5-network/02-formdata/article.md
Outdated
|
||
```html run autorun | ||
<form id="formElem"> | ||
<input type="text" name="name" value="John"> | ||
<input type="text" name="surname" value="Smith"> | ||
<input type="text" name="nombre" value="John"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De acuerdo con @joaquinelio
5-network/02-formdata/article.md
Outdated
@@ -1,31 +1,31 @@ | |||
|
|||
# FormData | |||
|
|||
This chapter is about sending HTML forms: with or without files, with additional fields and so on. | |||
Éste capítulo se trata del envío de formularios HTML: con o sin archivos, con campos adicionales y cosas similares. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Éste capítulo se trata del envío de formularios HTML: con o sin archivos, con campos adicionales y cosas similares. | |
Éste capítulo trata sobre el envío de formularios HTML: con o sin archivos, con campos adicionales y cosas similares. |
Opcional
5-network/02-formdata/article.md
Outdated
|
||
## Sending a simple form | ||
## Enviando un simple formulario |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Enviando un simple formulario | |
## Enviando un formulario simple |
Sugiero el calificativo al final, tal como lo haces con la linea 21, para una mejor referencia al tipo de formulario y no el valor que tiene
5-network/02-formdata/article.md
Outdated
@@ -154,36 +154,36 @@ This example submits an image from `<canvas>`, along with some other fields, as | |||
</body> | |||
``` | |||
|
|||
Please note how the image `Blob` is added: | |||
Note como la imagen `Blob` es agregada: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note como la imagen `Blob` es agregada: | |
Nota como la imagen `Blob` es agregada: |
Anteriormente empezaste usando lenguaje informal así que sería bueno conservar el estilo
5-network/02-formdata/article.md
Outdated
|
||
```js | ||
formData.append("image", imageBlob, "image.png"); | ||
``` | ||
|
||
That's same as if there were `<input type="file" name="image">` in the form, and the visitor submitted a file named `"image.png"` (3rd argument) with the data `imageBlob` (2nd argument) from their filesystem. | ||
Se obtiene el mismo resultado tal como si se tuviese un campo `<input type="file" name="image">` en el formulario, y el usuario enviara un archivo con nombre `"image.png"` (3er argumento) con los datos `imageBlob` (2do argumento) desde su sistema de archivos. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Se obtiene el mismo resultado tal como si se tuviese un campo `<input type="file" name="image">` en el formulario, y el usuario enviara un archivo con nombre `"image.png"` (3er argumento) con los datos `imageBlob` (2do argumento) desde su sistema de archivos. | |
Es lo mismo que si hubiera un campo `<input type="file" name="image">` en el formulario y el usuario enviara un archivo con nombre `"image.png"` (3er argumento) con los datos `imageBlob` (2do argumento) desde su sistema de archivos. |
5-network/02-formdata/article.md
Outdated
|
||
```js | ||
formData.append("image", imageBlob, "image.png"); | ||
``` | ||
|
||
That's same as if there were `<input type="file" name="image">` in the form, and the visitor submitted a file named `"image.png"` (3rd argument) with the data `imageBlob` (2nd argument) from their filesystem. | ||
Se obtiene el mismo resultado tal como si se tuviese un campo `<input type="file" name="image">` en el formulario, y el usuario enviara un archivo con nombre `"image.png"` (3er argumento) con los datos `imageBlob` (2do argumento) desde su sistema de archivos. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No olvides el exceso de comas @joaquinelio, jajajaja
5-network/02-formdata/article.md
Outdated
|
||
[FormData](https://xhr.spec.whatwg.org/#interface-formdata) objects are used to capture HTML form and submit it using `fetch` or another network method. | ||
[FormData](https://xhr.spec.whatwg.org/#interface-formdata) objetos utilizados para capturar un formulario HTML y enviarlo utilizando `fetch` u otro método de red. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[FormData](https://xhr.spec.whatwg.org/#interface-formdata) objetos utilizados para capturar un formulario HTML y enviarlo utilizando `fetch` u otro método de red. | |
Los objetos [FormData](https://xhr.spec.whatwg.org/#interface-formdata) son utilizados para capturar un formulario HTML y enviarlo utilizando `fetch` u otro método de red. |
5-network/02-formdata/article.md
Outdated
|
||
We can either create `new FormData(form)` from an HTML form, or create a object without a form at all, and then append fields with methods: | ||
Podemos de este modo utilizar `new FormData(form)` tal que from es un elemento formulario HTML, o crear un objeto sin un formulario en absoluto, y agregar los campos con los siguientes métodos: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Podemos de este modo utilizar `new FormData(form)` tal que from es un elemento formulario HTML, o crear un objeto sin un formulario en absoluto, y agregar los campos con los siguientes métodos: | |
Podemos crear el objeto con `new FormData(form)` desde un formulario HTML, o crearlo sin un formulario en absoluto y agregar los campos con los siguientes métodos: |
Lo que dijo @joaquinelio pero sin ese espacio
/done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Falta corregir unos puntos señalados por Joaquin, los cuáles he argumentado o simplemente señalado con un like. Una vez corregidos, ¡approve!
5-network/02-formdata/article.md
Outdated
|
||
The form is always sent as `Content-Type: multipart/form-data`, this encoding allows to send files. So, `<input type="file">` fields are sent also, similar to a usual form submission. | ||
El formulario siempre es enviado como `Content-Type: multipart/form-data`, Esta codificación permite enviar archivos. Por lo tanto campos, `<input type="file">` también son enviados, tal como sucede en un envío normal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considera esta...
5-network/02-formdata/article.md
Outdated
|
||
Here's an example with such form: | ||
Aquí un ejemplo con un formulario de éste tipo: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La RAE recomienda dejar de usar la tilde en pronombres demostrativos como este... Así que, igual, tómalo e cuenta.
@MazkeZen
Bien, se me habían pasado, creo que ahora sí está todo. |
That's all! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thank you 💖 I updated the Progress Issue #17 🎉 🎉 🎉 |
No description provided.