Skip to content

Commit 62f762a

Browse files
committed
translate: translations for essentials guides
Translations for the following guides 1. `introduction/essentials/overview` 2. `introduction/essentials/components` 3. `introduction/essentials/managing-dynamic-data` 4. `introduction/essentials/rendering-dynamic-templates` 5. `introduction/essentials/conditionals-and-loops` 6. `introduction/essentials/handling-user-interaction` 7. `introduction/essentials/sharing-logic` 8. `introduction/essentials/next-steps` These translations include changes on the `sub-navigations-data.ts` file as well. Fixes #12
1 parent 7bdf9c5 commit 62f762a

17 files changed

+734
-167
lines changed

adev-es/src/app/sub-navigation-data.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,45 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [
3232
contentPath: 'introduction/what-is-angular',
3333
},
3434
{
35-
label: 'Essentials',
35+
label: 'Esenciales',
3636
children: [
3737
{
38-
label: 'Overview',
38+
label: 'Visión General',
3939
path: 'essentials',
4040
contentPath: 'introduction/essentials/overview',
4141
},
4242
{
43-
label: 'Composing with Components',
43+
label: 'Composición basada en Componentes',
4444
path: 'essentials/components',
4545
contentPath: 'introduction/essentials/components',
4646
},
4747
{
48-
label: 'Managing Dynamic Data',
48+
label: 'Gestión de Datos Dinámicos',
4949
path: 'essentials/managing-dynamic-data',
5050
contentPath: 'introduction/essentials/managing-dynamic-data',
5151
},
5252
{
53-
label: 'Rendering Dynamic Templates',
53+
label: 'Renderizado de Plantillas Dinámicas',
5454
path: 'essentials/rendering-dynamic-templates',
5555
contentPath: 'introduction/essentials/rendering-dynamic-templates',
5656
},
5757
{
58-
label: 'Conditionals and Loops',
58+
label: 'Condicionales y Bucles',
5959
path: 'essentials/conditionals-and-loops',
6060
contentPath: 'introduction/essentials/conditionals-and-loops',
6161
},
6262
{
63-
label: 'Handling User Interaction',
63+
label: 'Manejo de la Interacción del Usuario',
6464
path: 'essentials/handling-user-interaction',
6565
contentPath: 'introduction/essentials/handling-user-interaction',
6666
},
6767
{
68-
label: 'Sharing Logic',
68+
label: 'Compartiendo Lógica',
6969
path: 'essentials/sharing-logic',
7070
contentPath: 'introduction/essentials/sharing-logic',
7171
},
7272
{
73-
label: 'Next Steps',
73+
label: 'Siguientes Pasos',
7474
path: 'essentials/next-steps',
7575
contentPath: 'introduction/essentials/next-steps',
7676
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<docs-decorative-header title="Components" imgSrc="adev/src/assets/images/components.svg"> <!-- markdownlint-disable-line -->
2+
The fundamental building block for creating applications in Angular.
3+
</docs-decorative-header>
4+
5+
Components provide structure for organizing your project into easy-to-understand parts with clear responsibilities so that your code is maintainable and scalable.
6+
7+
Here is an example of how a Todo application could be broken down into a tree of components.
8+
9+
```mermaid
10+
flowchart TD
11+
A[TodoApp]-->B
12+
A-->C
13+
B[TodoList]-->D
14+
C[TodoMetrics]
15+
D[TodoListItem]
16+
```
17+
18+
In this guide, we'll take a look at how to create and use components in Angular.
19+
20+
## Defining a Component
21+
22+
Every component has the following core properties:
23+
24+
1. A `@Component`[decorator](https://www.typescriptlang.org/docs/handbook/decorators.html) that contains some configuration
25+
2. An HTML template that controls what renders into the DOM
26+
3. A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors) that defines how the component is used in HTML
27+
4. A TypeScript class with behaviors such as managing state, handling user input, or fetching data from a server.
28+
29+
Here is a simplified example of a TodoListItem component.
30+
31+
```ts
32+
// todo-list-item.component.ts
33+
@Component({
34+
selector: 'todo-list-item',
35+
template: `
36+
<li>(TODO) Read Angular Essentials Guide</li>
37+
`,
38+
})
39+
export class TodoListItem {
40+
/* Component behavior is defined in here */
41+
}
42+
```
43+
44+
Other common metadata that you'll also see in components include:
45+
46+
- `standalone: true` — The recommended approach of streamlining the authoring experience of components
47+
- `styles` — A string or array of strings that contains any CSS styles you want applied to the component
48+
49+
Knowing this, here is an updated version of our `TodoListItem` component.
50+
51+
```ts
52+
// todo-list-item.component.ts
53+
@Component({
54+
standalone: true,
55+
selector: 'todo-list-item',
56+
template: `
57+
<li>(TODO) Read Angular Essentials Guide</li>
58+
`,
59+
styles: `
60+
li {
61+
color: red;
62+
font-weight: 300;
63+
}
64+
`,
65+
})
66+
export class TodoListItem {
67+
/* Component behavior is defined in here */
68+
}
69+
```
70+
71+
### Separating HTML and CSS into separate files
72+
73+
For teams that prefer managing their HTML and/or CSS in separate files, Angular provides two additional properties: `templateUrl` and `styleUrl`.
74+
75+
Using the previous `TodoListItem` component, the alternative approach looks like:
76+
77+
```ts
78+
// todo-list-item.component.ts
79+
@Component({
80+
standalone: true,
81+
selector: 'todo-list-item',
82+
templateUrl: './todo-list-item.component.html',
83+
styleUrl: './todo-list-item.component.css',
84+
})
85+
export class TodoListItem {
86+
/* Component behavior is defined in here */
87+
}
88+
```
89+
90+
```html
91+
<!-- todo-list-item.component.html -->
92+
<li>(TODO) Read Angular Essentials Guide</li>
93+
```
94+
95+
```css
96+
// todo-list-item.component.css
97+
li {
98+
color: red;
99+
font-weight: 300;
100+
}
101+
```
102+
103+
## Using a Component
104+
105+
One advantage of component architecture is that your application is modular. In other words, components can be used in other components.
106+
107+
To use a component, you need to:
108+
109+
1. Import the component into the file
110+
2. Add it to the component's `imports` array
111+
3. Use the component's selector in the `template`
112+
113+
Here's an example of a `TodoList` component importing the `TodoListItem` component from before:
114+
115+
```ts
116+
// todo-list.component.ts
117+
import {TodoListItem} from './todo-list-item.component.ts';
118+
119+
@Component({
120+
standalone: true,
121+
imports: [TodoListItem],
122+
template: `
123+
<ul>
124+
<todo-list-item></todo-list-item>
125+
</ul>
126+
`,
127+
})
128+
export class TodoList {}
129+
```
130+
131+
## Next Step
132+
133+
Now that you know how components work in Angular, it's time to learn how we add and manage dynamic data in our application.
134+
135+
<docs-pill-row>
136+
<docs-pill title="Managing Dynamic Data" href="essentials/managing-dynamic-data" />
137+
</docs-pill-row>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<docs-decorative-header title="Components" imgSrc="adev/src/assets/images/components.svg"> <!-- markdownlint-disable-line -->
2-
The fundamental building block for creating applications in Angular.
1+
<docs-decorative-header title="Componentes" imgSrc="adev/src/assets/images/components.svg"> <!-- markdownlint-disable-line -->
2+
El elemento fundamental para crear aplicaciones en Angular.
33
</docs-decorative-header>
44

5-
Components provide structure for organizing your project into easy-to-understand parts with clear responsibilities so that your code is maintainable and scalable.
5+
Los componentes proporcionan la estructura para organizar su proyecto en partes fáciles de entender con responsabilidades claras para que su código sea mantenible y escalable.
66

7-
Here is an example of how a Todo application could be broken down into a tree of components.
7+
Aquí hay un ejemplo de cómo una aplicación de Tareas Pendientes (ToDo en inglés) se podría dividir en un árbol de componentes.
88

99
```mermaid
1010
flowchart TD
@@ -15,46 +15,46 @@ flowchart TD
1515
D[TodoListItem]
1616
```
1717

18-
In this guide, we'll take a look at how to create and use components in Angular.
18+
En esta guía, veremos cómo crear y usar componentes en Angular.
1919

20-
## Defining a Component
20+
## Definiendo un Componente
2121

22-
Every component has the following core properties:
22+
Cada componente tiene las siguientes propiedades principales:
2323

24-
1. A `@Component`[decorator](https://www.typescriptlang.org/docs/handbook/decorators.html) that contains some configuration
25-
2. An HTML template that controls what renders into the DOM
26-
3. A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors) that defines how the component is used in HTML
27-
4. A TypeScript class with behaviors such as managing state, handling user input, or fetching data from a server.
24+
1. Un [decorator](https://www.typescriptlang.org/docs/handbook/decorators.html) `@Component`que contiene alguna configuración
25+
2. Una plantilla HTML que controla lo que se renderiza en el DOM
26+
3. Un [selector CSS ](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors) que define cómo se usa el componente en HTML
27+
4. Una clase de TypeScript con comportamientos como gestión de estado, manejo de entrada de usuario o recuperación de datos de un servidor.
2828

29-
Here is a simplified example of a TodoListItem component.
29+
Aquí hay un ejemplo simplificado de un componente TodoListItem.
3030

3131
```ts
3232
// todo-list-item.component.ts
3333
@Component({
3434
selector: 'todo-list-item',
3535
template: `
36-
<li>(TODO) Read Angular Essentials Guide</li>
36+
<li>(TODO) Lea la guía de Angular Essentials</li>
3737
`,
3838
})
3939
export class TodoListItem {
40-
/* Component behavior is defined in here */
40+
/* El comportamiento de los componentes se define aquí */
4141
}
4242
```
4343

44-
Other common metadata that you'll also see in components include:
44+
Otros metadatos comunes que también verás en los componentes incluyen:
4545

46-
- `standalone: true`The recommended approach of streamlining the authoring experience of components
47-
- `styles`A string or array of strings that contains any CSS styles you want applied to the component
46+
- `standalone: true`El enfoque recomendado para simplificar la experiencia de creación de componentes
47+
- `styles`Una cadena o matriz de cadenas que contiene cualquier estilo CSS que desee aplicar al componente
4848

49-
Knowing this, here is an updated version of our `TodoListItem` component.
49+
Sabiendo esto, aquí hay una versión actualizada de nuestro componente `TodoListItem`.
5050

5151
```ts
5252
// todo-list-item.component.ts
5353
@Component({
5454
standalone: true,
5555
selector: 'todo-list-item',
5656
template: `
57-
<li>(TODO) Read Angular Essentials Guide</li>
57+
<li>(TODO) Lea la guía de Angular Essentials</li>
5858
`,
5959
styles: `
6060
li {
@@ -64,15 +64,15 @@ Knowing this, here is an updated version of our `TodoListItem` component.
6464
`,
6565
})
6666
export class TodoListItem {
67-
/* Component behavior is defined in here */
67+
/* El comportamiento de los componentes se define aquí */
6868
}
6969
```
7070

71-
### Separating HTML and CSS into separate files
71+
### Separando HTML y CSS en archivos separados
7272

73-
For teams that prefer managing their HTML and/or CSS in separate files, Angular provides two additional properties: `templateUrl` and `styleUrl`.
73+
Para los equipos que prefieren administrar su HTML y/o CSS en archivos separados, Angular proporciona dos propiedades adicionales: `templateUrl` y `styleUrl`.
7474

75-
Using the previous `TodoListItem` component, the alternative approach looks like:
75+
Usando el componente `TodoListItem` anterior, el enfoque alternativo se ve así:
7676

7777
```ts
7878
// todo-list-item.component.ts
@@ -83,13 +83,13 @@ Using the previous `TodoListItem` component, the alternative approach looks like
8383
styleUrl: './todo-list-item.component.css',
8484
})
8585
export class TodoListItem {
86-
/* Component behavior is defined in here */
86+
/* El comportamiento de los componentes se define aquí */
8787
}
8888
```
8989

9090
```html
9191
<!-- todo-list-item.component.html -->
92-
<li>(TODO) Read Angular Essentials Guide</li>
92+
<li>(TODO) Lea la guía de Angular Essentials</li>
9393
```
9494

9595
```css
@@ -100,17 +100,17 @@ li {
100100
}
101101
```
102102

103-
## Using a Component
103+
## Usando un Component
104104

105-
One advantage of component architecture is that your application is modular. In other words, components can be used in other components.
105+
Una ventaja de la arquitectura de componentes es que su aplicación es modular. En otras palabras, los componentes se pueden usar en otros componentes.
106106

107-
To use a component, you need to:
107+
Para usar un componente, necesitas:
108108

109-
1. Import the component into the file
110-
2. Add it to the component's `imports` array
111-
3. Use the component's selector in the `template`
109+
1. Importar el componente en el archivo
110+
2. Añadirlo a la matriz de `importaciones` del componente
111+
3. Utilice el selector del componente en la `plantilla`
112112

113-
Here's an example of a `TodoList` component importing the `TodoListItem` component from before:
113+
Aquí hay un ejemplo del componente `TodoList` importando el componente `TodoListItem` de antes:
114114

115115
```ts
116116
// todo-list.component.ts
@@ -128,10 +128,10 @@ import {TodoListItem} from './todo-list-item.component.ts';
128128
export class TodoList {}
129129
```
130130

131-
## Next Step
131+
## Siguiente Paso
132132

133-
Now that you know how components work in Angular, it's time to learn how we add and manage dynamic data in our application.
133+
Ahora que sabe cómo funcionan los componentes en Angular, es hora de aprender cómo agregamos y gestionamos los datos dinámicos en nuestra aplicación.
134134

135135
<docs-pill-row>
136-
<docs-pill title="Managing Dynamic Data" href="essentials/managing-dynamic-data" />
136+
<docs-pill title="Gestión de Datos Dinámicos" href="essentials/managing-dynamic-data" />
137137
</docs-pill-row>

0 commit comments

Comments
 (0)