Skip to content

Commit f79f057

Browse files
committed
translate: translations for essential guides
Translations for the following guides 1. `introduction/essentials/overview` 2. `introduction/essentials/components` 3. `introduction/essentials/signals` 4. `introduction/essentials/templates` 5. `introduction/essentials/dependency-injection` 6. `introduction/essentials/next-steps` These translations include changes on the `sub-navigations-data.ts` file as well. Fixes #12
1 parent ecc5e55 commit f79f057

17 files changed

+585
-504
lines changed

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,35 @@ 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 con componentes',
4444
path: 'essentials/components',
4545
contentPath: 'introduction/essentials/components',
4646
},
4747
{
48-
label: 'Managing Dynamic Data',
49-
path: 'essentials/managing-dynamic-data',
50-
contentPath: 'introduction/essentials/managing-dynamic-data',
51-
},
52-
{
53-
label: 'Rendering Dynamic Templates',
54-
path: 'essentials/rendering-dynamic-templates',
55-
contentPath: 'introduction/essentials/rendering-dynamic-templates',
56-
},
57-
{
58-
label: 'Conditionals and Loops',
59-
path: 'essentials/conditionals-and-loops',
60-
contentPath: 'introduction/essentials/conditionals-and-loops',
48+
label: 'Reactividad con signals',
49+
path: 'essentials/signals',
50+
contentPath: 'introduction/essentials/signals',
6151
},
6252
{
63-
label: 'Handling User Interaction',
64-
path: 'essentials/handling-user-interaction',
65-
contentPath: 'introduction/essentials/handling-user-interaction',
53+
label: 'Interfaces dinámicas con plantillas',
54+
path: 'essentials/templates',
55+
contentPath: 'introduction/essentials/templates',
6656
},
6757
{
68-
label: 'Sharing Logic',
69-
path: 'essentials/sharing-logic',
70-
contentPath: 'introduction/essentials/sharing-logic',
58+
label: 'Diseño modular con inyección de dependencias',
59+
path: 'essentials/dependency-injection',
60+
contentPath: 'introduction/essentials/dependency-injection',
7161
},
7262
{
73-
label: 'Next Steps',
63+
label: 'Siguientes pasos',
7464
path: 'essentials/next-steps',
7565
contentPath: 'introduction/essentials/next-steps',
7666
},
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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 are the main building blocks of Angular applications. Each component represents a part of a larger web page. Organizing an application into components helps provide structure to your project, clearly separating code into specific parts that are easy to maintain and grow over time.
6+
7+
## Defining a component
8+
9+
Every component has a few main parts:
10+
11+
1. A `@Component`[decorator](https://www.typescriptlang.org/docs/handbook/decorators.html) that contains some configuration used by Angular.
12+
2. An HTML template that controls what renders into the DOM.
13+
3. A [CSS selector](https://developer.mozilla.org/docs/Learn/CSS/Building_blocks/Selectors) that defines how the component is used in HTML.
14+
4. A TypeScript class with behaviors, such as handling user input or making requests to a server.
15+
16+
Here is a simplified example of a `UserProfile` component.
17+
18+
```angular-ts
19+
// user-profile.ts
20+
@Component({
21+
selector: 'user-profile',
22+
template: `
23+
<h1>User profile</h1>
24+
<p>This is the user profile page</p>
25+
`,
26+
})
27+
export class UserProfile { /* Your component code goes here */ }
28+
```
29+
30+
The `@Component` decorator also optionally accepts a `styles` property for any CSS you want to apply to your template:
31+
32+
```angular-ts
33+
// user-profile.ts
34+
@Component({
35+
selector: 'user-profile',
36+
template: `
37+
<h1>User profile</h1>
38+
<p>This is the user profile page</p>
39+
`,
40+
styles: `h1 { font-size: 3em; } `,
41+
})
42+
export class UserProfile { /* Your component code goes here */ }
43+
```
44+
45+
### Separating HTML and CSS into separate files
46+
47+
You can define a component's HTML and CSS in separate files using `templateUrl` and `styleUrl`:
48+
49+
```angular-ts
50+
// user-profile.ts
51+
@Component({
52+
selector: 'user-profile',
53+
templateUrl: 'user-profile.html',
54+
styleUrl: 'user-profile.css',
55+
})
56+
export class UserProfile {
57+
// Component behavior is defined in here
58+
}
59+
```
60+
61+
```angular-html
62+
<!-- user-profile.html -->
63+
<h1>User profile</h1>
64+
<p>This is the user profile page</p>
65+
```
66+
67+
```css
68+
/* user-profile.css */
69+
h1 {
70+
font-size: 3em;
71+
}
72+
```
73+
74+
## Using components
75+
76+
You build an application by composing multiple components together. For example, if you are building a user profile page, you might break the page up into several components like this:
77+
78+
```mermaid
79+
flowchart TD
80+
A[UserProfile]-->B
81+
A-->C
82+
B[UserBiography]-->D
83+
C[ProfilePhoto]
84+
D[UserAddress]
85+
```
86+
87+
Here, the `UserProfile` component uses several other components to produce the final page.
88+
89+
To import and use a component, you need to:
90+
1. In your component's TypeScript file, add an `import` statement for the component you want to use.
91+
2. In your `@Component` decorator, add an entry to the `imports` array for the component you want to use.
92+
3. In your component's template, add an element that matches the selector of the component you want to use.
93+
94+
Here's an example of a `UserProfile` component importing a `ProfilePhoto` component:
95+
96+
```angular-ts
97+
// user-profile.ts
98+
import {ProfilePhoto} from 'profile-photo.ts';
99+
100+
@Component({
101+
selector: 'user-profile',
102+
imports: [ProfilePhoto],
103+
template: `
104+
<h1>User profile</h1>
105+
<profile-photo />
106+
<p>This is the user profile page</p>
107+
`,
108+
})
109+
export class UserProfile {
110+
// Component behavior is defined in here
111+
}
112+
```
113+
114+
TIP: Want to know more about Angular components? See the [In-depth Components guide](guide/components) for the full details.
115+
116+
## Next Step
117+
118+
Now that you know how components work in Angular, it's time to learn how we add and manage dynamic data in our application.
119+
120+
<docs-pill-row>
121+
<docs-pill title="Reactivity with signals" href="essentials/signals" />
122+
<docs-pill title="In-depth components guide" href="guide/components" />
123+
</docs-pill-row>
Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
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 are the main building blocks of Angular applications. Each component represents a part of a larger web page. Organizing an application into components helps provide structure to your project, clearly separating code into specific parts that are easy to maintain and grow over time.
5+
Los componentes son los bloques principales de construcción de las aplicaciones Angular. Cada componente representa una parte de una página web más grande. Organizar una aplicación en componentes ayuda a proporcionar estructura a tu proyecto, separando claramente el código en partes específicas que son fáciles de mantener y crecer con el tiempo.
66

7-
## Defining a component
7+
## Definir un Componente
88

9-
Every component has a few main parts:
9+
Cada componente tiene algunas partes principales:
1010

11-
1. A `@Component`[decorator](https://www.typescriptlang.org/docs/handbook/decorators.html) that contains some configuration used by Angular.
12-
2. An HTML template that controls what renders into the DOM.
13-
3. A [CSS selector](https://developer.mozilla.org/docs/Learn/CSS/Building_blocks/Selectors) that defines how the component is used in HTML.
14-
4. A TypeScript class with behaviors, such as handling user input or making requests to a server.
11+
1. Un [decorador](https://www.typescriptlang.org/docs/handbook/decorators.html) `@Component` que contiene alguna configuración utilizada por Angular.
12+
2. Una plantilla HTML que controla lo que se renderiza en el DOM.
13+
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.
14+
4. Una clase TypeScript con comportamientos, como manejar la entrada del usuario o hacer solicitudes a un servidor..
1515

16-
Here is a simplified example of a `UserProfile` component.
16+
Aquí hay un ejemplo simplificado de un componente `UserProfile`.
1717

1818
```angular-ts
1919
// user-profile.ts
2020
@Component({
2121
selector: 'user-profile',
2222
template: `
23-
<h1>User profile</h1>
24-
<p>This is the user profile page</p>
23+
<h1>Perfil de usuario</h1>
24+
<p>Esta es la página del perfil de usuario</p>
2525
`,
2626
})
27-
export class UserProfile { /* Your component code goes here */ }
27+
export class UserProfile { /* Tu código del componente va aquí */ }
2828
```
2929

30-
The `@Component` decorator also optionally accepts a `styles` property for any CSS you want to apply to your template:
30+
El decorador `@Component` también acepta opcionalmente una propiedad `styles` para cualquier CSS que quieras aplicar a tu plantilla:
3131

3232
```angular-ts
3333
// user-profile.ts
3434
@Component({
3535
selector: 'user-profile',
3636
template: `
37-
<h1>User profile</h1>
38-
<p>This is the user profile page</p>
37+
<h1>Perfil de usuario</h1>
38+
<p>Esta es la página del perfil de usuario</p>
3939
`,
4040
styles: `h1 { font-size: 3em; } `,
4141
})
42-
export class UserProfile { /* Your component code goes here */ }
42+
export class UserProfile { /* Tu código del componente va aquí */ }
4343
```
4444

45-
### Separating HTML and CSS into separate files
45+
### Separar HTML y CSS en archivos
4646

47-
You can define a component's HTML and CSS in separate files using `templateUrl` and `styleUrl`:
47+
Puedes definir el HTML y CSS de un componente en archivos separados usando `templateUrl` y `styleUrl`:
4848

4949
```angular-ts
5050
// user-profile.ts
@@ -54,26 +54,27 @@ You can define a component's HTML and CSS in separate files using `templateUrl`
5454
styleUrl: 'user-profile.css',
5555
})
5656
export class UserProfile {
57-
// Component behavior is defined in here
57+
// El comportamiento del componente se define aquí
5858
}
5959
```
6060

6161
```angular-html
6262
<!-- user-profile.html -->
63-
<h1>User profile</h1>
64-
<p>This is the user profile page</p>
63+
<h1>Perfil del usuario</h1>
64+
<p>Esta es la página del perfil de usuario</p>
6565
```
6666

6767
```css
6868
/* user-profile.css */
69-
h1 {
70-
font-size: 3em;
69+
li {
70+
color: red;
71+
font-weight: 300;
7172
}
7273
```
7374

74-
## Using components
75+
## Usar un Component
7576

76-
You build an application by composing multiple components together. For example, if you are building a user profile page, you might break the page up into several components like this:
77+
Construyes una aplicación componiendo múltiples componentes juntos. Por ejemplo, si estás creando una página de perfil de usuario, podrías dividir la página en varios componentes como este:
7778

7879
```mermaid
7980
flowchart TD
@@ -83,15 +84,18 @@ flowchart TD
8384
C[ProfilePhoto]
8485
D[UserAddress]
8586
```
87+
Aquí, el componente `UserProfile` utiliza varios otros componentes para generar la página final.
8688

87-
Here, the `UserProfile` component uses several other components to produce the final page.
89+
Para importar y usar un componente, debes:
90+
1. En el archivo TypeScript de tu componente, agregar una declaración `import` para el componente que deseas usar.
91+
2. En el decorador `@Component`, agregar el componente que deseas usar al arreglo `imports`.
92+
3. En la plantilla de tu componente, agregar un elemento que coincida con el selector del componente que deseas usar.
8893

89-
To import and use a component, you need to:
90-
1. In your component's TypeScript file, add an `import` statement for the component you want to use.
91-
2. In your `@Component` decorator, add an entry to the `imports` array for the component you want to use.
92-
3. In your component's template, add an element that matches the selector of the component you want to use.
94+
Aquí tienes un ejemplo del componente `UserProfile` que importa y utiliza el componente `ProfilePhoto`:
9395

94-
Here's an example of a `UserProfile` component importing a `ProfilePhoto` component:
96+
```angular-ts
97+
// user-profile.ts
98+
import {ProfilePhoto} from 'profile-photo.ts';
9599
96100
```angular-ts
97101
// user-profile.ts
@@ -101,23 +105,23 @@ import {ProfilePhoto} from 'profile-photo.ts';
101105
selector: 'user-profile',
102106
imports: [ProfilePhoto],
103107
template: `
104-
<h1>User profile</h1>
108+
<h1>Perfil del usuario</h1>
105109
<profile-photo />
106-
<p>This is the user profile page</p>
110+
<p>Esta es la página del perfil de usuario</p>
107111
`,
108112
})
109113
export class UserProfile {
110-
// Component behavior is defined in here
114+
// El comportamiento del componente se define aquí
111115
}
112116
```
113117

114-
TIP: Want to know more about Angular components? See the [In-depth Components guide](guide/components) for the full details.
118+
TIP: ¿Quieres saber más sobre los componentes en Angular? [Consulta la guía detallada de componentes](guide/components) para todos todos los detalles.
115119

116-
## Next Step
120+
## Siguiente Paso
117121

118-
Now that you know how components work in Angular, it's time to learn how we add and manage dynamic data in our application.
122+
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.
119123

120124
<docs-pill-row>
121-
<docs-pill title="Reactivity with signals" href="essentials/signals" />
122-
<docs-pill title="In-depth components guide" href="guide/components" />
125+
<docs-pill title="Reactividad con Signals" href="essentials/signals" />
126+
<docs-pill title="Guía detallada de componentes" href="guide/components" />
123127
</docs-pill-row>

0 commit comments

Comments
 (0)