From b98b5667638185ddb6d1cca9b416b9b561f4205b Mon Sep 17 00:00:00 2001 From: Ricardo Chavarria Date: Tue, 27 Jan 2026 14:21:55 -0600 Subject: [PATCH] translate: translations for Template guides Fixes #100 --- .../src/app/routing/sub-navigation-data.ts | 26 +- .../src/content/guide/templates/binding.en.md | 256 ++++++++++++ .../src/content/guide/templates/binding.md | 142 +++---- .../guide/templates/control-flow.en.md | 127 ++++++ .../content/guide/templates/control-flow.md | 76 ++-- .../src/content/guide/templates/defer.en.md | 385 ++++++++++++++++++ adev-es/src/content/guide/templates/defer.md | 194 ++++----- .../guide/templates/event-listeners.en.md | 226 ++++++++++ .../guide/templates/event-listeners.md | 76 ++-- .../guide/templates/expression-syntax.en.md | 121 ++++++ .../guide/templates/expression-syntax.md | 164 ++++---- .../guide/templates/ng-container.en.md | 115 ++++++ .../content/guide/templates/ng-container.md | 44 +- .../content/guide/templates/ng-content.en.md | 37 ++ .../src/content/guide/templates/ng-content.md | 8 +- .../content/guide/templates/ng-template.en.md | 282 +++++++++++++ .../content/guide/templates/ng-template.md | 114 +++--- .../content/guide/templates/overview.en.md | 48 +++ .../src/content/guide/templates/overview.md | 68 ++-- .../src/content/guide/templates/pipes.en.md | 290 +++++++++++++ adev-es/src/content/guide/templates/pipes.md | 154 +++---- .../guide/templates/two-way-binding.en.md | 136 +++++++ .../guide/templates/two-way-binding.md | 48 +-- .../content/guide/templates/variables.en.md | 188 +++++++++ .../src/content/guide/templates/variables.md | 112 ++--- .../content/guide/templates/whitespace.en.md | 64 +++ .../src/content/guide/templates/whitespace.md | 36 +- 27 files changed, 2906 insertions(+), 631 deletions(-) create mode 100644 adev-es/src/content/guide/templates/binding.en.md create mode 100644 adev-es/src/content/guide/templates/control-flow.en.md create mode 100644 adev-es/src/content/guide/templates/defer.en.md create mode 100644 adev-es/src/content/guide/templates/event-listeners.en.md create mode 100644 adev-es/src/content/guide/templates/expression-syntax.en.md create mode 100644 adev-es/src/content/guide/templates/ng-container.en.md create mode 100644 adev-es/src/content/guide/templates/ng-content.en.md create mode 100644 adev-es/src/content/guide/templates/ng-template.en.md create mode 100644 adev-es/src/content/guide/templates/overview.en.md create mode 100644 adev-es/src/content/guide/templates/pipes.en.md create mode 100644 adev-es/src/content/guide/templates/two-way-binding.en.md create mode 100644 adev-es/src/content/guide/templates/variables.en.md create mode 100644 adev-es/src/content/guide/templates/whitespace.en.md diff --git a/adev-es/src/app/routing/sub-navigation-data.ts b/adev-es/src/app/routing/sub-navigation-data.ts index 02ca72c..e357e50 100644 --- a/adev-es/src/app/routing/sub-navigation-data.ts +++ b/adev-es/src/app/routing/sub-navigation-data.ts @@ -188,30 +188,30 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [ ], }, { - label: 'Templates', + label: 'Plantillas', children: [ { - label: 'Overview', + label: 'Visión general', path: 'guide/templates', contentPath: 'guide/templates/overview', }, { - label: 'Binding dynamic text, properties and attributes', + label: 'Enlazar texto, propiedades y atributos dinámicos', path: 'guide/templates/binding', contentPath: 'guide/templates/binding', }, { - label: 'Adding event listeners', + label: 'Agregando escuchadores de eventos', path: 'guide/templates/event-listeners', contentPath: 'guide/templates/event-listeners', }, { - label: 'Two-way binding', + label: 'Enlance bidireccional', path: 'guide/templates/two-way-binding', contentPath: 'guide/templates/two-way-binding', }, { - label: 'Control flow', + label: 'Flujo de control', path: 'guide/templates/control-flow', contentPath: 'guide/templates/control-flow', }, @@ -221,37 +221,37 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [ contentPath: 'guide/templates/pipes', }, { - label: 'Slotting child content with ng-content', + label: 'Proyectar contenido hijo ng-content', path: 'guide/templates/ng-content', contentPath: 'guide/templates/ng-content', }, { - label: 'Create template fragments with ng-template', + label: 'Crear fragmentos de plantilla con ng-template', path: 'guide/templates/ng-template', contentPath: 'guide/templates/ng-template', }, { - label: 'Grouping elements with ng-container', + label: 'Agrupando elementos con ng-container', path: 'guide/templates/ng-container', contentPath: 'guide/templates/ng-container', }, { - label: 'Variables in templates', + label: 'Variables en plantillas', path: 'guide/templates/variables', contentPath: 'guide/templates/variables', }, { - label: 'Deferred loading with @defer', + label: 'Carga diferida con @defer', path: 'guide/templates/defer', contentPath: 'guide/templates/defer', }, { - label: 'Expression syntax', + label: 'Sintaxis de expresiones', path: 'guide/templates/expression-syntax', contentPath: 'guide/templates/expression-syntax', }, { - label: 'Whitespace in templates', + label: 'Espacios en blanco en plantillas', path: 'guide/templates/whitespace', contentPath: 'guide/templates/whitespace', }, diff --git a/adev-es/src/content/guide/templates/binding.en.md b/adev-es/src/content/guide/templates/binding.en.md new file mode 100644 index 0000000..d3e00f2 --- /dev/null +++ b/adev-es/src/content/guide/templates/binding.en.md @@ -0,0 +1,256 @@ +# Binding dynamic text, properties and attributes + +In Angular, a **binding** creates a dynamic connection between a component's template and its data. This connection ensures that changes to the component's data automatically update the rendered template. + +## Render dynamic text with text interpolation + +You can bind dynamic text in templates with double curly braces, which tells Angular that it is responsible for the expression inside and ensuring it is updated correctly. This is called **text interpolation**. + +```angular-ts +@Component({ + template: ` +

Your color preference is {{ theme }}.

+ `, + ... +}) +export class AppComponent { + theme = 'dark'; +} +``` + +In this example, when the snippet is rendered to the page, Angular will replace `{{ theme }}` with `dark`. + +```angular-html + +

Your color preference is dark.

+``` + +Bindings that change over time should read values from [signals](/guide/signals). Angular tracks the signals read in the template, and updates the rendered page when those signal values change. + +```angular-ts +@Component({ + template: ` + +

{{ welcomeMessage }}

+ +

Your color preference is {{ theme() }}.

+ ` + ... +}) +export class AppComponent { + welcomeMessage = "Welcome, enjoy this app that we built for you"; + theme = signal('dark'); +} +``` + +For more details, see the [Signals guide](/guide/signals). + +Continuing the theme example, if a user clicks on a button that updates the `theme` signal to `'light'` after the page loads, the page updates accordingly to: + +```angular-html + +

Your color preference is light.

+``` + +You can use text interpolation anywhere you would normally write text in HTML. + +All expression values are converted to a string. Objects and arrays are converted using the value’s `toString` method. + +## Binding dynamic properties and attributes + +Angular supports binding dynamic values into object properties and HTML attributes with square brackets. + +You can bind to properties on an HTML element's DOM instance, a [component](guide/components) instance, or a [directive](guide/directives) instance. + +### Native element properties + +Every HTML element has a corresponding DOM representation. For example, each ` +``` + +In this example, every time `isFormValid` changes, Angular automatically sets the `disabled` property of the `HTMLButtonElement` instance. + +### Component and directive properties + +When an element is an Angular component, you can use property bindings to set component input properties using the same square bracket syntax. + +```angular-html + + +``` + +In this example, every time `mySelection` changes, Angular automatically sets the `value` property of the `MyListbox` instance. + +You can bind to directive properties as well. + +```angular-html + +The current user's profile photo +``` + +### Attributes + +When you need to set HTML attributes that do not have corresponding DOM properties, such as SVG attributes, you can bind attributes to elements in your template with the `attr.` prefix. + +```angular-html + +