Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions adev-es/src/app/routing/sub-navigation-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,60 +591,60 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [
],
},
{
label: 'Internationalization',
label: 'Internacionalización',
children: [
{
label: 'Overview',
label: 'Visión general',
path: 'guide/i18n',
contentPath: 'guide/i18n/overview',
},
{
label: 'Add the localize package',
label: 'Agregar el paquete localize',
path: 'guide/i18n/add-package',
contentPath: 'guide/i18n/add-package',
},
{
label: 'Refer to locales by ID',
label: 'Referirse a configuraciones regionales por ID',
path: 'guide/i18n/locale-id',
contentPath: 'guide/i18n/locale-id',
},
{
label: 'Format data based on locale',
label: 'Formatear datos según la configuración regional',
path: 'guide/i18n/format-data-locale',
contentPath: 'guide/i18n/format-data-locale',
},
{
label: 'Prepare component for translation',
label: 'Preparar un componente para traducción',
path: 'guide/i18n/prepare',
contentPath: 'guide/i18n/prepare',
},
{
label: 'Work with translation files',
label: 'Trabajar con archivos de traducción',
path: 'guide/i18n/translation-files',
contentPath: 'guide/i18n/translation-files',
},
{
label: 'Merge translations into the app',
label: 'Fusionar traducciones en la aplicación',
path: 'guide/i18n/merge',
contentPath: 'guide/i18n/merge',
},
{
label: 'Deploy multiple locales',
label: 'Desplegar múltiples configuraciones regionales',
path: 'guide/i18n/deploy',
contentPath: 'guide/i18n/deploy',
},
{
label: 'Import global variants of the locale data',
label: 'Importar variantes globales de los datos de configuración regional',
path: 'guide/i18n/import-global-variants',
contentPath: 'guide/i18n/import-global-variants',
},
{
label: 'Manage marked text with custom IDs',
label: 'Gestionar texto marcado con IDs personalizados',
path: 'guide/i18n/manage-marked-text',
contentPath: 'guide/i18n/manage-marked-text',
},
{
label: 'Example Angular application',
label: 'Ejemplo de aplicación de Angular',
path: 'guide/i18n/example',
contentPath: 'guide/i18n/example',
},
Expand Down
35 changes: 35 additions & 0 deletions adev-es/src/content/guide/i18n/add-package.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Add the localize package

To take advantage of the localization features of Angular, use the [Angular CLI][CliMain] to add the `@angular/localize` package to your project.

To add the `@angular/localize` package, use the following command to update the `package.json` and TypeScript configuration files in your project.

<docs-code path="adev/src/content/examples/i18n/doc-files/commands.sh" visibleRegion="add-localize"/>

It adds `types: ["@angular/localize"]` in the TypeScript configuration files.
It also adds line `/// <reference types="@angular/localize" />` at the top of the `main.ts` file which is the reference to the type definition.

HELPFUL: For more information about `package.json` and `tsconfig.json` files, see [Workspace npm dependencies][GuideNpmPackages] and [TypeScript Configuration][GuideTsConfig]. To learn about Triple-slash Directives visit [Typescript Handbook](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-).

If `@angular/localize` is not installed and you try to build a localized version of your project (for example, while using the `i18n` attributes in templates), the [Angular CLI][CliMain] will generate an error, which would contain the steps that you can take to enable i18n for your project.

## Options

| OPTION | DESCRIPTION | VALUE TYPE | DEFAULT VALUE
|:--- |:--- |:------ |:------
| `--project` | The name of the project. | `string` |
| `--use-at-runtime` | If set, then `$localize` can be used at runtime. Also `@angular/localize` gets included in the `dependencies` section of `package.json`, rather than `devDependencies`, which is the default. | `boolean` | `false`

For more available options, see `ng add` in [Angular CLI][CliMain].

## What's next

<docs-pill-row>
<docs-pill href="guide/i18n/locale-id" title="Refer to locales by ID"/>
</docs-pill-row>

[CliMain]: cli "CLI Overview and Command Reference | Angular"

[GuideNpmPackages]: reference/configs/npm-packages "Workspace npm dependencies | Angular"

[GuideTsConfig]: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html "TypeScript Configuration"
28 changes: 14 additions & 14 deletions adev-es/src/content/guide/i18n/add-package.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Add the localize package
# Agregar el paquete localize

To take advantage of the localization features of Angular, use the [Angular CLI][CliMain] to add the `@angular/localize` package to your project.
Para aprovechar las características de localización de Angular, usa el [CLI de Angular][CliMain] para agregar el paquete `@angular/localize` a tu proyecto.

To add the `@angular/localize` package, use the following command to update the `package.json` and TypeScript configuration files in your project.
Para agregar el paquete `@angular/localize`, usa el siguiente comando para actualizar los archivos `package.json` y de configuración de TypeScript en tu proyecto.

<docs-code path="adev/src/content/examples/i18n/doc-files/commands.sh" visibleRegion="add-localize"/>

It adds `types: ["@angular/localize"]` in the TypeScript configuration files.
It also adds line `/// <reference types="@angular/localize" />` at the top of the `main.ts` file which is the reference to the type definition.
Esto agrega `types: ["@angular/localize"]` en los archivos de configuración de TypeScript.
También agrega la línea `/// <reference types="@angular/localize" />` al inicio del archivo `main.ts`, que es la referencia a la definición de tipos.

HELPFUL: For more information about `package.json` and `tsconfig.json` files, see [Workspace npm dependencies][GuideNpmPackages] and [TypeScript Configuration][GuideTsConfig]. To learn about Triple-slash Directives visit [Typescript Handbook](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-).
ÚTIL: Para más información sobre los archivos `package.json` y `tsconfig.json`, consulta [Dependencias npm del espacio de trabajo][GuideNpmPackages] y [Configuración de TypeScript][GuideTsConfig]. Para aprender sobre las directivas Triple-slash visita el [Manual de TypeScript](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-).

If `@angular/localize` is not installed and you try to build a localized version of your project (for example, while using the `i18n` attributes in templates), the [Angular CLI][CliMain] will generate an error, which would contain the steps that you can take to enable i18n for your project.
Si `@angular/localize` no está instalado e intentas construir una versión localizada de tu proyecto (por ejemplo, mientras usas los atributos `i18n` en templates), el [CLI de Angular][CliMain] generará un error que contendrá los pasos que puedes seguir para habilitar i18n en tu proyecto.

## Options
## Opciones

| OPTION | DESCRIPTION | VALUE TYPE | DEFAULT VALUE
| OPCIÓN | DESCRIPCIÓN | TIPO DE VALOR | VALOR PREDETERMINADO
|:--- |:--- |:------ |:------
| `--project` | The name of the project. | `string` |
| `--use-at-runtime` | If set, then `$localize` can be used at runtime. Also `@angular/localize` gets included in the `dependencies` section of `package.json`, rather than `devDependencies`, which is the default. | `boolean` | `false`
| `--project` | El nombre del proyecto. | `string` |
| `--use-at-runtime` | Si se establece, entonces `$localize` puede usarse en runtime. Además `@angular/localize` se incluye en la sección `dependencies` de `package.json`, en lugar de `devDependencies`, que es el valor predeterminado. | `boolean` | `false`

For more available options, see `ng add` in [Angular CLI][CliMain].
Para más opciones disponibles, consulta `ng add` en el [CLI de Angular][CliMain].

## What's next
## Próximos pasos

<docs-pill-row>
<docs-pill href="guide/i18n/locale-id" title="Refer to locales by ID"/>
<docs-pill href="guide/i18n/locale-id" title="Referirse a configuraciones regionales por ID"/>
</docs-pill-row>

[CliMain]: cli "CLI Overview and Command Reference | Angular"
Expand Down
42 changes: 42 additions & 0 deletions adev-es/src/content/guide/i18n/deploy.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Deploy multiple locales

If `myapp` is the directory that contains the distributable files of your project, you typically make different versions available for different locales in locale directories.
For example, your French version is located in the `myapp/fr` directory and the Spanish version is located in the `myapp/es` directory.

The HTML `base` tag with the `href` attribute specifies the base URI, or URL, for relative links.
If you set the `"localize"` option in [`angular.json`][GuideWorkspaceConfig] workspace build configuration file to `true` or to an array of locale IDs, the CLI adjusts the base `href` for each version of the application.
To adjust the base `href` for each version of the application, the CLI adds the locale to the configured `"subPath"`.
Specify the `"subPath"` for each locale in your [`angular.json`][GuideWorkspaceConfig] workspace build configuration file.
The following example displays `"subPath"` set to an empty string.

<docs-code header="angular.json" path="adev/src/content/examples/i18n/angular.json" visibleRegion="i18n-subPath"/>

## Configure a server

Typical deployment of multiple languages serve each language from a different subdirectory.
Users are redirected to the preferred language defined in the browser using the `Accept-Language` HTTP header.
If the user has not defined a preferred language, or if the preferred language is not available, then the server falls back to the default language.
To change the language, change your current location to another subdirectory.
The change of subdirectory often occurs using a menu implemented in the application.

For more information on how to deploy apps to a remote server, see [Deployment][GuideDeployment].

IMPORTANT: If you are using [Server rendering](guide/ssr) with `outputMode` set to `server`, Angular automatically handles redirection dynamically based on the `Accept-Language` HTTP header. This simplifies deployment by eliminating the need for manual server or configuration adjustments.

### Nginx example

The following example displays an Nginx configuration.

<docs-code path="adev/src/content/examples/i18n/doc-files/nginx.conf" language="nginx"/>

### Apache example

The following example displays an Apache configuration.

<docs-code path="adev/src/content/examples/i18n/doc-files/apache2.conf" language="apache"/>

[CliBuild]: cli/build "ng build | CLI | Angular"

[GuideDeployment]: tools/cli/deployment "Deployment | Angular"

[GuideWorkspaceConfig]: reference/configs/workspace-config "Angular workspace configuration | Angular"
40 changes: 20 additions & 20 deletions adev-es/src/content/guide/i18n/deploy.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# Deploy multiple locales
# Desplegar múltiples configuraciones regionales

If `myapp` is the directory that contains the distributable files of your project, you typically make different versions available for different locales in locale directories.
For example, your French version is located in the `myapp/fr` directory and the Spanish version is located in the `myapp/es` directory.
Si `myapp` es el directorio que contiene los archivos distribuibles de tu proyecto, normalmente haces que diferentes versiones estén disponibles para diferentes configuraciones regionales en directorios de configuración regional.
Por ejemplo, tu versión en francés está ubicada en el directorio `myapp/fr` y la versión en español está ubicada en el directorio `myapp/es`.

The HTML `base` tag with the `href` attribute specifies the base URI, or URL, for relative links.
If you set the `"localize"` option in [`angular.json`][GuideWorkspaceConfig] workspace build configuration file to `true` or to an array of locale IDs, the CLI adjusts the base `href` for each version of the application.
To adjust the base `href` for each version of the application, the CLI adds the locale to the configured `"subPath"`.
Specify the `"subPath"` for each locale in your [`angular.json`][GuideWorkspaceConfig] workspace build configuration file.
The following example displays `"subPath"` set to an empty string.
La etiqueta HTML `base` con el atributo `href` especifica el URI base, o URL, para enlaces relativos.
Si estableces la opción `"localize"` en el archivo de configuración de compilación del espacio de trabajo [`angular.json`][GuideWorkspaceConfig] a `true` o a un array de IDs de configuración regional, el CLI ajusta el `href` base para cada versión de la aplicación.
Para ajustar el `href` base para cada versión de la aplicación, el CLI agrega la configuración regional al `"subPath"` configurado.
Especifica el `"subPath"` para cada configuración regional en tu archivo de configuración de compilación del espacio de trabajo [`angular.json`][GuideWorkspaceConfig].
El siguiente ejemplo muestra `"subPath"` establecido como una cadena vacía.

<docs-code header="angular.json" path="adev/src/content/examples/i18n/angular.json" visibleRegion="i18n-subPath"/>

## Configure a server
## Configurar un servidor

Typical deployment of multiple languages serve each language from a different subdirectory.
Users are redirected to the preferred language defined in the browser using the `Accept-Language` HTTP header.
If the user has not defined a preferred language, or if the preferred language is not available, then the server falls back to the default language.
To change the language, change your current location to another subdirectory.
The change of subdirectory often occurs using a menu implemented in the application.
El despliegue típico de múltiples idiomas sirve cada idioma desde un subdirectorio diferente.
Los usuarios son redirigidos al idioma preferido definido en el navegador usando el encabezado HTTP `Accept-Language`.
Si el usuario no ha definido un idioma preferido, o si el idioma preferido no está disponible, entonces el servidor recurre al idioma predeterminado.
Para cambiar el idioma, cambia tu ubicación actual a otro subdirectorio.
El cambio de subdirectorio a menudo ocurre usando un menú implementado en la aplicación.

For more information on how to deploy apps to a remote server, see [Deployment][GuideDeployment].
Para más información sobre cómo desplegar aplicaciones a un servidor remoto, consulta [Despliegue][GuideDeployment].

IMPORTANT: If you are using [Server rendering](guide/ssr) with `outputMode` set to `server`, Angular automatically handles redirection dynamically based on the `Accept-Language` HTTP header. This simplifies deployment by eliminating the need for manual server or configuration adjustments.
IMPORTANTE: Si estás usando [Renderizado del servidor](guide/ssr) con `outputMode` establecido en `server`, Angular maneja automáticamente la redirección dinámicamente basándose en el encabezado HTTP `Accept-Language`. Esto simplifica el despliegue al eliminar la necesidad de ajustes manuales del servidor o configuración.

### Nginx example
### Ejemplo de Nginx

The following example displays an Nginx configuration.
El siguiente ejemplo muestra una configuración de Nginx.

<docs-code path="adev/src/content/examples/i18n/doc-files/nginx.conf" language="nginx"/>

### Apache example
### Ejemplo de Apache

The following example displays an Apache configuration.
El siguiente ejemplo muestra una configuración de Apache.

<docs-code path="adev/src/content/examples/i18n/doc-files/apache2.conf" language="apache"/>

Expand Down
18 changes: 18 additions & 0 deletions adev-es/src/content/guide/i18n/example.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Example Angular Internationalization application

<!-- ## Explore the translated example application -->

<!-- Explore the sample application with French translations used in the [Angular Internationalization][GuideI18nOverview] guide: -->
<!-- TODO: link to GitHub -->
<!-- <docs-code live path="adev/src/content/examples/i18n" title="live example"/> -->

## `fr-CA` and `en-US` example

The following tabs display the example application and the associated translation files.

<docs-code-multifile>
<docs-code header="src/app/app.component.html" path="adev/src/content/examples/i18n/src/app/app.component.html"/>
<docs-code header="src/app/app.component.ts" path="adev/src/content/examples/i18n/src/app/app.component.ts"/>
<docs-code header="src/main.ts" path="adev/src/content/examples/i18n/doc-files/main.1.ts"/>
<docs-code header="src/locale/messages.fr.xlf" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf.html"/>
</docs-code-multifile>
6 changes: 3 additions & 3 deletions adev-es/src/content/guide/i18n/example.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Example Angular Internationalization application
# Aplicación de ejemplo de internacionalización de Angular

<!-- ## Explore the translated example application -->

<!-- Explore the sample application with French translations used in the [Angular Internationalization][GuideI18nOverview] guide: -->
<!-- TODO: link to GitHub -->
<!-- <docs-code live path="adev/src/content/examples/i18n" title="live example"/> -->

## `fr-CA` and `en-US` example
## Ejemplo de `fr-CA` y `en-US`

The following tabs display the example application and the associated translation files.
Las siguientes pestañas muestran la aplicación de ejemplo y los archivos de traducción asociados.

<docs-code-multifile>
<docs-code header="src/app/app.component.html" path="adev/src/content/examples/i18n/src/app/app.component.html"/>
Expand Down
52 changes: 52 additions & 0 deletions adev-es/src/content/guide/i18n/format-data-locale.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Format data based on locale

Angular provides the following built-in data transformation [pipes](guide/templates/pipes).
The data transformation pipes use the [`LOCALE_ID`][ApiCoreLocaleId] token to format data based on rules of each locale.

| Data transformation pipe | Details |
|:--- |:--- |
| [`DatePipe`][ApiCommonDatepipe] | Formats a date value. |
| [`CurrencyPipe`][ApiCommonCurrencypipe] | Transforms a number into a currency string. |
| [`DecimalPipe`][ApiCommonDecimalpipe] | Transforms a number into a decimal number string. |
| [`PercentPipe`][ApiCommonPercentpipe] | Transforms a number into a percentage string. |

## Use DatePipe to display the current date

To display the current date in the format for the current locale, use the following format for the `DatePipe`.

<!--todo: replace with docs-code -->

<docs-code language="typescript">

{{ today | date }}

</docs-code>

## Override current locale for CurrencyPipe

Add the `locale` parameter to the pipe to override the current value of `LOCALE_ID` token.

To force the currency to use American English \(`en-US`\), use the following format for the `CurrencyPipe`

<!--todo: replace with docs-code -->

<docs-code language="typescript">

{{ amount | currency : 'en-US' }}

</docs-code>

HELPFUL: The locale specified for the `CurrencyPipe` overrides the global `LOCALE_ID` token of your application.

## What's next

<docs-pill-row>
<docs-pill href="guide/i18n/prepare" title="Prepare component for translation"/>
</docs-pill-row>

[ApiCommonCurrencypipe]: api/common/CurrencyPipe "CurrencyPipe | Common - API | Angular"

[ApiCommonDatepipe]: api/common/DatePipe "DatePipe | Common - API | Angular"
[ApiCommonDecimalpipe]: api/common/DecimalPipe "DecimalPipe | Common - API | Angular"
[ApiCommonPercentpipe]: api/common/PercentPipe "PercentPipe | Common - API | Angular"
[ApiCoreLocaleId]: api/core/LOCALE_ID "LOCALE_ID | Core - API | Angular"
Loading