Skip to content

Commit 8bc77b1

Browse files
RubenChirinojavierlopezdeancoscarburo
authored
Adding translations to the <Profiler> component (#633)
* Adding translations to the <Profiler> component * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Javier López de Ancos <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Javier López de Ancos <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> * Update beta/src/content/reference/react/Profiler.md Co-authored-by: Rainer Martinez <[email protected]> --------- Co-authored-by: Javier López de Ancos <[email protected]> Co-authored-by: Rainer Martinez <[email protected]>
1 parent ee0743e commit 8bc77b1

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

beta/src/content/reference/react/Profiler.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: <Profiler>
44

55
<Intro>
66

7-
`<Profiler>` lets you measure rendering performance of a React tree programmatically.
7+
`<Profiler>` te permite medir el rendimiento del renderizado de un árbol de componentes de React de forma programática.
88

99
```js
1010
<Profiler id="App" onRender={onRender}>
@@ -18,11 +18,11 @@ title: <Profiler>
1818

1919
---
2020

21-
## Reference {/*reference*/}
21+
## Referencia {/*reference*/}
2222

2323
### `<Profiler>` {/*profiler*/}
2424

25-
Wrap a component tree in a `<Profiler>` to measure its rendering performance.
25+
Envuelve un árbol de componentes en un `<Profiler>` para medir su rendimiento de renderizado.
2626

2727
```js
2828
<Profiler id="App" onRender={onRender}>
@@ -32,41 +32,41 @@ Wrap a component tree in a `<Profiler>` to measure its rendering performance.
3232

3333
#### Props {/*props*/}
3434

35-
* `id`: A string identifying the part of the UI you are measuring.
36-
* `onRender`: An [`onRender` callback](#onrender-callback) that React calls it every time components within the profiled tree update. It receives information about what was rendered and how much time it took.
35+
* `id`: Un string que identifica qué parte de la interfaz de usuario estás midiendo.
36+
* `onRender`: Un [*callback* `onRender`](#onrender-callback) que React llama cada vez que los componentes dentro del árbol perfilado se actualizan. Recibe información sobre lo que se renderizó y cuánto tiempo llevó.
3737

38-
#### Caveats {/*caveats*/}
38+
#### Advertencias {/*caveats*/}
3939

40-
* Profiling adds some additional overhead, so **it is disabled in the production build by default.** To opt into production profiling, you need to enable a [special production build with profiling enabled.](https://fb.me/react-profiling)
40+
* El perfilado agrega cierta sobrecarga adicional, por lo que **está deshabilitado en la versión de producción de manera predeterminada.** Para optar por el perfilado en producción, debes habilitar una [versión especial de producción con el perfilado habilitado.](https://fb.me/react-profiling)
4141

4242
---
4343

4444
### `onRender` callback {/*onrender-callback*/}
4545

46-
React will call your `onRender` callback with information about what was rendered.
46+
React llamará tu *callback* `onRender` con información sobre lo que se renderizó.
4747

4848
```js
4949
function onRender(id, phase, actualDuration, baseDuration, startTime, commitTime) {
50-
// Aggregate or log render timings...
50+
// Agregar o registrar tiempos de procesamiento...
5151
}
5252
```
5353

54-
#### Parameters {/*onrender-parameters*/}
54+
#### Parámetros {/*onrender-parameters*/}
5555

56-
* `id`: The string `id` prop of the `<Profiler>` tree that has just committed. This lets you identify which part of the tree was committed if you are using multiple profilers.
57-
* `phase`: `"mount"`, `"update"` or `"nested-update"`. This lets you know whether the tree has just been mounted for the first time or re-rendered due to a change in props, state, or hooks.
58-
* `actualDuration`: The number of milliseconds spent rendering the `<Profiler>` and its descendants for the current update. This indicates how well the subtree makes use of memoization (e.g. [`memo`](/reference/react/memo) and [`useMemo`](/reference/react/useMemo)). Ideally this value should decrease significantly after the initial mount as many of the descendants will only need to re-render if their specific props change.
59-
* `baseDuration`: The number of milliseconds estimating how much time it would take to re-render the entire `<Profiler>` subtree without any optimizations. It is calculated by summing up the most recent render durations of each component in the tree. This value estimates a worst-case cost of rendering (e.g. the initial mount or a tree with no memoization). Compare `actualDuration` against it to see if memoization is working.
60-
* `startTime`: A numeric timestamp for when React began rendering the current update.
61-
* `endTime`: A numeric timestamp for when React committed the current update. This value is shared between all profilers in a commit, enabling them to be grouped if desirable.
56+
* `id`: La prop `id` del árbol `<Profiler>` que acaba de ser entregado. Esto te permite identificar qué parte del árbol se entregó si estás usando varios perfiles.
57+
* `phase`: `"mount"`, `"update"` o `"nested-update"`. Esto te indica si el árbol acaba de ser montado por primera vez o se ha vuelto a renderizar debido a un cambio en las props, el estado o los hooks.
58+
* `actualDuration`: El número de milisegundos que se tardó en renderizar el árbol `<Profiler>` Esto indica qué tan bien el subárbol hace uso de la memoización (por ejemplo, [`memo`](/reference/react/memo) y [`useMemo`](/reference/react/useMemo)). Idealmente, este valor debería disminuir significativamente después del montaje inicial, ya que muchos de los descendientes solo necesitarán volver a renderizarse si cambian sus propiedades específicas.
59+
* `baseDuration`: El número de milisegundos que estima cuánto tiempo tardaría en volver a renderizar todo el subárbol `<Profiler>` sin ninguna optimización. Se calcula sumando las duraciones de renderizado más recientes de cada componente en el árbol. Este valor estima el costo del renderizado para el peor de caso (por ejemplo, el montaje inicial o un árbol sin memoización). Compara `actualDuration` con este valor para ver si la memorización está funcionando.
60+
* `startTime`: Una marca de tiempo numérica para cuando React comenzó a renderizar la actualización actual.
61+
* `endTime`: Una marca de tiempo numérica para cuando React entregó la actualización actual. Este valor se comparte entre todos los perfiles en una entrega, lo que permite agruparlos si es deseable.
6262

6363
---
6464

65-
## Usage {/*usage*/}
65+
## Uso {/*usage*/}
6666

67-
### Measuring rendering performance programmatically {/*measuring-rendering-performance-programmatically*/}
67+
### Medición del rendimiento de renderizado programáticamente {/*measuring-rendering-performance-programmatically*/}
6868

69-
Wrap the `<Profiler>` component around a React tree to measure its rendering performance.
69+
Envuelve el componente `<Profiler>` alrededor de un árbol de React para medir su rendimiento de renderizado.
7070

7171
```js {2,4}
7272
<App>
@@ -77,25 +77,25 @@ Wrap the `<Profiler>` component around a React tree to measure its rendering per
7777
</App>
7878
```
7979

80-
It requires two props: an `id` (string) and an `onRender` callback (function) which React calls any time a component within the tree "commits" an update.
80+
Se requieren dos props: un `id` (string) y un *callback* `onRender` (function) que React llama cada vez que un componente dentro del árbol "comete" una actualización.
8181

8282
<Pitfall>
8383

84-
Profiling adds some additional overhead, so **it is disabled in the production build by default.** To opt into production profiling, you need to enable a [special production build with profiling enabled.](https://fb.me/react-profiling)
84+
El perfilado agrega una sobrecarga adicional, por lo que **está desactivado en la compilación de producción de forma predeterminada.** Para habilitar el perfilado en producción, debes habilitar una [compilación especial de producción con el perfilado activado.](https://fb.me/react-profiling)
8585

8686
</Pitfall>
8787

8888
<Note>
8989

90-
`<Profiler>` lets you gather measurements programmatically. If you're looking for an interactive profiler, try the Profiler tab in [React Developer Tools](/learn/react-developer-tools). It exposes similar functionality as a browser extension.
90+
`<Profiler>` te permite recopilar mediciones de forma programática. Si estás buscando un perfilador interactivo, prueba la pestaña Profiler en las [Herramientas de Desarrollo de React](/learn/react-developer-tools). Expone funcionalidades similares a una extensión del navegador.
9191

9292
</Note>
9393

9494
---
9595

96-
### Measuring different parts of the application {/*measuring-different-parts-of-the-application*/}
96+
### Medición de diferentes partes de la aplicación {/*measuring-different-parts-of-the-application*/}
9797

98-
You can use multiple `<Profiler>` components to measure different parts of your application:
98+
Puedes usar varios componentes `<Profiler>` para medir diferentes partes de tu aplicación:
9999

100100
```js {5,7}
101101
<App>
@@ -108,7 +108,7 @@ You can use multiple `<Profiler>` components to measure different parts of your
108108
</App>
109109
```
110110

111-
You can also nest `<Profiler>` components:
111+
También puedes anidar componentes `<Profiler>`:
112112

113113
```js {5,7,9,12}
114114
<App>
@@ -126,7 +126,7 @@ You can also nest `<Profiler>` components:
126126
</App>
127127
```
128128

129-
Although `<Profiler>` is a lightweight component, it should be used only when necessary. Each use adds some CPU and memory overhead to an application.
129+
Aunque `<Profiler>` es un componente ligero, debería ser usado solo cuando sea necesario. Cada uso añade una sobrecarga de CPU y memoria a una aplicación.
130130

131131
---
132132

0 commit comments

Comments
 (0)