Skip to content

Commit 0022788

Browse files
ricardochlSplaktar
authored andcommitted
translate: translations for deferrable views tutorial
Fixes #165
1 parent 318f985 commit 0022788

8 files changed

Lines changed: 328 additions & 65 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Deferrable views tutorial
2+
3+
This interactive tutorial consists of lessons that introduce the Angular deferrable views concepts.
4+
5+
## How to use this tutorial
6+
7+
Each step represents a concept in Angular deferrable views. You can do one, or all of them.
8+
9+
If you get stuck, click "Reveal answer" at the top.
10+
11+
Alright, let's [get started](/tutorials/deferrable-views/1-what-are-deferrable-views).
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Deferrable views tutorial
1+
# Tutorial de vistas diferibles (deferrable views)
22

3-
This interactive tutorial consists of lessons that introduce the Angular deferrable views concepts.
3+
Este tutorial interactivo consiste en lecciones que introducen los conceptos de las vistas diferibles (deferrable views) de Angular.
44

5-
## How to use this tutorial
5+
## Cómo usar este tutorial
66

7-
Each step represents a concept in Angular deferrable views. You can do one, or all of them.
7+
Cada paso representa un concepto en las vistas diferibles de Angular. Puedes hacer uno, o todos ellos.
88

9-
If you get stuck, click "Reveal answer" at the top.
9+
Si te quedas atascado, haz clic en "Reveal answer" (Mostrar respuesta) en la parte superior.
1010

11-
Alright, let's [get started](/tutorials/deferrable-views/1-what-are-deferrable-views).
11+
Muy bien, [comencemos](/tutorials/deferrable-views/1-what-are-deferrable-views).
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# What are deferrable views?
2+
3+
A fully rendered Angular page may contain many different components, directives, and pipes. While certain parts of the page should be shown to the user immediately, there may be portions that can wait to display until later.
4+
Angular's _deferrable views_, using the `@defer` syntax, can help you speed up your application by telling Angular to wait to download the JavaScript for the parts of the page that don't need to be shown right away.
5+
6+
In this activity, you'll learn how to use deferrable views to defer load a section of your component template.
7+
8+
<hr>
9+
10+
<docs-workflow>
11+
12+
<docs-step title="Add a `@defer` block to a section of a template">
13+
In your `app.ts`, wrap the `article-comments` component with a `@defer` block to defer load it.
14+
15+
<docs-code language="angular-html">
16+
@defer {
17+
<article-comments />
18+
}
19+
</docs-code>
20+
21+
By default, `@defer` loads the `article-comments` component when the browser is idle.
22+
23+
In your browser's developer console, you can see that the `article-comments-component` lazy chunk file is loaded separately (The specific file names may change from run to run):
24+
25+
<docs-code language="markdown">
26+
Initial chunk files | Names | Raw size
27+
chunk-NNSQHFIE.js | - | 769.00 kB |
28+
main.js | main | 229.25 kB |
29+
30+
Lazy chunk files | Names | Raw size
31+
chunk-T5UYXUSI.js | article-comments-component | 1.84 kB |
32+
</docs-code>
33+
34+
</docs-step>
35+
</docs-workflow>
36+
37+
Great work! You’ve learned the basics of deferrable views.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# What are deferrable views?
1+
# ¿Qué son las vistas diferibles?
22

3-
A fully rendered Angular page may contain many different components, directives, and pipes. While certain parts of the page should be shown to the user immediately, there may be portions that can wait to display until later.
4-
Angular's _deferrable views_, using the `@defer` syntax, can help you speed up your application by telling Angular to wait to download the JavaScript for the parts of the page that don't need to be shown right away.
3+
Una página Angular completamente renderizada puede contener muchos componentes, directivas y pipes diferentes. Si bien ciertas partes de la página deberían mostrarse al usuario de inmediato, puede haber porciones que pueden esperar para mostrarse hasta más tarde.
4+
Las _vistas diferibles (deferrable views)_ de Angular, usando la sintaxis `@defer`, pueden ayudarte a acelerar tu aplicación indicándole a Angular que espere para descargar el JavaScript de las partes de la página que no necesitan mostrarse de inmediato.
55

6-
In this activity, you'll learn how to use deferrable views to defer load a section of your component template.
6+
En esta actividad, aprenderás cómo usar vistas diferibles para cargar de forma diferida una sección de la plantilla de tu componente.
77

88
<hr>
99

1010
<docs-workflow>
1111

12-
<docs-step title="Add a `@defer` block to a section of a template">
13-
In your `app.ts`, wrap the `article-comments` component with a `@defer` block to defer load it.
12+
<docs-step title="Agrega un bloque `@defer` a una sección de una plantilla">
13+
En tu `app.ts`, envuelve el componente `article-comments` con un bloque `@defer` para cargarlo de forma diferida.
1414

1515
<docs-code language="angular-html">
1616
@defer {
1717
<article-comments />
1818
}
1919
</docs-code>
2020

21-
By default, `@defer` loads the `article-comments` component when the browser is idle.
21+
Por defecto, `@defer` carga el componente `article-comments` cuando el navegador está inactivo.
2222

23-
In your browser's developer console, you can see that the `article-comments-component` lazy chunk file is loaded separately (The specific file names may change from run to run):
23+
En la consola de desarrollador de tu navegador, puedes ver que el archivo del chunk lazy `article-comments-component` se carga por separado (Los nombres de archivo específicos pueden cambiar de una ejecución a otra):
2424

2525
<docs-code language="markdown">
2626
Initial chunk files | Names | Raw size
@@ -34,4 +34,4 @@ chunk-T5UYXUSI.js | article-comments-component | 1.84 kB |
3434
</docs-step>
3535
</docs-workflow>
3636

37-
Great work! You’ve learned the basics of deferrable views.
37+
¡Excelente trabajo! Has aprendido los conceptos básicos de las vistas diferibles.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# @loading, @error and @placeholder blocks
2+
3+
Deferrable views let you define content to be shown in different loading states.
4+
5+
<div class="docs-table docs-scroll-track-transparent">
6+
<table>
7+
<tr>
8+
<td><code>@placeholder</code></td>
9+
<td>
10+
By default, defer blocks do not render any content before they are triggered. The <code>@placeholder</code> is an optional block that declares content to show before the deferred content loads. Angular replaces the placeholder with the deferred content after loading completes. While this block is optional, the Angular team recommends always including a placeholder.
11+
<a href="https://angular.dev/guide/templates/defer#triggers" target="_blank">
12+
Learn more in the full deferrable views documentation
13+
</a>
14+
</td>
15+
</tr>
16+
<tr>
17+
<td><code>@loading</code></td>
18+
<td>
19+
This optional block allows you to declare content to be shown during the loading of any deferred dependencies.
20+
</td>
21+
</tr>
22+
<tr>
23+
<td><code>@error</code></td>
24+
<td>
25+
This block allows you to declare content which is shown if deferred loading fails.
26+
</td>
27+
</tr>
28+
</table>
29+
</div>
30+
31+
The contents of all the above sub-blocks are eagerly loaded. Additionally, some features require a `@placeholder` block.
32+
33+
In this activity, you'll learn how to use the `@loading`, `@error` and `@placeholder` blocks to manage the states of deferrable views.
34+
35+
<hr>
36+
37+
<docs-workflow>
38+
39+
<docs-step title="Add `@placeholder` block">
40+
In your `app.ts`, add a `@placeholder` block to the `@defer` block.
41+
42+
<docs-code language="angular-html" highlight="[3,4,5]">
43+
@defer {
44+
<article-comments />
45+
} @placeholder {
46+
<p>Placeholder for comments</p>
47+
}
48+
</docs-code>
49+
</docs-step>
50+
51+
<docs-step title="Configure the `@placeholder` block">
52+
The `@placeholder` block accepts an optional parameter to specify the `minimum` amount of time that this placeholder should be shown. This `minimum` parameter is specified in time increments of milliseconds (ms) or seconds (s). This parameter exists to prevent fast flickering of placeholder content in the case that the deferred dependencies are fetched quickly.
53+
54+
<docs-code language="angular-html" highlight="[3,4,5]">
55+
@defer {
56+
<article-comments />
57+
} @placeholder (minimum 1s) {
58+
<p>Placeholder for comments</p>
59+
}
60+
</docs-code>
61+
</docs-step>
62+
63+
<docs-step title="Add `@loading` block">
64+
Next add a `@loading` block to the component template.
65+
66+
The `@loading` block accepts two optional parameters:
67+
68+
- `minimum`: the amount of time that this block should be shown
69+
- `after`: the amount of time to wait after loading begins before showing the loading template
70+
71+
Both parameters are specified in time increments of milliseconds (ms) or seconds (s).
72+
73+
Update `app.ts` to include a `@loading` block with a minimum parameter of `1s` as well as an after parameter with the value 500ms to the @loading block.
74+
75+
<docs-code language="angular-html" highlight="[5,6,7]">
76+
@defer {
77+
<article-comments />
78+
} @placeholder (minimum 1s) {
79+
<p>Placeholder for comments</p>
80+
} @loading (minimum 1s; after 500ms) {
81+
<p>Loading comments...</p>
82+
}
83+
</docs-code>
84+
85+
NOTE: this example uses two parameters, separated by the ; character.
86+
87+
</docs-step>
88+
89+
<docs-step title="Add `@error` block">
90+
Finally, add an `@error` block to the `@defer` block.
91+
92+
<docs-code language="angular-html" highlight="[7,8,9]">
93+
@defer {
94+
<article-comments />
95+
} @placeholder (minimum 1s) {
96+
<p>Placeholder for comments</p>
97+
} @loading (minimum 1s; after 500ms) {
98+
<p>Loading comments...</p>
99+
} @error {
100+
<p>Failed to load comments</p>
101+
}
102+
</docs-code>
103+
</docs-step>
104+
</docs-workflow>
105+
106+
Congratulations! At this point, you have a good understanding about deferrable views. Keep up the great work and let's learn about triggers next.
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
# @loading, @error and @placeholder blocks
1+
# Bloques @loading, @error y @placeholder
22

3-
Deferrable views let you define content to be shown in different loading states.
3+
Las vistas diferibles te permiten definir contenido que se mostrará en diferentes estados de carga.
44

55
<div class="docs-table docs-scroll-track-transparent">
66
<table>
77
<tr>
88
<td><code>@placeholder</code></td>
99
<td>
10-
By default, defer blocks do not render any content before they are triggered. The <code>@placeholder</code> is an optional block that declares content to show before the deferred content loads. Angular replaces the placeholder with the deferred content after loading completes. While this block is optional, the Angular team recommends always including a placeholder.
10+
Por defecto, los bloques defer no renderizan ningún contenido antes de ser disparados. El bloque <code>@placeholder</code> es un bloque opcional que declara contenido para mostrar antes de que el contenido diferido se cargue. Angular reemplaza el placeholder con el contenido diferido después de que la carga se completa. Aunque este bloque es opcional, el equipo de Angular recomienda incluir siempre un placeholder.
1111
<a href="https://angular.dev/guide/templates/defer#triggers" target="_blank">
12-
Learn more in the full deferrable views documentation
12+
Aprende más en la documentación completa de vistas diferibles
1313
</a>
1414
</td>
1515
</tr>
1616
<tr>
1717
<td><code>@loading</code></td>
1818
<td>
19-
This optional block allows you to declare content to be shown during the loading of any deferred dependencies.
19+
Este bloque opcional te permite declarar contenido que se mostrará durante la carga de cualquier dependencia diferida.
2020
</td>
2121
</tr>
2222
<tr>
2323
<td><code>@error</code></td>
2424
<td>
25-
This block allows you to declare content which is shown if deferred loading fails.
25+
Este bloque te permite declarar contenido que se muestra si la carga diferida falla.
2626
</td>
2727
</tr>
2828
</table>
2929
</div>
3030

31-
The contents of all the above sub-blocks are eagerly loaded. Additionally, some features require a `@placeholder` block.
31+
El contenido de todos los sub-bloques anteriores se carga de forma inmediata. Adicionalmente, algunas funcionalidades requieren un bloque `@placeholder`.
3232

33-
In this activity, you'll learn how to use the `@loading`, `@error` and `@placeholder` blocks to manage the states of deferrable views.
33+
En esta actividad, aprenderás cómo usar los bloques `@loading`, `@error` y `@placeholder` para gestionar los estados de las vistas diferibles.
3434

3535
<hr>
3636

3737
<docs-workflow>
3838

39-
<docs-step title="Add `@placeholder` block">
40-
In your `app.ts`, add a `@placeholder` block to the `@defer` block.
39+
<docs-step title="Agrega un bloque `@placeholder`">
40+
En tu `app.ts`, agrega un bloque `@placeholder` al bloque `@defer`.
4141

4242
<docs-code language="angular-html" highlight="[3,4,5]">
4343
@defer {
@@ -48,8 +48,8 @@ In your `app.ts`, add a `@placeholder` block to the `@defer` block.
4848
</docs-code>
4949
</docs-step>
5050

51-
<docs-step title="Configure the `@placeholder` block">
52-
The `@placeholder` block accepts an optional parameter to specify the `minimum` amount of time that this placeholder should be shown. This `minimum` parameter is specified in time increments of milliseconds (ms) or seconds (s). This parameter exists to prevent fast flickering of placeholder content in the case that the deferred dependencies are fetched quickly.
51+
<docs-step title="Configura el bloque `@placeholder`">
52+
El bloque `@placeholder` acepta un parámetro opcional para especificar la cantidad de tiempo `minimum` que este placeholder debe mostrarse. Este parámetro `minimum` se especifica en incrementos de tiempo de milisegundos (ms) o segundos (s). Este parámetro existe para evitar el parpadeo rápido del contenido del placeholder en caso de que las dependencias diferidas se obtengan rápidamente.
5353

5454
<docs-code language="angular-html" highlight="[3,4,5]">
5555
@defer {
@@ -60,17 +60,17 @@ The `@placeholder` block accepts an optional parameter to specify the `minimum`
6060
</docs-code>
6161
</docs-step>
6262

63-
<docs-step title="Add `@loading` block">
64-
Next add a `@loading` block to the component template.
63+
<docs-step title="Agrega un bloque `@loading`">
64+
A continuación, agrega un bloque `@loading` a la plantilla del componente.
6565

66-
The `@loading` block accepts two optional parameters:
66+
El bloque `@loading` acepta dos parámetros opcionales:
6767

68-
- `minimum`: the amount of time that this block should be shown
69-
- `after`: the amount of time to wait after loading begins before showing the loading template
68+
- `minimum`: la cantidad de tiempo que este bloque debe mostrarse
69+
- `after`: la cantidad de tiempo a esperar después de que comience la carga antes de mostrar la plantilla de carga
7070

71-
Both parameters are specified in time increments of milliseconds (ms) or seconds (s).
71+
Ambos parámetros se especifican en incrementos de tiempo de milisegundos (ms) o segundos (s).
7272

73-
Update `app.ts` to include a `@loading` block with a minimum parameter of `1s` as well as an after parameter with the value 500ms to the @loading block.
73+
Actualiza `app.ts` para incluir un bloque `@loading` con un parámetro minimum de `1s` así como un parámetro after con el valor 500ms para el bloque @loading.
7474

7575
<docs-code language="angular-html" highlight="[5,6,7]">
7676
@defer {
@@ -82,12 +82,12 @@ Update `app.ts` to include a `@loading` block with a minimum parameter of `1s` a
8282
}
8383
</docs-code>
8484

85-
NOTE: this example uses two parameters, separated by the ; character.
85+
NOTA: este ejemplo usa dos parámetros, separados por el carácter ;.
8686

8787
</docs-step>
8888

89-
<docs-step title="Add `@error` block">
90-
Finally, add an `@error` block to the `@defer` block.
89+
<docs-step title="Agrega un bloque `@error`">
90+
Finalmente, agrega un bloque `@error` al bloque `@defer`.
9191

9292
<docs-code language="angular-html" highlight="[7,8,9]">
9393
@defer {
@@ -103,4 +103,4 @@ Finally, add an `@error` block to the `@defer` block.
103103
</docs-step>
104104
</docs-workflow>
105105

106-
Congratulations! At this point, you have a good understanding about deferrable views. Keep up the great work and let's learn about triggers next.
106+
¡Felicidades! En este punto, tienes un buen entendimiento sobre las vistas diferibles. Sigue con el excelente trabajo y aprendamos sobre los triggers a continuación.

0 commit comments

Comments
 (0)