-
Notifications
You must be signed in to change notification settings - Fork 291
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
translate error boundaries documentation to spanish #147
translate error boundaries documentation to spanish #147
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.
👋 @jesgarciamartinez, welcome and thanks for your first contribution!
I say you split the paragraphs in different lines, can you please roll that back? I'd be easy for us to review and left comments and also (the most important reason) will help us to avoid nasty git merge conflicts in the future.
Also, you forgot to translate one paragraph.
Please, let me know if you need help with this! Happy to help!
Thanks,
content/docs/error-boundaries.md
Outdated
permalink: docs/error-boundaries.html | ||
--- | ||
|
||
In the past, JavaScript errors inside components used to corrupt React’s internal state and cause it to [emit](https://github.com/facebook/react/issues/4026) [cryptic](https://github.com/facebook/react/issues/6895) [errors](https://github.com/facebook/react/issues/8579) on next renders. These errors were always caused by an earlier error in the application code, but React did not provide a way to handle them gracefully in components, and could not recover from them. | ||
En el pasado, los errores de JavaScript dentro de los componentes solían corromper el estado interno de React y | ||
hacían que [emitiera](https://github.com/facebook/react/issues/4026) [errores](https://github.com/facebook/react/issues/6895) [crípticos](https://github.com/facebook/react/issues/8579) en siguientes renderizados. |
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.
Let's keep this in the same line ( line # 7 )
content/docs/error-boundaries.md
Outdated
|
||
## Introducing Error Boundaries {#introducing-error-boundaries} | ||
Un error de JavaScript en una parte de la interfaz no debería romper toda la aplicación. | ||
Para resolver este problema, React 16 introduce el nuevo concepto de “límite de errores”. |
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.
Also, let's merge line 14 and 15.
content/docs/error-boundaries.md
Outdated
|
||
A JavaScript error in a part of the UI shouldn’t break the whole app. To solve this problem for React users, React 16 introduces a new concept of an “error boundary”. | ||
Los límites de errores son componentes de React que **capturan errores de JavaScript en cualquier parte |
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, let's merge lines 17-20 into one line.
content/docs/error-boundaries.md
Outdated
|
||
A class component becomes an error boundary if it defines either (or both) of the lifecycle methods [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) or [`componentDidCatch()`](/docs/react-component.html#componentdidcatch). Use `static getDerivedStateFromError()` to render a fallback UI after an error has been thrown. Use `componentDidCatch()` to log error information. | ||
Un componente de clase (class component) se convierte en límite de errores si define |
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 merge 31 - 34.
content/docs/error-boundaries.md
Outdated
|
||
```js | ||
<ErrorBoundary> | ||
<MyWidget /> | ||
</ErrorBoundary> | ||
``` | ||
|
||
Error boundaries work like a JavaScript `catch {}` block, but for components. Only class components can be error boundaries. In practice, most of the time you’ll want to declare an error boundary component once and use it throughout your application. | ||
Los límites de errores funcionan como un bloque catch{} de JavaScript, pero para componentes. Sólo los componentes |
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.
Merge 72 - 74
content/docs/error-boundaries.md
Outdated
|
||
```js | ||
<Button /> | ||
``` | ||
|
||
Error boundaries preserve the declarative nature of React, and behave as you would expect. For example, even if an error occurs in a `componentDidUpdate` method caused by a `setState` somewhere deep in the tree, it will still correctly propagate to the closest error boundary. | ||
Los límites de errores preservan la naturaleza declarativa de React, y se comportan como esperarías. |
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.
Merge 145-147
content/docs/error-boundaries.md
Outdated
Error boundaries preserve the declarative nature of React, and behave as you would expect. For example, even if an error occurs in a `componentDidUpdate` method caused by a `setState` somewhere deep in the tree, it will still correctly propagate to the closest error boundary. | ||
Los límites de errores preservan la naturaleza declarativa de React, y se comportan como esperarías. | ||
Por ejemplo, incluso si un error ocurre en un método `componentDidUpdate` causado por un `setState` en algún sitio | ||
profundamente dentro del árbol, se propagará de todas formas correctamente al límite de errores más cercano. |
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.
profundamente dentro del árbol, se propagará de todas formas correctamente al límite de errores más cercano. | |
profundo dentro del árbol, se propagará de todas formas correctamente al límite de errores más cercano. |
content/docs/error-boundaries.md
Outdated
|
||
Error boundaries **do not** catch errors inside event handlers. | ||
Los límites de errores **no** capturan errores en los manejadores de eventos | ||
|
||
React doesn't need error boundaries to recover from errors in event handlers. Unlike the render method and lifecycle methods, the event handlers don't happen during rendering. So if they throw, React still knows what to display on the screen. |
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.
This still needs a translation!
content/docs/error-boundaries.md
Outdated
|
||
React doesn't need error boundaries to recover from errors in event handlers. Unlike the render method and lifecycle methods, the event handlers don't happen during rendering. So if they throw, React still knows what to display on the screen. | ||
|
||
If you need to catch an error inside event handler, use the regular JavaScript `try` / `catch` statement: | ||
React no necesita límites de errores para recuperarse de errores en los manejadores de eventos. |
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.
Also, make this one line please.
content/docs/error-boundaries.md
Outdated
|
||
React 15 included a very limited support for error boundaries under a different method name: `unstable_handleError`. This method no longer works, and you will need to change it to `componentDidCatch` in your code starting from the first 16 beta release. | ||
React 15 incluía un soporte muy limitado para límites de errores con un nombre de método diferente: |
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.
Also, make this one line.
Deploy preview for es-reactjs ready! Built with commit a5a3745 |
Hi @alejandronanez, I just uploaded the requested changes. I think the formatting is fine now, and I removed the leftover english paragraph (it was actually translated in the next line). |
…s.md Co-Authored-By: jesgarciamartinez <jes.garcia.martinez@gmail.com>
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.
thanks for all the hard work @jesgarciamartinez
@dmoralesm, @carburo @alejandronanez