Skip to content

Conversation

EzequielMonforte
Copy link
Contributor

#18

Need help translating words : IDs, array, keys

@EzequielMonforte EzequielMonforte changed the title WIP: List sand Keys WIP: Lists and Keys Feb 1, 2019
@EzequielMonforte EzequielMonforte changed the title WIP: Lists and Keys Lists and Keys Feb 1, 2019
@EzequielMonforte EzequielMonforte changed the title Lists and Keys Lists and Keys Translation Feb 1, 2019
No recomendamos usar índices para keys si el orden de los ítems puede cambiar. Esto puede impactar negativamente el rendimiento y puede causar problemas con el estado del componente. Revisa el árticulo de Robin Pokorny para una [explicación en profundidad de los impactos negativos de usar un índice como key](https://medium.com/@robinpokorny/index-as-a-key-is-an-anti-pattern-e0349aece318). Si eliges no asignar una key explícita a la lista de items, React por defecto usara índices como keys.

Aqui esta una [explicacion en profundidad sobre porque las keys son necesarias](/docs/reconciliation.html#recursing-on-children) si estas interesado en aprender mas.
Aquí esta una [explicación en profundidad sobre porque las keys son necesarias](/docs/reconciliation.html#recursing-on-children) si estas interesado en aprender más.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps Aquí hay instead of Aquí está

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the original text it is Here is, so for me it should be Aquí está .
It should be Here there is to be translated in Aquí hay in my opinion. What do you think?

Las keys solo tienen sentido en el contexto de un array circundante.

For example, if you [extract](/docs/components-and-props.html#extracting-components) a `ListItem` component, you should keep the key on the `<ListItem />` elements in the array rather than on the `<li>` element in the `ListItem` itself.
Por ejemplo, si [extraes](/docs/components-and-props.html#extracting-components) un componente `ListItem`, debes mantener la key en el elemnto `<ListItem />` en el array en lugar de en el elemento `<li>` en el `ListItem` en si mismo.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be better translated this way:

... debes mantener la key en los elementos <ListItem /> en el array en lugar de en los elementos <li> en el ListItem en sí.

Regardless of that, note elemnto before <ListItem />, it should be elemento/s
Note

Copy link
Contributor Author

@EzequielMonforte EzequielMonforte Feb 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO

...derberias mantener la key en los elementos <ListItem /> en el array en lugar de en el elemento <li> en el <ListItem /> en si mismo.

Sounds better. What do you think?

const value = props.value;
return (
// Wrong! There is no need to specify the key here:
// Mal! No es necesario especificar la key aquí:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion: // Mal! Aquí no es necesario especificar la key:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gariasf what about No hay necesidad de especificar la key

const numbers = props.numbers;
const listItems = numbers.map((number) =>
// Wrong! The key should have been specified here:
// Mal! La key debería haber sido especificada aquí:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion: // Mal! Aquí la key debería haber sido especificada:

```javascript{2,3,9,10}
function ListItem(props) {
// Correct! There is no need to specify the key here:
// Correcto! No hay necesidad de especificar la key aquí:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion: // Correcto! Aquí no hay necesidad de especificar la key:

@gariasf
Copy link

gariasf commented Feb 2, 2019

Hey! I left some reviews on the first commit and GitHub marks them as "outdated", but they are new nonetheless.

@EzequielMonforte
Copy link
Contributor Author

I've done some corrections. Please tell me if there is something else to correct

Copy link
Member

@carburo carburo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @EzequielMonforte. Judging by your comment I think you closed the PR by mistake. I made some suggestions and fix some typos. Thank you for your contribution!

carburo and others added 13 commits February 5, 2019 00:48
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
Co-Authored-By: EzequielMonforte <ezequielmonforte@gmail.com>
@EzequielMonforte
Copy link
Contributor Author

Thanks @carburo ! I've applied some of your suggestions

@carburo
Copy link
Member

carburo commented Feb 5, 2019

Looks good to me. Merging 🚀

@carburo carburo merged commit 5de647c into reactjs:master Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants