From e9c30172e152db04b64a3114e37733480f552d35 Mon Sep 17 00:00:00 2001 From: Pedro Flores <98963275+PedroFlores199@users.noreply.github.com> Date: Thu, 19 Nov 2026 03:28:15 +0100 Subject: [PATCH] Translate guide introduction, getting started, key concepts and application structure to Spanish --- .../po/es/guide_concept_aliases.md.po | 98 ++- .../po/es/guide_concept_autoloading.md.po | 22 +- .../po/es/guide_concept_configuration.md.po | 373 ++++++-- .../po/es/guide_concept_di-container.md.po | 252 ++++-- .../po/es/guide_concept_events.md.po | 204 ++--- .../po/es/guide_concept_immutability.md.po | 140 ++- _translations/po/es/guide_glossary.md.po | 217 +++-- _translations/po/es/guide_index.md.po | 302 +++---- .../po/es/guide_intro_upgrade-from-v1.md.po | 602 +++++++++---- .../po/es/guide_intro_upgrade-from-v2.md.po | 737 ++++++++++------ .../po/es/guide_intro_what-is-yii.md.po | 56 +- .../po/es/guide_start_creating-project.md.po | 51 +- .../po/es/guide_start_databases.md.po | 815 +++++++++++++++--- .../po/es/guide_start_demo-apps.md.po | 20 +- _translations/po/es/guide_start_forms.md.po | 344 ++++++-- _translations/po/es/guide_start_gii.md.po | 8 +- _translations/po/es/guide_start_hello.md.po | 152 +++- .../po/es/guide_start_looking-ahead.md.po | 8 +- .../po/es/guide_start_prerequisites.md.po | 34 +- .../po/es/guide_start_workflow.md.po | 109 ++- .../po/es/guide_structure_action.md.po | 99 ++- .../po/es/guide_structure_application.md.po | 16 +- .../guide_structure_designing-packages.md.po | 429 +++++++-- .../po/es/guide_structure_entry-script.md.po | 117 ++- .../po/es/guide_structure_middleware.md.po | 153 +++- .../po/es/guide_structure_module.md.po | 269 +++--- .../po/es/guide_structure_overview.md.po | 68 +- .../po/es/guide_structure_package.md.po | 107 ++- _translations/po/es/index.md.po | 32 +- src/.vitepress/config.js | 147 +++- 30 files changed, 4254 insertions(+), 1727 deletions(-) diff --git a/_translations/po/es/guide_concept_aliases.md.po b/_translations/po/es/guide_concept_aliases.md.po index 2d02e79d..3c46c4f0 100644 --- a/_translations/po/es/guide_concept_aliases.md.po +++ b/_translations/po/es/guide_concept_aliases.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: 2026-06-05 20:33+0000\n" -"PO-Revision-Date: 2025-09-05 12:21+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -33,15 +33,14 @@ msgstr "" #. type: Plain text #: ../src/guide/concept/aliases.md -#, fuzzy msgid "Default Yii application has some aliases pre-defined in `config/params.php`. For example, the alias `@public` represents the web root path; `@baseUrl` represents the base URL for the currently running Web application." -msgstr "Yii incluye varios alias predefinidos en `config/params.php`. Por ejemplo, el alias `@src` representa la ruta de instalación de la aplicación en la carpeta `src`; `@web` representa la URL base para la aplicación Web ejecutándose." +msgstr "La aplicación Yii predeterminada tiene algunos alias predefinidos en `config/params.php`. Por ejemplo, el alias `@public` representa la ruta de la raíz web y `@baseUrl` representa la URL base de la aplicación web que se está ejecutando." #. type: Title ## #: ../src/guide/concept/aliases.md #, no-wrap msgid "Defining aliases" -msgstr "" +msgstr "Definir alias" #. type: Plain text #: ../src/guide/concept/aliases.md @@ -73,17 +72,21 @@ msgid "" msgstr "" "return [\n" " // ...\n" -"\n" -" 'aliases' => [\n" -" // un alias de una ruta de archivos\n" -" '@foo' => '/path/to/foo',\n" -"\n" -" // un alias de un URL\n" -" '@bar' => 'http://www.example.com',\n" -"\n" -" // un alias de un archivo en concreto que contiene la clase \\foo\\Bar\n" -" '@foo/Bar.php' => '/definitely/not/foo/Bar.php',\n" -" ]\n" +" \n" +" 'yiisoft/aliases' => [\n" +" 'aliases' => [\n" +" // ...\n" +" \n" +" // un alias de una ruta de archivo\n" +" '@foo' => '/path/to/foo',\n" +" \n" +" // un alias de una URL\n" +" '@bar' => 'https://www.example.com',\n" +" \n" +" // un alias de un archivo concreto que contiene la clase \\foo\\Bar \n" +" '@foo/Bar.php' => '/definitely/not/foo/Bar.php',\n" +" ],\n" +" ],\n" "];\n" #. type: Plain text @@ -93,7 +96,7 @@ msgid "" "> [!NOTE]\n" "> The file path or URL being aliased may *not* necessarily refer to an existing file or resource.\n" msgstr "" -"> [!Nota]\n" +"> [!NOTE]\n" "> Una ruta de archivo o URL en alias *no* se refiere necesariamente a un archivo o recurso existente.\n" #. type: Plain text @@ -116,12 +119,8 @@ msgstr "'@foobar' => '@foo/bar',\n" #. type: Plain text #: ../src/guide/concept/aliases.md -#, fuzzy -#| msgid "The `yiisoft/aliases` parameter initializes `Aliases` service from [`yiisoft/aliases` package](https://github.com/yiisoft/aliases). You can set extra aliases in runtime by using the service:" msgid "The `yiisoft/aliases` parameter initializes `Aliases` service from [`yiisoft/aliases`](https://github.com/yiisoft/aliases) package. You can set extra aliases in runtime by using the service:" -msgstr "" -"El parámetro `aliases` inicializa el servicio `Aliases` desde el [paquete `yiisoft/aliases`](https://github.com/yiisoft/aliases).\n" -"Puedes agregar alias adicionales en tiempo de ejecución usando el servicio:" +msgstr "El parámetro `yiisoft/aliases` inicializa el servicio `Aliases` del paquete [`yiisoft/aliases`](https://github.com/yiisoft/aliases). Puedes establecer alias adicionales en tiempo de ejecución usando el servicio:" #. type: Fenced code block (php) #: ../src/guide/concept/aliases.md @@ -143,15 +142,14 @@ msgstr "" #. type: Title ## #: ../src/guide/concept/aliases.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Using aliases in configuration" -msgstr "Introducción" +msgstr "Usar alias en la configuración" #. type: Plain text #: ../src/guide/concept/aliases.md msgid "It's preferred to resolve aliases at the configuration level, so services get URLs and paths as ready to use strings:" -msgstr "" +msgstr "Es preferible resolver los alias en la configuración, para que los servicios reciban las URL y las rutas como cadenas listas para usar:" #. type: Fenced code block (php) #: ../src/guide/concept/aliases.md @@ -172,12 +170,26 @@ msgid "" " ),\n" "];\n" msgstr "" +" static fn (Aliases $aliases) => new FileCache(\n" +" $aliases->get($params['yiisoft/cache-file']['fileCache']['path'])\n" +" ),\n" +"];\n" #. type: Title ## #: ../src/guide/concept/aliases.md #, no-wrap msgid "Resolving aliases" -msgstr "" +msgstr "Resolver alias" #. type: Plain text #: ../src/guide/concept/aliases.md @@ -219,14 +231,12 @@ msgid "" "> The `get()` method doesn't check whether the resulting path/URL refers to an existing file or resource.\n" msgstr "" "> [!NOTE]\n" -"> El método `get()` no comprueba si la ruta/URL resultante hacer referencia a un archivo o recurso existente.\n" +"> El método `get()` no comprueba si la ruta/URL resultante hace referencia a un archivo o recurso existente.\n" #. type: Plain text #: ../src/guide/concept/aliases.md msgid "A root alias may also contain slash `/` characters. The `get()` method is intelligent enough to tell, which part of an alias is a root alias and thus correctly determines the corresponding file path or URL:" -msgstr "" -"Un alias de raíz puede contener carácteres `/`.\n" -"El método `get()` es lo suficientemente inteligente para saber qué parte de un alias es un alias de raíz y por lo tanto determinar correctamente la correspondiente ruta de archivo o URL. Por ejemplo:" +msgstr "Un alias de raíz también puede contener caracteres `/`. El método `get()` es lo suficientemente inteligente para saber qué parte de un alias es un alias de raíz y por lo tanto determinar correctamente la correspondiente ruta de archivo o URL. Por ejemplo:" #. type: Fenced code block (php) #: ../src/guide/concept/aliases.md @@ -263,13 +273,12 @@ msgstr "Si `@foo/bar` no está definido como un alias de raíz, la última decla #: ../src/guide/concept/aliases.md #, no-wrap msgid "Predefined aliases" -msgstr "" +msgstr "Alias predefinidos" #. type: Plain text #: ../src/guide/concept/aliases.md -#, fuzzy msgid "[Yii application](https://github.com/yiisoft/app) predefines a set of aliases to reference commonly used file paths and URLs:" -msgstr "Yii predefine un conjunto de alias para aliviar la necesidad de hacer referencia a rutas de archivo o URLs que son utilizadas regularmente:" +msgstr "La [aplicación Yii](https://github.com/yiisoft/app) predefine un conjunto de alias para referirse a las rutas de archivos y URL de uso habitual:" #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md @@ -279,27 +288,27 @@ msgstr "`@root`, la ruta base de la aplicación que se está ejecutando actualme #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@assets` - application's public directory where it publishes assets." -msgstr "" +msgstr "`@assets`, el directorio público de la aplicación donde se publican los assets." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@assetsUrl` - URL of base directory with published assets." -msgstr "" +msgstr "`@assetsUrl`, la URL del directorio base con los assets publicados." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@baseUrl` - the base URL of the currently running Web application. Defaults to `/`." -msgstr "" +msgstr "`@baseUrl`, la URL base de la aplicación web que se está ejecutando. Por defecto, `/`." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@npm` - node packages directory." -msgstr "" +msgstr "`@npm`, el directorio de paquetes de Node." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@bower` - bower packages directory." -msgstr "" +msgstr "`@bower`, el directorio de paquetes de Bower." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md @@ -308,26 +317,25 @@ msgstr "`@vendor`, la carpeta `vendor` de Composer." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md -#, fuzzy msgid "`@public` - application's publicly accessible directory that with `index.php`." -msgstr "`@public`, el directorio raíz Web de la aplicación Web se está ejecutando actualmente." +msgstr "`@public`, el directorio de la aplicación accesible públicamente que contiene `index.php`." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@runtime` - the runtime path of the currently running application. Defaults to `@root/runtime`." -msgstr "`@runtime`, la ruta de ejecución de la aplicación en ejecución. Por defecto`@root/runtime`." +msgstr "`@runtime`, la ruta de ejecución de la aplicación en ejecución. Por defecto, `@root/runtime`." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@layout` - the directory with layouts." -msgstr "" +msgstr "`@layout`, el directorio con los layouts." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@resources` - directory with views, asset sources and other resources." -msgstr "" +msgstr "`@resources`, el directorio con las vistas, las fuentes de los assets y otros recursos." #. type: Bullet: '- ' #: ../src/guide/concept/aliases.md msgid "`@views` - application view templates base directory." -msgstr "" +msgstr "`@views`, el directorio base de las plantillas de vista de la aplicación." diff --git a/_translations/po/es/guide_concept_autoloading.md.po b/_translations/po/es/guide_concept_autoloading.md.po index 84d610e0..8b18dbbc 100644 --- a/_translations/po/es/guide_concept_autoloading.md.po +++ b/_translations/po/es/guide_concept_autoloading.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: 2025-12-24 08:02+0000\n" -"PO-Revision-Date: 2025-09-05 12:25+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -33,23 +33,17 @@ msgstr "Referencias" #: ../src/en/guide/concept/autoloading.md #, no-wrap msgid "Class autoloading" -msgstr "Autocarga de Clases (Autoloading)" +msgstr "Autocarga de clases" #. type: Plain text #: ../src/en/guide/concept/autoloading.md msgid "Since Yii uses [Composer](https://getcomposer.org) to manage packages, it automatically loads classes from these packages without the need to `require` their file explicitly. When it installs packages, it generates a [PSR-4 compatible autoloader](https://www.php-fig.org/psr/psr-4/). To use it, `require_once` autoloader `/vendor/autoload.php` in your `index.php` entry point file." -msgstr "" -"Dado que Yii utiliza [Composer](https://getcomposer.org) para administar paquetes, las clases de esos paquetes son automaticamente\n" -"cargados sin la necesidad de ser incluidos utilizando `require` para cada uno de ellos. Cuando los paquetes son instalados,\n" -"un [autocargador compatible con PSR-0](https://www.php-fig.org/psr/psr-4/) es generado. Para usarlo,\n" -"se debe invocar el autocargador `/vendor/autoload.php` con `require_once` en el script de entrada `index.php`." +msgstr "Dado que Yii utiliza [Composer](https://getcomposer.org) para administrar paquetes, las clases de esos paquetes se cargan automáticamente sin necesidad de incluirlas con `require` una a una. Cuando los paquetes son instalados, un [autocargador compatible con PSR-4](https://www.php-fig.org/psr/psr-4/) es generado. Para usarlo, se debe invocar el autocargador `/vendor/autoload.php` con `require_once` en el script de entrada `index.php`." #. type: Plain text #: ../src/en/guide/concept/autoloading.md msgid "You can use autoloader not only for the packages installed, but for your application as well since it's also a package. To load classes of a certain namespace, add the following to `composer.json`:" -msgstr "" -"El autocargador no se utiliza solamente para los paquetes que se instalan, tambien se utiliza para su aplicación que también es un paquete.\n" -"Para cargar clases desde cierto espacio de nombres (namespaces), lo siguiente debe ser añadido a `composer.json`:" +msgstr "El autocargador no se utiliza solamente para los paquetes que se instalan, también se utiliza para tu aplicación que también es un paquete. Para cargar clases desde cierto espacio de nombres (namespaces), lo siguiente debe ser añadido a `composer.json`:" #. type: Fenced code block (json) #: ../src/en/guide/concept/autoloading.md @@ -74,14 +68,12 @@ msgstr "" #. type: Plain text #: ../src/en/guide/concept/autoloading.md msgid "Where `App\\\\` is a root namespace and `src/` is a directory where you have your classes. You can add more source roots if needed. When done, execute `composer dump-autoload` or simply `composer du` and classes from the corresponding namespaces will start loading automatically." -msgstr "" -"Donde `App\\\\` es el espacio de nombre raiz (namespace), y `src/` es la carpeta donde se ubican las clases. Se pueden añadir distintos namespaces y carpetas si es necesario.\n" -"Una vez listo, ejecuta `composer dump-autoload` y las clases de los espacios de nombres serán cargados automaticamente." +msgstr "Donde `App\\\\` es el espacio de nombres raíz (namespace), y `src/` es la carpeta donde se ubican las clases. Se pueden añadir distintos namespaces y carpetas si es necesario. Una vez listo, ejecuta `composer dump-autoload` o simplemente `composer du`, y las clases de los espacios de nombres correspondientes se cargarán automáticamente." #. type: Plain text #: ../src/en/guide/concept/autoloading.md msgid "If you need development-environment-specific autoloading that isn't used when executing Composer with `--no-dev` flag, add it to `autoload-dev` section instead of `autoload`." -msgstr "" +msgstr "Si necesitas una autocarga específica del entorno de desarrollo que no se use al ejecutar Composer con la opción `--no-dev`, añádela a la sección `autoload-dev` en lugar de a `autoload`." #. type: Bullet: '- ' #: ../src/en/guide/concept/autoloading.md diff --git a/_translations/po/es/guide_concept_configuration.md.po b/_translations/po/es/guide_concept_configuration.md.po index f341257e..534b45dc 100644 --- a/_translations/po/es/guide_concept_configuration.md.po +++ b/_translations/po/es/guide_concept_configuration.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-05-29 19:04+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -23,33 +23,33 @@ msgstr "" #: ../src/guide/views/view-injections.md #, no-wrap msgid "Configuration" -msgstr "" +msgstr "Configuración" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "There are many ways to configure your application. We will focus on concepts used in the [default project template](https://github.com/yiisoft/app)." -msgstr "" +msgstr "Hay muchas formas de configurar tu aplicación. Nos centraremos en los conceptos que usa la [plantilla de proyecto predeterminada](https://github.com/yiisoft/app)." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Yii3 configs are part of the application. You can change many aspects of how the application works by editing configuration under `config/` directory." -msgstr "" +msgstr "Las configuraciones de Yii3 forman parte de la aplicación. Puedes cambiar muchos aspectos del funcionamiento de la aplicación editando la configuración del directorio `config/`." #. type: Title ## #: ../src/guide/concept/configuration.md #, no-wrap msgid "Config plugin" -msgstr "" +msgstr "Plugin de configuración" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The application template uses [yiisoft/config](https://github.com/yiisoft/config) as a composer plugin to assemble configs." -msgstr "" +msgstr "La plantilla de aplicación usa [yiisoft/config](https://github.com/yiisoft/config) como plugin de Composer para ensamblar las configuraciones." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Packages provide default configurations through defined [config groups](https://github.com/yiisoft/config#config-groups) in the `config-plugin` key in the `extra` section of the `composer.json`:" -msgstr "" +msgstr "Los paquetes proporcionan configuraciones predeterminadas mediante [grupos de configuración](https://github.com/yiisoft/config#config-groups) definidos en la clave `config-plugin` de la sección `extra` de `composer.json`:" #. type: Fenced code block (json) #: ../src/guide/concept/configuration.md @@ -65,31 +65,40 @@ msgid "" " }\n" "}\n" msgstr "" +"\"extra\": {\n" +" \"config-plugin-options\": {\n" +" \"source-directory\": \"config\",\n" +" },\n" +" \"config-plugin\": {\n" +" \"params\": \"params.php\",\n" +" \"web\": \"web.php\"\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "After Composer updates autoload files, such as during `dump-autoload`, `install`, `require`, `update`, or `remove`, the plugin scans installed packages for configurations and writes a merge plan to `config/.merge-plan.php`. The merge plan declares the order of merging found configurations into the final configuration to be passed to [DI container](di-container.md)." -msgstr "" +msgstr "Cada vez que Composer actualiza los archivos de autocarga, por ejemplo durante `dump-autoload`, `install`, `require`, `update` o `remove`, el plugin examina los paquetes instalados en busca de configuraciones y escribe un plan de fusión en `config/.merge-plan.php`. El plan de fusión declara el orden en que se fusionan las configuraciones encontradas para obtener la configuración final que se pasa al [contenedor DI](di-container.md)." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "At runtime, `Yiisoft\\Config\\Config` loads the defined config groups according to that merge plan. Configs are read in three layers:" -msgstr "" +msgstr "En tiempo de ejecución, `Yiisoft\\Config\\Config` carga los grupos de configuración definidos según ese plan de fusión. Las configuraciones se leen en tres capas:" #. type: Bullet: '1. ' #: ../src/guide/concept/configuration.md msgid "Vendor package configs with default values." -msgstr "" +msgstr "Configuraciones de los paquetes de terceros (vendor), con los valores predeterminados." #. type: Bullet: '2. ' #: ../src/guide/concept/configuration.md msgid "Root package configs from the application `config/` directory." -msgstr "" +msgstr "Configuraciones del paquete raíz, del directorio `config/` de la aplicación." #. type: Bullet: '3. ' #: ../src/guide/concept/configuration.md msgid "Environment-specific configs from the application." -msgstr "" +msgstr "Configuraciones de la aplicación específicas de cada entorno." #. type: Plain text #: ../src/guide/concept/configuration.md @@ -98,11 +107,13 @@ msgid "" "> [!WARNING]\n" "> Config keys with the same name are not allowed within a single layer.\n" msgstr "" +"> [!WARNING]\n" +"> No se permiten claves de configuración con el mismo nombre dentro de una misma capa.\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The application template stores configurations in a PHP file instead of inline JSON:" -msgstr "" +msgstr "La plantilla de aplicación guarda las configuraciones en un archivo PHP en lugar de escribirlas directamente en JSON:" #. type: Fenced code block (json) #: ../src/guide/concept/configuration.md @@ -112,11 +123,14 @@ msgid "" " \"config-plugin-file\": \"config/configuration.php\"\n" "}\n" msgstr "" +"\"extra\": {\n" +" \"config-plugin-file\": \"config/configuration.php\"\n" +"}\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "That file returns the same keys you could otherwise define in `composer.json`: `config-plugin`, `config-plugin-options`, and `config-plugin-environments`." -msgstr "" +msgstr "Ese archivo devuelve las mismas claves que, de otro modo, podrías definir en `composer.json`: `config-plugin`, `config-plugin-options` y `config-plugin-environments`." #. type: Fenced code block (php) #: ../src/guide/concept/configuration.md @@ -177,59 +191,111 @@ msgid "" " ],\n" "];\n" msgstr "" +"use App\\Environment;\n" +"\n" +"return [\n" +" 'config-plugin-options' => [\n" +" 'source-directory' => 'config',\n" +" ],\n" +" 'config-plugin' => [\n" +" 'params' => 'common/params.php',\n" +" 'params-web' => [\n" +" '$params',\n" +" 'web/params.php',\n" +" ],\n" +" 'params-console' => [\n" +" '$params',\n" +" 'console/params.php',\n" +" ],\n" +" 'bootstrap' => 'common/bootstrap.php',\n" +" 'bootstrap-web' => '$bootstrap',\n" +" 'bootstrap-console' => '$bootstrap',\n" +" 'di' => 'common/di/*.php',\n" +" 'di-web' => [\n" +" '$di',\n" +" 'web/di/*.php',\n" +" ],\n" +" 'di-console' => '$di',\n" +" 'di-delegates' => [],\n" +" 'di-delegates-console' => '$di-delegates',\n" +" 'di-delegates-web' => '$di-delegates',\n" +" 'di-providers' => [],\n" +" 'di-providers-web' => '$di-providers',\n" +" 'di-providers-console' => '$di-providers',\n" +" 'events' => [],\n" +" 'events-web' => '$events',\n" +" 'events-console' => '$events',\n" +" 'routes' => 'common/routes.php',\n" +" ],\n" +" 'config-plugin-environments' => [\n" +" Environment::DEV => [\n" +" 'params' => [\n" +" 'environments/dev/params.php',\n" +" ],\n" +" ],\n" +" Environment::TEST => [\n" +" 'params' => [\n" +" 'environments/test/params.php',\n" +" ],\n" +" ],\n" +" Environment::PROD => [\n" +" 'params' => [\n" +" 'environments/prod/params.php',\n" +" ],\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Config group names are mapping keys. Their values are file paths relative to the `source-directory` option, which defaults to the directory containing `composer.json`." -msgstr "" +msgstr "Los nombres de los grupos de configuración son las claves del array. Sus valores son rutas de archivo relativas a la opción `source-directory`, que por defecto es el directorio que contiene `composer.json`." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "A string value loads one file." -msgstr "" +msgstr "Un valor de tipo cadena carga un solo archivo." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "An array loads and merges multiple files in the given order." -msgstr "" +msgstr "Un array carga y fusiona varios archivos en el orden indicado." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "`?` marks an optional file." -msgstr "" +msgstr "`?` marca un archivo opcional." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "`*` marks a wildcard path." -msgstr "" +msgstr "`*` marca una ruta con comodines." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "`$group` references another config group to be merged." -msgstr "" +msgstr "`$group` hace referencia a otro grupo de configuración que se fusionará." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The `params` group is special: its values are available as `$params` in other config files by default." -msgstr "" +msgstr "El grupo `params` es especial: por defecto, sus valores están disponibles como `$params` en los demás archivos de configuración." #. type: Plain text #: ../src/guide/concept/configuration.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "You can read more in the [yiisoft/config documentation](https://github.com/yiisoft/config/blob/master/README.md)." -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "Más información en la [documentación de yiisoft/config](https://github.com/yiisoft/config/blob/master/README.md)." #. type: Title ## #: ../src/guide/concept/configuration.md #, no-wrap msgid "Config files" -msgstr "" +msgstr "Archivos de configuración" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Now, as you know how the plugin assembles configs, look at the `config/` directory structure used by the default application template:" -msgstr "" +msgstr "Ahora que sabes cómo ensambla el plugin las configuraciones, echa un vistazo a la estructura del directorio `config/` que usa la plantilla de aplicación predeterminada:" #. type: Fenced code block #: ../src/guide/concept/configuration.md @@ -257,52 +323,73 @@ msgid "" ".merge-plan.php\n" "configuration.php\n" msgstr "" +"common/\n" +" bootstrap.php\n" +" params.php\n" +" routes.php\n" +" di/\n" +" *.php\n" +"console/\n" +" params.php\n" +"environments/\n" +" dev/\n" +" params.php\n" +" prod/\n" +" params.php\n" +" test/\n" +" params.php\n" +"web/\n" +" params.php\n" +" di/\n" +" *.php\n" +".merge-plan.php\n" +"configuration.php\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "This structure follows the groups defined in `config/configuration.php`:" -msgstr "" +msgstr "Esta estructura sigue los grupos definidos en `config/configuration.php`:" #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "`params`, `params-web`, and `params-console` load parameter files from `common/`, `web/`, and `console/`." -msgstr "" +msgstr "`params`, `params-web` y `params-console` cargan los archivos de parámetros de `common/`, `web/` y `console/`." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "`di` and `di-web` load container definitions from `common/di/` and `web/di/`." -msgstr "" +msgstr "`di` y `di-web` cargan las definiciones del contenedor de `common/di/` y `web/di/`." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "`routes` and `bootstrap` load `common/routes.php` and `common/bootstrap.php`." -msgstr "" +msgstr "`routes` y `bootstrap` cargan `common/routes.php` y `common/bootstrap.php`." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "`config-plugin-environments` adds environment-specific parameter files from `environments/dev/`, `environments/test/`, and `environments/prod/`." -msgstr "" +msgstr "`config-plugin-environments` añade los archivos de parámetros específicos de cada entorno de `environments/dev/`, `environments/test/` y `environments/prod/`." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "At runtime, `.merge-plan.php` stores the assembled merge plan generated from `configuration.php`." -msgstr "" +msgstr "En tiempo de ejecución, `.merge-plan.php` almacena el plan de fusión ensamblado que se genera a partir de `configuration.php`." #. type: Title ### #: ../src/guide/concept/configuration.md #, no-wrap msgid "Container configuration" -msgstr "" +msgstr "Configuración del contenedor" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The application consists of services registered in a [dependency container](di-container.md). In the default template, direct container definitions live in `config/common/di/*.php` and `config/web/di/*.php`." -msgstr "" +msgstr "La aplicación se compone de servicios registrados en un [contenedor de dependencias](di-container.md). En la plantilla predeterminada, las definiciones directas del contenedor están en `config/common/di/*.php` y `config/web/di/*.php`." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Definitions from `common/di/` are shared by web and console entry points. The `di-web` group adds web-specific definitions from `web/di/`. The `di-console` group currently reuses the shared `di` definitions without extra files." -msgstr "" +msgstr "Las definiciones de `common/di/` se comparten entre los puntos de entrada web y de consola. El grupo `di-web` añade definiciones específicas de la web desde `web/di/`. Actualmente, el grupo `di-console` reutiliza las definiciones compartidas de `di` sin archivos adicionales." #. type: Fenced code block (php) #: ../src/guide/concept/configuration.md @@ -326,82 +413,99 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" '__construct()' => [\n" +" 'name' => $params['application']['name'],\n" +" 'charset' => $params['application']['charset'],\n" +" 'locale' => $params['application']['locale'],\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Config plugin passes the special `$params` variable to all config files. The definition uses it to configure services." -msgstr "" +msgstr "El plugin de configuración pasa la variable especial `$params` a todos los archivos de configuración. La definición la usa para configurar servicios." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The guide on [\"Dependency injection and container\"](di-container.md) describes the configuration format and the idea of dependency injection in detail." -msgstr "" +msgstr "La guía [\"Inyección de dependencias y contenedor\"](di-container.md) describe en detalle el formato de configuración y la idea de la inyección de dependencias." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "For convenience, there is a naming convention for custom string keys:" -msgstr "" +msgstr "Por comodidad, existe una convención de nombres para las claves de cadena personalizadas:" #. type: Bullet: '1. ' #: ../src/guide/concept/configuration.md msgid "Prefix package name such as `yiisoft/cache-file/custom-definition`." -msgstr "" +msgstr "Usa el nombre del paquete como prefijo, por ejemplo `yiisoft/cache-file/custom-definition`." #. type: Bullet: '2. ' #: ../src/guide/concept/configuration.md msgid "In case configuration are for the application itself, skip package prefix, such as `custom-definition`." -msgstr "" +msgstr "Si la configuración es de la propia aplicación, omite el prefijo del paquete, por ejemplo `custom-definition`." #. type: Title ### #: ../src/guide/concept/configuration.md #, no-wrap msgid "Service providers" -msgstr "" +msgstr "Proveedores de servicios" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "As an alternative to registering dependencies directly, you can use service providers. A service provider is a class that returns a reusable set of container definitions and extensions." -msgstr "" +msgstr "Como alternativa a registrar las dependencias directamente, puedes usar proveedores de servicios. Un proveedor de servicios es una clase que devuelve un conjunto reutilizable de definiciones y extensiones del contenedor." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The default template exposes three config groups for service providers: `di-providers`, `di-providers-web`, and `di-providers-console`. In the template they are initialized as empty arrays in `config/configuration.php`, and you can later populate them inline or switch them to load values from files." -msgstr "" +msgstr "La plantilla predeterminada expone tres grupos de configuración para proveedores de servicios: `di-providers`, `di-providers-web` y `di-providers-console`. En la plantilla se inicializan como arrays vacíos en `config/configuration.php`, y más adelante puedes rellenarlos directamente o hacer que carguen sus valores desde archivos." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Prefer direct container configuration for application services with a simple definition: a class name, an interface implementation, constructor arguments from `$params`, or a closure that creates a single service." -msgstr "" +msgstr "Para los servicios de la aplicación con una definición sencilla, es preferible la configuración directa del contenedor: un nombre de clase, la implementación de una interfaz, argumentos del constructor tomados de `$params` o un closure que crea un único servicio." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Use a service provider when the registration itself is a reusable unit:" -msgstr "" +msgstr "Usa un proveedor de servicios cuando el propio registro sea una unidad reutilizable:" #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "A package registers several related services, aliases, or extensions." -msgstr "" +msgstr "Un paquete registra varios servicios, alias o extensiones relacionados." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "A service registration also needs supporting definitions." -msgstr "" +msgstr "El registro de un servicio necesita además definiciones auxiliares." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "The same registration should be reused in several applications." -msgstr "" +msgstr "El mismo registro debe reutilizarse en varias aplicaciones." #. type: Bullet: '- ' #: ../src/guide/concept/configuration.md msgid "Registration depends on optional classes or environment-specific decisions." -msgstr "" +msgstr "El registro depende de clases opcionales o de decisiones específicas de cada entorno." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Use a factory class when construction logic belongs to one service. A factory returns an object. A service provider returns definitions for several related services." -msgstr "" +msgstr "Usa una clase factoría cuando la lógica de construcción pertenezca a un único servicio. Una factoría devuelve un objeto. Un proveedor de servicios devuelve definiciones para varios servicios relacionados." #. type: Fenced code block (php) #: ../src/guide/concept/configuration.md @@ -421,21 +525,34 @@ msgid "" " // ...\n" "];\n" msgstr "" +"/* @var array $params */\n" +"\n" +"// ...\n" +"use App\\Provider\\CacheProvider;\n" +"use App\\Provider\\MiddlewareProvider;\n" +"// ...\n" +"\n" +"return [\n" +" // ...\n" +" 'yiisoft/yii-web/middleware' => MiddlewareProvider::class,\n" +" 'yiisoft/cache/cache' => new CacheProvider($params['yiisoft/cache-file']['file-cache']['path']),\n" +" // ...\n" +"];\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "In this config keys are provider names. By convention these are `vendor/package-name/provider-name`. Values are provider class names or provider instances. These classes could be either created in the project itself or provided by a package." -msgstr "" +msgstr "En esta configuración, las claves son nombres de proveedores. Por convención, tienen la forma `vendor/package-name/provider-name`. Los valores son nombres de clases de proveedores o instancias de proveedores. Estas clases pueden crearse en el propio proyecto o venir de un paquete." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "If you need to configure some options for a service, similar to direct container configuration, take values from `$params` and pass them to providers." -msgstr "" +msgstr "Si necesitas configurar algunas opciones de un servicio, igual que con la configuración directa del contenedor, toma los valores de `$params` y pásalos a los proveedores." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Provider should implement `Yiisoft\\Di\\ServiceProviderInterface`. Below is a provider for a cache service:" -msgstr "" +msgstr "Un proveedor debe implementar `Yiisoft\\Di\\ServiceProviderInterface`. A continuación se muestra un proveedor para un servicio de caché:" #. type: Fenced code block (php) #: ../src/guide/concept/configuration.md @@ -475,18 +592,51 @@ msgid "" " }\n" "}\n" msgstr "" +"use Psr\\Container\\ContainerInterface;\n" +"use Psr\\SimpleCache\\CacheInterface;\n" +"use Yiisoft\\Aliases\\Aliases;\n" +"use Yiisoft\\Cache\\Cache;\n" +"use Yiisoft\\Cache\\CacheInterface as YiiCacheInterface;\n" +"use Yiisoft\\Cache\\File\\FileCache;\n" +"use Yiisoft\\Di\\ServiceProviderInterface;\n" +"\n" +"final readonly class CacheProvider implements ServiceProviderInterface\n" +"{\n" +" public function __construct(\n" +" private string $cachePath = '@runtime/cache'\n" +" )\n" +" {\n" +" }\n" +"\n" +" public function getDefinitions(): array\n" +" {\n" +" return [\n" +" CacheInterface::class => function (ContainerInterface $container) {\n" +" $aliases = $container->get(Aliases::class);\n" +"\n" +" return new FileCache($aliases->get($this->cachePath));\n" +" },\n" +" YiiCacheInterface::class => Cache::class,\n" +" ];\n" +" }\n" +"\n" +" public function getExtensions(): array\n" +" {\n" +" return [];\n" +" }\n" +"}\n" #. type: Title ## #: ../src/guide/concept/configuration.md #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Routes" -msgstr "" +msgstr "Rutas" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "You can configure how the web application responds to certain URLs in `config/common/routes.php`:" -msgstr "" +msgstr "Puedes configurar cómo responde la aplicación web a determinadas URL en `config/common/routes.php`:" #. type: Fenced code block (php) #: ../src/guide/concept/configuration.md ../src/guide/intro/upgrade-from-v2.md @@ -505,11 +655,23 @@ msgid "" " ),\n" "];\n" msgstr "" +"use App\\Web;\n" +"use Yiisoft\\Router\\Group;\n" +"use Yiisoft\\Router\\Route;\n" +"\n" +"return [\n" +" Group::create()\n" +" ->routes(\n" +" Route::get('/')\n" +" ->action(Web\\HomePage\\Action::class)\n" +" ->name('home'),\n" +" ),\n" +"];\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Read more about it in [\"Routes\"](../runtime/routing.md)." -msgstr "" +msgstr "Más información en [\"Enrutamiento y generación de URL\"](../runtime/routing.md)." #. type: Title ## #: ../src/guide/concept/configuration.md ../src/guide/concept/events.md @@ -522,12 +684,12 @@ msgstr "Eventos" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Many services emit certain events that you can attach to. The default template defines three event config groups in `config/configuration.php`: `events`, `events-web`, and `events-console`. They are empty by default, but you can populate them inline or point them to event config files." -msgstr "" +msgstr "Muchos servicios emiten determinados eventos a los que puedes suscribirte. La plantilla predeterminada define tres grupos de configuración de eventos en `config/configuration.php`: `events`, `events-web` y `events-console`. Están vacíos por defecto, pero puedes rellenarlos directamente o hacer que apunten a archivos de configuración de eventos." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The configuration is an array where keys are event names and values are arrays of handlers:" -msgstr "" +msgstr "La configuración es un array cuyas claves son nombres de eventos y cuyos valores son arrays de manejadores:" #. type: Fenced code block (php) #: ../src/guide/concept/configuration.md @@ -560,11 +722,37 @@ msgid "" " ],\n" "];\n" msgstr "" +"return [\n" +" EventName::class => [\n" +" // Un closure normal; el despachador (Dispatcher) lo llamará \"tal cual\".\n" +" static fn (EventName $event) => someStuff($event),\n" +" \n" +" // Un closure normal con una dependencia adicional. Todos los parámetros posteriores al primero (el propio evento)\n" +" // se resolverán desde tu contenedor DI mediante `yiisoft/injector`.\n" +" static fn (EventName $event, DependencyClass $dependency) => someStuff($event),\n" +" \n" +" // Un ejemplo con un callable normal. Si el método `staticMethodName` tiene dependencias,\n" +" // se resolverán del mismo modo que en el ejemplo anterior.\n" +" [SomeClass::class, 'staticMethodName'],\n" +" \n" +" // También se permiten métodos no estáticos. En este caso, tu contenedor DI creará la instancia de `SomeClass`.\n" +" [SomeClass::class, 'methodName'],\n" +" \n" +" // Un objeto de una clase que implementa el método `__invoke`\n" +" new InvokableClass(),\n" +" \n" +" // En este caso, tu contenedor DI creará la instancia de `InvokableClass`, que tiene el método `__invoke`\n" +" InvokableClass::class,\n" +" \n" +" // Aquí puede ir cualquier definición de clase invocable, siempre que `$container->has('the definition')` sea true.\n" +" 'di-alias'\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Read more about it in [\"Events\"](events.md)." -msgstr "" +msgstr "Más información en [\"Eventos\"](events.md)." #. type: Title ## #: ../src/guide/concept/configuration.md @@ -572,12 +760,12 @@ msgstr "" #: ../src/internals/022-config-groups.md #, no-wrap msgid "Parameters" -msgstr "" +msgstr "Parámetros" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Base parameters are stored in `config/common/params.php`. They are then extended by `config/web/params.php`, `config/console/params.php`, and environment-specific files under `config/environments/`." -msgstr "" +msgstr "Los parámetros base se guardan en `config/common/params.php`. Después los amplían `config/web/params.php`, `config/console/params.php` y los archivos específicos de cada entorno dentro de `config/environments/`." #. type: Plain text #: ../src/guide/concept/configuration.md @@ -587,11 +775,14 @@ msgid "" "> Don't use parameters, constants, or environment variables directly in your application, configure\n" "> services instead.\n" msgstr "" +"> [!TIP]\n" +"> No uses parámetros, constantes ni variables de entorno directamente en tu aplicación; en su lugar,\n" +"> configura servicios.\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The default application `common/params.php` looks like the following:" -msgstr "" +msgstr "El archivo `common/params.php` de la aplicación predeterminada tiene este aspecto:" #. type: Fenced code block (php) #: ../src/guide/concept/configuration.md @@ -636,49 +827,87 @@ msgid "" " ],\n" "];\n" msgstr "" +" require __DIR__ . '/application.php',\n" +"\n" +" 'yiisoft/aliases' => [\n" +" 'aliases' => require __DIR__ . '/aliases.php',\n" +" ],\n" +"\n" +" 'yiisoft/view' => [\n" +" 'basePath' => null,\n" +" 'parameters' => [\n" +" 'assetManager' => Reference::to(AssetManager::class),\n" +" 'applicationParams' => Reference::to(ApplicationParams::class),\n" +" 'aliases' => Reference::to(Aliases::class),\n" +" 'urlGenerator' => Reference::to(UrlGeneratorInterface::class),\n" +" 'currentRoute' => Reference::to(CurrentRoute::class),\n" +" ],\n" +" ],\n" +"\n" +" 'yiisoft/yii-view-renderer' => [\n" +" 'viewPath' => null,\n" +" 'layout' => '@src/Web/Shared/Layout/Main/layout.php',\n" +" 'injections' => [\n" +" Reference::to(CsrfViewInjection::class),\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "For convenience, there is a naming convention about parameters:" -msgstr "" +msgstr "Por comodidad, existe una convención de nombres para los parámetros:" #. type: Bullet: '1. ' #: ../src/guide/concept/configuration.md msgid "Group parameters package name such as `yiisoft/cache-file`." -msgstr "" +msgstr "Agrupa los parámetros por nombre de paquete, por ejemplo `yiisoft/cache-file`." #. type: Bullet: '2. ' #: ../src/guide/concept/configuration.md msgid "In case parameters are for the application itself, as in `application`, skip package prefix." -msgstr "" +msgstr "Si los parámetros son de la propia aplicación, como en `application`, omite el prefijo del paquete." #. type: Bullet: '3. ' #: ../src/guide/concept/configuration.md msgid "In case there are many services in the package, such as `file-target` and `file-rotator` in `yiisoft/log-target-file` package, group parameters by service name." -msgstr "" +msgstr "Si el paquete tiene varios servicios, como `file-target` y `file-rotator` en el paquete `yiisoft/log-target-file`, agrupa los parámetros por nombre de servicio." #. type: Bullet: '4. ' #: ../src/guide/concept/configuration.md msgid "Use `enabled` as parameter name to be able to disable or enable a service, such as `yiisoft/yii-debug`." -msgstr "" +msgstr "Usa `enabled` como nombre de parámetro para poder activar o desactivar un servicio, como en `yiisoft/yii-debug`." #. type: Title ### #: ../src/guide/concept/configuration.md #, no-wrap msgid "Package configs" -msgstr "" +msgstr "Configuraciones de paquetes" #. type: Plain text #: ../src/guide/concept/configuration.md msgid "Config plugin does not copy vendor package configs automatically. It loads them directly from `vendor/` as the vendor layer and combines them with the root package and environment-specific layers." -msgstr "" +msgstr "El plugin de configuración no copia automáticamente las configuraciones de los paquetes de terceros. Las carga directamente desde `vendor/` como capa de terceros (vendor) y las combina con la capa del paquete raíz y las capas específicas de cada entorno." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "If you want to customize a package config file in your application, use the `yii-config-copy` Composer command to copy it into your `config/` directory, usually under `config/packages/`. Once copied, the file becomes part of the root package layer, so it can override vendor defaults." -msgstr "" +msgstr "Si quieres personalizar el archivo de configuración de un paquete en tu aplicación, usa el comando de Composer `yii-config-copy` para copiarlo a tu directorio `config/`, normalmente dentro de `config/packages/`. Una vez copiado, el archivo pasa a formar parte de la capa del paquete raíz, por lo que puede sobrescribir los valores predeterminados de los paquetes de terceros." #. type: Plain text #: ../src/guide/concept/configuration.md msgid "The merge plan stored in `.merge-plan.php` defines how config groups are assembled. If you add new config files or directories and update the root package configuration, rebuild the merge plan with `composer yii-config-rebuild`." -msgstr "" +msgstr "El plan de fusión almacenado en `.merge-plan.php` define cómo se ensamblan los grupos de configuración. Si añades nuevos archivos o directorios de configuración y actualizas la configuración del paquete raíz, vuelve a generar el plan de fusión con `composer yii-config-rebuild`." diff --git a/_translations/po/es/guide_concept_di-container.md.po b/_translations/po/es/guide_concept_di-container.md.po index 09246e6c..f69293f0 100644 --- a/_translations/po/es/guide_concept_di-container.md.po +++ b/_translations/po/es/guide_concept_di-container.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-05 20:33+0000\n" -"PO-Revision-Date: 2025-09-04 07:37+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -31,23 +31,23 @@ msgstr "Referencias" #: ../src/guide/concept/di-container.md #, no-wrap msgid "Dependency injection and container" -msgstr "" +msgstr "Inyección de dependencias y contenedor" #. type: Title ## #: ../src/guide/concept/di-container.md #, no-wrap msgid "Dependency injection" -msgstr "" +msgstr "Inyección de dependencias" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "There are two ways of re-using things in OOP: inheritance and composition." -msgstr "" +msgstr "Hay dos formas de reutilizar código en la programación orientada a objetos: la herencia y la composición." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Inheritance is simple:" -msgstr "" +msgstr "La herencia es sencilla:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -73,16 +73,35 @@ msgid "" " }\n" "}\n" msgstr "" +"class Cache\n" +"{\n" +" public function getCachedValue($key)\n" +" {\n" +" // ..\n" +" }\n" +"}\n" +"\n" +"final readonly class CachedWidget extends Cache\n" +"{\n" +" public function render(): string\n" +" {\n" +" $output = $this->getCachedValue('cachedWidget');\n" +" if ($output !== null) {\n" +" return $output;\n" +" }\n" +" // ... \n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "The issue here is that these two are becoming unnecessarily coupled or inter-dependent, making them more fragile." -msgstr "" +msgstr "El problema es que estas dos clases quedan acopladas o son interdependientes sin necesidad, lo que las hace más frágiles." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Another way to handle this is composition:" -msgstr "" +msgstr "Otra forma de resolverlo es la composición:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -119,123 +138,153 @@ msgid "" " }\n" "}\n" msgstr "" +"interface CacheInterface\n" +"{\n" +" public function getCachedValue($key);\n" +"}\n" +"\n" +"final readonly class Cache implements CacheInterface\n" +"{\n" +" public function getCachedValue($key)\n" +" {\n" +" // ..\n" +" }\n" +"}\n" +"\n" +"final readonly class CachedWidget\n" +"{\n" +" public function __construct(\n" +" private CacheInterface $cache\n" +" )\n" +" {\n" +" }\n" +" \n" +" public function render(): string\n" +" {\n" +" $output = $this->cache->getCachedValue('cachedWidget');\n" +" if ($output !== null) {\n" +" return $output;\n" +" }\n" +" // ... \n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "We've avoided unnecessary inheritance and used `CacheInterface` in the `CacheWidget` to reduce coupling. You can replace cache implementation without changing `CachedWidget` so it's becoming more stable. The less edits are made to the code, the less chance of breaking it." -msgstr "" +msgstr "Hemos evitado una herencia innecesaria y hemos usado `CacheInterface` en `CacheWidget` para reducir el acoplamiento. Puedes sustituir la implementación de la caché sin cambiar `CachedWidget`, por lo que la clase se vuelve más estable. Cuantas menos modificaciones se hacen en el código, menos probabilidades hay de romperlo." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "The `CacheInterface` here is a dependency: a contract our object needs to function. In other words, our object depends on the contract." -msgstr "" +msgstr "Aquí, `CacheInterface` es una dependencia: un contrato que nuestro objeto necesita para funcionar. Dicho de otro modo, nuestro objeto depende del contrato." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "The process of putting an instance of a contract into an object (`CachedWidget`) is called dependency injection. There are many ways to perform it:" -msgstr "" +msgstr "El proceso de introducir una instancia de un contrato en un objeto (`CachedWidget`) se llama inyección de dependencias. Hay muchas formas de hacerlo:" #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "Constructor injection. Best for mandatory dependencies." -msgstr "" +msgstr "Inyección por constructor. Es la mejor opción para las dependencias obligatorias." #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "Method injection. Best for optional dependencies." -msgstr "" +msgstr "Inyección por método. Es la mejor opción para las dependencias opcionales." #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "Property injection. Better to be avoided in PHP except maybe data transfer objects." -msgstr "" +msgstr "Inyección por propiedad. En PHP es mejor evitarla, salvo quizá en los objetos de transferencia de datos (DTO)." #. type: Title ### #: ../src/guide/concept/di-container.md #, no-wrap msgid "Why use private properties" -msgstr "" +msgstr "Por qué usar propiedades privadas" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "In the composition example above, note that the `$cache` property is declared as `private`." -msgstr "" +msgstr "En el ejemplo de composición anterior, fíjate en que la propiedad `$cache` se declara como `private`." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "This approach embraces composition by ensuring objects have well-defined interfaces for interaction rather than direct property access, making the code more maintainable and less prone to certain types of mistakes." -msgstr "" +msgstr "Este enfoque favorece la composición, ya que garantiza que los objetos tengan interfaces bien definidas para interactuar en lugar de permitir el acceso directo a sus propiedades, lo que hace que el código sea más fácil de mantener y menos propenso a ciertos tipos de errores." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "This design choice provides several benefits:" -msgstr "" +msgstr "Esta decisión de diseño ofrece varias ventajas:" #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "**Encapsulation**: Private properties with getters/setters allow you to control access and make future changes without breaking existing code." -msgstr "" +msgstr "**Encapsulación**: las propiedades privadas con getters/setters te permiten controlar el acceso y hacer cambios en el futuro sin romper el código existente." #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "**Data integrity**: Setters can validate, normalize, or format values before storing them, ensuring properties contain valid data." -msgstr "" +msgstr "**Integridad de los datos**: los setters pueden validar, normalizar o formatear los valores antes de guardarlos, lo que garantiza que las propiedades contengan datos válidos." #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "**Immutability**: Private properties enable immutable object patterns where setter `with*()` methods return new instances rather than modifying the current one." -msgstr "" +msgstr "**Inmutabilidad**: las propiedades privadas permiten patrones de objetos inmutables en los que los métodos setter `with*()` devuelven nuevas instancias en lugar de modificar la actual." #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "**Flexibility**: You can create read-only or write-only properties or add additional logic to property access later." -msgstr "" +msgstr "**Flexibilidad**: puedes crear propiedades de solo lectura o de solo escritura, o añadir más adelante lógica adicional al acceso a las propiedades." #. type: Title ## #: ../src/guide/concept/di-container.md #, no-wrap msgid "DI container" -msgstr "" +msgstr "Contenedor DI" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Injecting basic dependencies is straightforward. You're choosing a place where you don't care about dependencies, which is usually an action handler, which you aren't going to unit-test ever, create instances of dependencies needed and pass these to dependent classes." -msgstr "" +msgstr "Inyectar dependencias básicas es sencillo. Eliges un lugar en el que no te preocupen las dependencias, que suele ser un manejador de acción al que nunca vas a hacer pruebas unitarias, creas las instancias de las dependencias necesarias y se las pasas a las clases dependientes." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "It works well when there are few dependencies overall and when there are no nested dependencies. When there are many and each dependency has dependencies itself, instantiating the whole hierarchy becomes a tedious process, which requires lots of code and may lead to hardly debuggable mistakes." -msgstr "" +msgstr "Funciona bien cuando hay pocas dependencias en total y no hay dependencias anidadas. Cuando hay muchas y cada dependencia tiene a su vez sus propias dependencias, instanciar toda la jerarquía se convierte en un proceso tedioso, que requiere mucho código y puede provocar errores difíciles de depurar." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Additionally, lots of dependencies, such as certain third-party API wrappers, are the same for any class using it. So it makes sense to:" -msgstr "" +msgstr "Además, muchas dependencias, como ciertos envoltorios (wrappers) de API de terceros, son las mismas para cualquier clase que las use. Por eso tiene sentido:" #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "Define how to instantiate such common dependencies." -msgstr "" +msgstr "Definir cómo instanciar esas dependencias comunes." #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "Instantiate them when required and only once per request." -msgstr "" +msgstr "Instanciarlas cuando se necesiten y solo una vez por solicitud." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "That's what dependency containers are for." -msgstr "" +msgstr "Para eso sirven los contenedores de dependencias." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "A dependency injection (DI) container is an object that knows how to instantiate and configure objects and all objects they depend on." -msgstr "" +msgstr "Un contenedor de inyección de dependencias (DI) es un objeto que sabe cómo instanciar y configurar objetos y todos los objetos de los que estos dependen." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Yii provides the DI container feature through the [yiisoft/di](https://github.com/yiisoft/di) package and [yiisoft/injector](https://github.com/yiisoft/injector) package." -msgstr "" +msgstr "Yii ofrece la funcionalidad de contenedor DI mediante los paquetes [yiisoft/di](https://github.com/yiisoft/di) y [yiisoft/injector](https://github.com/yiisoft/injector)." #. type: Plain text #: ../src/guide/concept/di-container.md @@ -245,6 +294,9 @@ msgid "" "> The container contains only shared instances. If you need a factory, use the dedicated\n" "> [yiisoft/factory](https://github.com/yiisoft/factory) package.\n" msgstr "" +"> [!NOTE]\n" +"> El contenedor solo contiene instancias compartidas. Si necesitas una factoría, usa el paquete específico\n" +"> [yiisoft/factory](https://github.com/yiisoft/factory).\n" #. type: Plain text #: ../src/guide/concept/di-container.md @@ -254,17 +306,20 @@ msgid "" "> [Martin Fowler's article](https://martinfowler.com/articles/injection.html) has well\n" "> explained why DI container is useful. Here we will mainly explain the usage of the DI container provided by Yii.\n" msgstr "" +"> [!TIP]\n" +"> El [artículo de Martin Fowler](https://martinfowler.com/articles/injection.html) explica muy bien\n" +"> por qué es útil un contenedor DI. Aquí explicaremos principalmente cómo usar el contenedor DI que proporciona Yii.\n" #. type: Title ### #: ../src/guide/concept/di-container.md #, no-wrap msgid "Configuring container" -msgstr "" +msgstr "Configurar el contenedor" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Because to create a new object you need its dependencies, you should register them as early as possible. You can do it in the application configuration, `config/web.php`. For the following service:" -msgstr "" +msgstr "Como para crear un objeto nuevo necesitas sus dependencias, conviene registrarlas lo antes posible. Puedes hacerlo en la configuración de la aplicación, `config/web.php`. Para el siguiente servicio:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -282,11 +337,22 @@ msgid "" " }\n" "}\n" msgstr "" +"final class MyService implements MyServiceInterface\n" +"{\n" +" public function __construct(int $amount)\n" +" {\n" +" }\n" +"\n" +" public function setDiscount(int $discount): void\n" +" {\n" +" \n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "configuration could be:" -msgstr "" +msgstr "la configuración podría ser:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -300,11 +366,18 @@ msgid "" " ],\n" "];\n" msgstr "" +"return [\n" +" MyServiceInterface::class => [\n" +" 'class' => MyService::class,\n" +" '__construct()' => [42],\n" +" 'setDiscount()' => [10],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "That's equal to the following:" -msgstr "" +msgstr "Esto equivale a lo siguiente:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -313,11 +386,13 @@ msgid "" "$myService = new MyService(42);\n" "$myService->setDiscount(10);\n" msgstr "" +"$myService = new MyService(42);\n" +"$myService->setDiscount(10);\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "You can provide arguments with names as well:" -msgstr "" +msgstr "También puedes pasar los argumentos con nombre:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -331,11 +406,18 @@ msgid "" " ],\n" "];\n" msgstr "" +"return [\n" +" MyServiceInterface::class => [\n" +" 'class' => MyService::class,\n" +" '__construct()' => ['amount' => 42],\n" +" 'setDiscount()' => ['discount' => 10],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "That's basically it. You define a map of interfaces to classes and define how to configure them. When an interface is requested in constructor or elsewhere, container creates an instance of a class and configures it as per the configuration:" -msgstr "" +msgstr "Básicamente, eso es todo. Defines un mapa de interfaces a clases e indicas cómo configurarlas. Cuando se solicita una interfaz en un constructor o en otro lugar, el contenedor crea una instancia de la clase y la configura según lo indicado en la configuración:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -354,16 +436,28 @@ msgid "" " }\n" "}\n" msgstr "" +"final class MyAction\n" +"{\n" +" public function __construct(\n" +" private readonly MyServiceInterface $myService\n" +" ) {\n" +" }\n" +" \n" +" public function __invoke() \n" +" {\n" +" $this->myService->doSomething();\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "There are extra methods of declaring dependency configuration." -msgstr "" +msgstr "Hay otras formas de declarar la configuración de las dependencias." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "For simplest cases where there are no custom values needed and all the constructor dependencies could be obtained from a container, you can use a class name as a value." -msgstr "" +msgstr "En los casos más sencillos, en los que no se necesitan valores personalizados y todas las dependencias del constructor pueden obtenerse del contenedor, puedes usar un nombre de clase como valor." #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -380,11 +474,21 @@ msgid "" " } \n" "}\n" msgstr "" +"interface EngineInterface\n" +"{\n" +" \n" +"}\n" +"\n" +"final class EngineMarkOne implements EngineInterface\n" +"{\n" +" public function __construct(CacheInterface $cache) {\n" +" } \n" +"}\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "In the above example, if we already have cache defined in the container, nothing besides the class name is needed:" -msgstr "" +msgstr "En el ejemplo anterior, si ya tenemos la caché definida en el contenedor, no hace falta nada más que el nombre de la clase:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -395,11 +499,15 @@ msgid "" " EngineInterface::class => EngineMarkOne::class,\n" "];\n" msgstr "" +"return [\n" +" // declara una clase para una interfaz y resuelve las dependencias automáticamente\n" +" EngineInterface::class => EngineMarkOne::class,\n" +"];\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "If you have a dependency that has public properties, you can configure it as well." -msgstr "" +msgstr "Si tienes una dependencia con propiedades públicas, también puedes configurarlas." #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -410,11 +518,15 @@ msgid "" " public string $name;\n" "}\n" msgstr "" +"final class NameProvider\n" +"{\n" +" public string $name;\n" +"}\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Here's how to do it for the example above:" -msgstr "" +msgstr "Así se hace para el ejemplo anterior:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -425,16 +537,20 @@ msgid "" " '$name' => 'Alex',\n" "],\n" msgstr "" +"NameProvider::class => [\n" +" 'class' => NameProvider::class, \n" +" '$name' => 'Alex',\n" +"],\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "In this example, you may notice `NameProvider` specified twice. The key is what you may request as dependency and the value is how to create it." -msgstr "" +msgstr "En este ejemplo, quizá notes que `NameProvider` se especifica dos veces. La clave es lo que puedes solicitar como dependencia y el valor es cómo crearla." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "If the configuration is tricky and requires some logic, a closure can be used:" -msgstr "" +msgstr "Si la configuración es complicada y requiere cierta lógica, puedes usar un closure:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -444,11 +560,14 @@ msgid "" " return new MyService($container->get('db'));\n" "},\n" msgstr "" +"MyServiceInterface::class => static function(ContainerInterface $container) {\n" +" return new MyService($container->get('db'));\n" +"},\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Additionally, to `ContainerInterface`, you can request any registered service directly as a closure parameter. The injector will automatically resolve and inject these:" -msgstr "" +msgstr "Además de `ContainerInterface`, puedes solicitar directamente cualquier servicio registrado como parámetro del closure. El inyector los resolverá e inyectará automáticamente:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -458,44 +577,47 @@ msgid "" " return new MyService($db);\n" "},\n" msgstr "" +"MyServiceInterface::class => static function(ConnectionInterface $db) {\n" +" return new MyService($db);\n" +"},\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "It's possible to use a static method call:" -msgstr "" +msgstr "Se puede usar una llamada a un método estático:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md #, no-wrap msgid "MyServiceInterface::class => [MyFactory::class, 'create'],\n" -msgstr "" +msgstr "MyServiceInterface::class => [MyFactory::class, 'create'],\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Or an instance of an object:" -msgstr "" +msgstr "O una instancia de un objeto:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md #, no-wrap msgid "MyServiceInterface::class => new MyService(),\n" -msgstr "" +msgstr "MyServiceInterface::class => new MyService(),\n" #. type: Title ### #: ../src/guide/concept/di-container.md #, no-wrap msgid "Injecting dependencies properly" -msgstr "" +msgstr "Inyectar dependencias correctamente" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Directly referencing a container in a class is a bad idea since the code becomes non-generic, coupled to the container interface and, what's worse, dependencies are becoming hidden. Because of that, Yii inverts the control by automatically injecting objects from a container in some constructors and methods based on method argument types." -msgstr "" +msgstr "Hacer referencia directamente a un contenedor dentro de una clase es una mala idea, ya que el código deja de ser genérico, queda acoplado a la interfaz del contenedor y, lo que es peor, las dependencias quedan ocultas. Por eso, Yii invierte el control inyectando automáticamente objetos desde un contenedor en algunos constructores y métodos según los tipos de sus argumentos." #. type: Plain text #: ../src/guide/concept/di-container.md msgid "This is primarily done in constructor and handing method of action handlers:" -msgstr "" +msgstr "Esto se hace principalmente en el constructor y en el método que procesa la acción de los manejadores de acción:" #. type: Fenced code block (php) #: ../src/guide/concept/di-container.md @@ -524,13 +646,35 @@ msgid "" " }\n" "}\n" msgstr "" +"use \\Yiisoft\\Cache\\CacheInterface;\n" +"\n" +"final readonly class MyController\n" +"{\n" +" public function __construct(\n" +" private CacheInterface $cache\n" +" )\n" +" {\n" +" $this->cache = $cache; \n" +" }\n" +"\n" +" public function actionDashboard(RevenueReport $report)\n" +" {\n" +" $reportData = $this->cache->getOrSet('revenue_report', function() use ($report) {\n" +" return $report->getData(); \n" +" });\n" +"\n" +" return $this->render('dashboard', [\n" +" 'reportData' => $reportData,\n" +" ]);\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/concept/di-container.md msgid "Since it's [yiisoft/injector](https://github.com/yiisoft/injector) that instantiates and calls action handler, it checks the constructor and method argument types, gets dependencies of these types from a container and passes them as arguments. That's usually called auto-wiring. It happens for sub-dependencies as well, that's if you don't give dependency explicitly, the container would check if it has such a dependency first. It's enough to declare a dependency you need, and it would be got from a container automatically." -msgstr "" +msgstr "Como es [yiisoft/injector](https://github.com/yiisoft/injector) quien instancia y llama al manejador de acción, comprueba los tipos de los argumentos del constructor y del método, obtiene del contenedor las dependencias de esos tipos y las pasa como argumentos. Esto suele llamarse autowiring (conexión automática). También ocurre con las subdependencias: si no proporcionas una dependencia explícitamente, el contenedor comprueba primero si tiene esa dependencia. Basta con declarar la dependencia que necesitas para que se obtenga automáticamente del contenedor." #. type: Bullet: '- ' #: ../src/guide/concept/di-container.md msgid "[Inversion of Control Containers and the Dependency Injection pattern by Martin Fowler](https://martinfowler.com/articles/injection.html)" -msgstr "" +msgstr "[Inversion of Control Containers and the Dependency Injection pattern, de Martin Fowler](https://martinfowler.com/articles/injection.html)" diff --git a/_translations/po/es/guide_concept_events.md.po b/_translations/po/es/guide_concept_events.md.po index a7feaeb2..50ef1cf5 100644 --- a/_translations/po/es/guide_concept_events.md.po +++ b/_translations/po/es/guide_concept_events.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: 2026-06-05 20:33+0000\n" -"PO-Revision-Date: 2025-09-05 12:44+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -27,58 +27,38 @@ msgstr "Eventos" #. type: Plain text #: ../src/guide/concept/events.md -#, fuzzy -#| msgid "Events allow you to make custom code executed at certain execution points without modifying existing code. You can attach a custom code called \"handler\" to an event so that when the event is triggered, the handler gets executed automatically." msgid "Events allow you to run custom code at certain execution points without changing the code that emits the event. You attach a custom code called a listener to an event. When the event is dispatched, the listener is executed." -msgstr "" -"Los eventos permiten ejecutar código personalizado en ciertos puntos de ejecución sin modificar el código existente.\n" -"A un evento se le puede acoplar un código especial llamado gestor (handler), de manera que una vez que el evento se dispare (triggered),\n" -"el código se ejecuta de manera automática." +msgstr "Los eventos te permiten ejecutar código personalizado en determinados puntos de la ejecución sin cambiar el código que emite el evento. A un evento se le asocia un código personalizado llamado listener. Cuando se despacha el evento, se ejecuta el listener." #. type: Plain text #: ../src/guide/concept/events.md -#, fuzzy -#| msgid "For example, when a user is signed up, you need to send a welcome email. You can do it right in the `SignupService` but then, when you additionally need to resize user's avatar image, you'll have to change `SignupService` code again. In other words, `SignupService` will be coupled to both code sending welcome email and code resizing avatar image." msgid "For example, when a user signs up, you need to send a welcome email. You can do it in `SignupService`. Later, when you also need to resize the user's avatar image, the service has to know about that too." -msgstr "" -"Por ejemplo, cuando un usuario se registra debes enviarle un correo electrónico de bienvenida. Puedes realizar esto directamente en `RegistroService`,\n" -"pero luego adicionalmente debes redimensionar la imagen del avatar del usuario, y tendrás que modificar nuevamente `RegistroService`.\n" -"En otras palabras, a `RegistroService` se le acoplan el codigo de enviar un correo de bienvenida y redimensionar la imagen del avatar." +msgstr "Por ejemplo, cuando un usuario se registra, tienes que enviarle un correo de bienvenida. Puedes hacerlo en `SignupService`. Más adelante, cuando también necesites redimensionar la imagen del avatar del usuario, el servicio tendrá que saber eso también." #. type: Plain text #: ../src/guide/concept/events.md msgid "A cleaner flow is to dispatch a `UserSignedUp` event from `SignupService`. The welcome email sender and the avatar processor listen to this event. Additional signup-related work can be added by registering another listener." -msgstr "" +msgstr "Un flujo más limpio consiste en despachar un evento `UserSignedUp` desde `SignupService`. El remitente del correo de bienvenida y el procesador de avatares escuchan este evento. Para añadir más tareas relacionadas con el registro, basta con registrar otro listener." #. type: Plain text #: ../src/guide/concept/events.md msgid "Yii uses [yiisoft/yii-event](https://github.com/yiisoft/yii-event) for application event configuration. It builds on the [yiisoft/event-dispatcher](https://github.com/yiisoft/event-dispatcher) package, which provides a [PSR-14](https://www.php-fig.org/psr/psr-14/) compatible event dispatcher." -msgstr "" +msgstr "Yii usa [yiisoft/yii-event](https://github.com/yiisoft/yii-event) para configurar los eventos de la aplicación. Se basa en el paquete [yiisoft/event-dispatcher](https://github.com/yiisoft/event-dispatcher), que proporciona un despachador de eventos compatible con [PSR-14](https://www.php-fig.org/psr/psr-14/)." #. type: Title ## #: ../src/guide/concept/events.md -#, fuzzy, no-wrap -#| msgid "Events" +#, no-wrap msgid "Event classes" -msgstr "Eventos" +msgstr "Clases de eventos" #. type: Plain text #: ../src/guide/concept/events.md msgid "An event is an object. It usually contains data that listeners need:" -msgstr "" +msgstr "Un evento es un objeto. Normalmente contiene los datos que necesitan los listeners:" #. type: Fenced code block (php) #: ../src/guide/concept/events.md -#, fuzzy, no-wrap -#| msgid "" -#| "final readonly class UserSignedUp\n" -#| "{\n" -#| " public function __construct(\n" -#| " public SignupForm $form\n" -#| " )\n" -#| " {\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "final readonly class UserSignedUp\n" "{\n" @@ -90,59 +70,41 @@ msgstr "" "final readonly class UserSignedUp\n" "{\n" " public function __construct(\n" -" public SignupForm $form\n" -" )\n" -" {\n" -" }\n" +" public SignupForm $form,\n" +" ) {}\n" "}\n" #. type: Title ## #: ../src/guide/concept/events.md #, no-wrap msgid "Event listeners" -msgstr "" +msgstr "Listeners de eventos" #. type: Plain text #: ../src/guide/concept/events.md -#, fuzzy msgid "An event listener is a [PHP callable](https://www.php.net/manual/en/language.types.callable.php) that receives an event:" -msgstr "" -"Un gestor de eventos es una [llamada de retorno PHP (PHP callback)](https://www.php.net/manual/en/language.types.callable.php) que se ejecuta cuando se\n" -"lanza el evento al que corresponde." +msgstr "Un listener de eventos es un [callable de PHP](https://www.php.net/manual/en/language.types.callable.php) que recibe un evento:" #. type: Fenced code block (php) #: ../src/guide/concept/events.md -#, fuzzy, no-wrap -#| msgid "" -#| "function (EventClass $event) {\n" -#| " // handle it\n" -#| "}\n" +#, no-wrap msgid "" "static function (UserSignedUp $event): void {\n" " // Send a welcome email.\n" "}\n" msgstr "" -"function (EventClass $event) {\n" -" // gestionar evento\n" +"static function (UserSignedUp $event): void {\n" +" // Enviar un correo de bienvenida.\n" "}\n" #. type: Plain text #: ../src/guide/concept/events.md msgid "You can also use an invokable class:" -msgstr "" +msgstr "También puedes usar una clase invocable:" #. type: Fenced code block (php) #: ../src/guide/concept/events.md -#, fuzzy, no-wrap -#| msgid "" -#| "final readonly class UserSignedUp\n" -#| "{\n" -#| " public function __construct(\n" -#| " public SignupForm $form\n" -#| " )\n" -#| " {\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "final readonly class WelcomeEmailSender\n" "{\n" @@ -152,12 +114,11 @@ msgid "" " }\n" "}\n" msgstr "" -"final readonly class UserSignedUp\n" +"final readonly class WelcomeEmailSender\n" "{\n" -" public function __construct(\n" -" public SignupForm $form\n" -" )\n" +" public function __invoke(UserSignedUp $event): void\n" " {\n" +" // Enviar un correo de bienvenida.\n" " }\n" "}\n" @@ -165,32 +126,32 @@ msgstr "" #: ../src/guide/concept/events.md #, no-wrap msgid "Configuring event listeners" -msgstr "" +msgstr "Configurar los listeners de eventos" #. type: Plain text #: ../src/guide/concept/events.md msgid "In an application, configure listeners in:" -msgstr "" +msgstr "En una aplicación, los listeners se configuran en:" #. type: Bullet: '- ' #: ../src/guide/concept/events.md msgid "`config/events.php` for all application types." -msgstr "" +msgstr "`config/events.php` para todos los tipos de aplicación." #. type: Bullet: '- ' #: ../src/guide/concept/events.md msgid "`config/events-web.php` for web application events." -msgstr "" +msgstr "`config/events-web.php` para los eventos de la aplicación web." #. type: Bullet: '- ' #: ../src/guide/concept/events.md msgid "`config/events-console.php` for console application events." -msgstr "" +msgstr "`config/events-console.php` para los eventos de la aplicación de consola." #. type: Plain text #: ../src/guide/concept/events.md msgid "The configuration is an array where keys are event class names and values are lists of listeners:" -msgstr "" +msgstr "La configuración es un array cuyas claves son los nombres de las clases de eventos y cuyos valores son listas de listeners:" #. type: Fenced code block (php) #: ../src/guide/concept/events.md @@ -211,50 +172,45 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" WelcomeEmailSender::class,\n" +" static fn (UserSignedUp $event, AvatarProcessor $avatarProcessor) => $avatarProcessor->resize($event->form),\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/concept/events.md msgid "The listener may be a closure, a callable array, an invokable object, an invokable class name, or a DI alias. For closure and callable array listeners, parameters after the first event parameter are resolved from the DI container. Invokable class names are instantiated by the container." -msgstr "" +msgstr "El listener puede ser una closure, un array callable, un objeto invocable, el nombre de una clase invocable o un alias del contenedor DI. En los listeners que son closures o arrays callables, los parámetros que siguen al primer parámetro (el evento) se resuelven desde el contenedor DI. El contenedor instancia las clases invocables indicadas por su nombre." #. type: Plain text #: ../src/guide/concept/events.md msgid "Dependencies are resolved when the event is dispatched." -msgstr "" +msgstr "Las dependencias se resuelven cuando se despacha el evento." #. type: Title ## #: ../src/guide/concept/events.md #, no-wrap msgid "Dispatching events" -msgstr "" +msgstr "Despachar eventos" #. type: Plain text #: ../src/guide/concept/events.md msgid "To dispatch an event, use `Psr\\EventDispatcher\\EventDispatcherInterface`:" -msgstr "" +msgstr "Para despachar un evento, usa `Psr\\EventDispatcher\\EventDispatcherInterface`:" #. type: Fenced code block (php) #: ../src/guide/concept/events.md -#, fuzzy, no-wrap -#| msgid "" -#| "use Psr\\EventDispatcher\\EventDispatcherInterface;\n" -#| "\n" -#| "final readonly class SignupService\n" -#| "{\n" -#| " public function __construct(\n" -#| " private EventDispatcherInterface $eventDispatcher\n" -#| " )\n" -#| " {\n" -#| " }\n" -#| "\n" -#| " public function signup(SignupForm $form)\n" -#| " {\n" -#| " // handle signup\n" -#| "\n" -#| " $event = new UserSignedUp($form);\n" -#| " $this->eventDispatcher->dispatch($event);\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "use Psr\\EventDispatcher\\EventDispatcherInterface;\n" "\n" @@ -277,55 +233,48 @@ msgstr "" "final readonly class SignupService\n" "{\n" " public function __construct(\n" -" private EventDispatcherInterface $eventDispatcher\n" -" )\n" -" {\n" -" }\n" +" private EventDispatcherInterface $eventDispatcher,\n" +" ) {}\n" "\n" -" public function signup(SignupForm $form)\n" +" public function signup(SignupForm $form): void\n" " {\n" -" // handle signup\n" +" // Registrar al usuario.\n" "\n" -" $event = new UserSignedUp($form);\n" -" $this->eventDispatcher->dispatch($event);\n" +" $this->eventDispatcher->dispatch(new UserSignedUp($form));\n" " }\n" "}\n" #. type: Plain text #: ../src/guide/concept/events.md msgid "The dispatcher asks a listener provider for listeners that match the event and calls them one by one." -msgstr "" +msgstr "El despachador pide a un proveedor de listeners los listeners que coinciden con el evento y los llama uno a uno." #. type: Title ## #: ../src/guide/concept/events.md #, no-wrap msgid "Event listener order" -msgstr "" +msgstr "Orden de los listeners de eventos" #. type: Plain text #: ../src/guide/concept/events.md msgid "When several listeners are configured for the same event, they are called in the order they are listed in the config. If an event implements `Psr\\EventDispatcher\\StoppableEventInterface`, the dispatcher checks `isPropagationStopped()` before calling the next listener. When it returns `true`, the dispatcher stops processing the event." -msgstr "" +msgstr "Cuando hay varios listeners configurados para el mismo evento, se llaman en el orden en que aparecen en la configuración. Si un evento implementa `Psr\\EventDispatcher\\StoppableEventInterface`, el despachador comprueba `isPropagationStopped()` antes de llamar al siguiente listener. Cuando devuelve `true`, el despachador deja de procesar el evento." #. type: Plain text #: ../src/guide/concept/events.md msgid "Keep listeners independent where possible. Ordering is useful for technical needs, but business logic is usually easier to maintain when each listener can run on its own." -msgstr "" +msgstr "Mantén los listeners independientes siempre que puedas. El orden es útil para necesidades técnicas, pero la lógica de negocio suele ser más fácil de mantener cuando cada listener puede ejecutarse por sí solo." #. type: Title ## #: ../src/guide/concept/events.md #, no-wrap msgid "Event hierarchy" -msgstr "" +msgstr "Jerarquía de eventos" #. type: Plain text #: ../src/guide/concept/events.md -#, fuzzy -#| msgid "Events don't have any name or wildcard matching on purpose. Event class names and class/interface hierarchy and composition could be used to achieve great flexibility:" msgid "Events don't have names or wildcard matching. Event class names, interfaces, and inheritance can be used when one listener should handle several related events:" -msgstr "" -"Los eventos no tienen nombre o wildcard matching por una razón. Los nombres de clases de los eventos y la jerarquía de clases/interfaces\n" -"y composición se puede utilizar para obtener mayor flexibilidad:" +msgstr "Los eventos no tienen nombres ni coincidencia con comodines. Cuando un listener debe gestionar varios eventos relacionados, puedes usar los nombres de las clases de eventos, las interfaces y la herencia:" #. type: Fenced code block (php) #: ../src/guide/concept/events.md @@ -358,7 +307,7 @@ msgstr "" #. type: Plain text #: ../src/guide/concept/events.md msgid "With the interface, you can listen to all document-related events:" -msgstr "Para que la interface de arriba escuche todos los eventos relacionados con documentos, se puede realizar de la siguiente forma:" +msgstr "Con la interfaz, puedes escuchar todos los eventos relacionados con documentos:" #. type: Fenced code block (php) #: ../src/guide/concept/events.md @@ -374,17 +323,26 @@ msgid "" "\n" "$provider = new Provider($listeners);\n" msgstr "" +"use Yiisoft\\EventDispatcher\\Provider\\ListenerCollection;\n" +"use Yiisoft\\EventDispatcher\\Provider\\Provider;\n" +"\n" +"$listeners = (new ListenerCollection())\n" +" ->add(static function (DocumentEvent $event): void {\n" +" // Registrar en el log los eventos de documentos.\n" +" });\n" +"\n" +"$provider = new Provider($listeners);\n" #. type: Title ## #: ../src/guide/concept/events.md #, no-wrap msgid "Manual listener provider setup" -msgstr "" +msgstr "Configurar manualmente el proveedor de listeners" #. type: Plain text #: ../src/guide/concept/events.md msgid "In an application, use event configuration. For package-level code or tests, you can create a listener provider manually:" -msgstr "" +msgstr "En una aplicación, usa la configuración de eventos. En el código de paquetes o en las pruebas, puedes crear un proveedor de listeners manualmente:" #. type: Fenced code block (php) #: ../src/guide/concept/events.md @@ -404,12 +362,25 @@ msgid "" "\n" "$dispatcher->dispatch(new UserSignedUp($form));\n" msgstr "" +"use Yiisoft\\EventDispatcher\\Dispatcher\\Dispatcher;\n" +"use Yiisoft\\EventDispatcher\\Provider\\ListenerCollection;\n" +"use Yiisoft\\EventDispatcher\\Provider\\Provider;\n" +"\n" +"$listeners = (new ListenerCollection())\n" +" ->add(static function (UserSignedUp $event): void {\n" +" // Enviar un correo de bienvenida.\n" +" });\n" +"\n" +"$provider = new Provider($listeners);\n" +"$dispatcher = new Dispatcher($provider);\n" +"\n" +"$dispatcher->dispatch(new UserSignedUp($form));\n" #. type: Plain text #: ../src/guide/concept/events.md #, no-wrap msgid "`ListenerCollection::add()` returns a new collection instance. Assign the result when building a collection step by step:\n" -msgstr "" +msgstr "`ListenerCollection::add()` devuelve una nueva instancia de la colección. Asigna el resultado cuando construyas una colección paso a paso:\n" #. type: Fenced code block (php) #: ../src/guide/concept/events.md @@ -423,3 +394,10 @@ msgid "" " UserSignedUp::class,\n" ");\n" msgstr "" +"$listeners = new ListenerCollection();\n" +"$listeners = $listeners->add(\n" +" static function (UserSignedUp $event): void {\n" +" // Enviar un correo de bienvenida.\n" +" },\n" +" UserSignedUp::class,\n" +");\n" diff --git a/_translations/po/es/guide_concept_immutability.md.po b/_translations/po/es/guide_concept_immutability.md.po index 3bd8b54e..8537e9f0 100644 --- a/_translations/po/es/guide_concept_immutability.md.po +++ b/_translations/po/es/guide_concept_immutability.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2025-12-24 08:02+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -21,18 +21,18 @@ msgstr "" #: ../src/en/internals/018-widgets.md #, no-wrap msgid "Immutability" -msgstr "" +msgstr "Inmutabilidad" #. type: Plain text #: ../src/en/guide/concept/immutability.md msgid "Immutability means an object's state cannot change after it has been created. Instead of modifying an instance, you create a new instance with the desired changes. This approach is common for value objects such as Money, IDs, and DTOs. It helps to avoid accidental side effects: methods cannot silently change shared state, which makes code easier to reason about." -msgstr "" +msgstr "La inmutabilidad significa que el estado de un objeto no puede cambiar después de crearlo. En lugar de modificar una instancia, creas una nueva instancia con los cambios deseados. Este enfoque es habitual en los objetos de valor, como Money, los identificadores y los DTO. Ayuda a evitar efectos secundarios accidentales: los métodos no pueden cambiar en silencio un estado compartido, lo que hace que el código sea más fácil de entender." #. type: Title ## #: ../src/en/guide/concept/immutability.md #, no-wrap msgid "Mutable pitfalls (what we avoid)" -msgstr "" +msgstr "Problemas de la mutabilidad (lo que evitamos)" #. type: Fenced code block (php) #: ../src/en/guide/concept/immutability.md @@ -48,17 +48,26 @@ msgid "" "$list = $base->orderBy(['created_at' => SORT_DESC])->all();\n" "// Oops: still limited to 1 because the previous limit(1) modified $base.\n" msgstr "" +"// Una consulta base compartida que se construye una vez y se reutiliza:\n" +"$base = Post::find()->where(['status' => Post::STATUS_PUBLISHED]);\n" +"\n" +"// En algún lugar profundo del código solo necesitamos un post:\n" +"$one = $base->limit(1)->one(); // modifica el query builder subyacente (¡el límite se queda pegado!)\n" +"\n" +"// Más tarde reutilizamos el mismo $base esperando una lista completa:\n" +"$list = $base->orderBy(['created_at' => SORT_DESC])->all();\n" +"// Vaya: sigue limitado a 1 porque el limit(1) anterior modificó $base.\n" #. type: Title ## #: ../src/en/guide/concept/immutability.md #, no-wrap msgid "Creating an immutable object in PHP" -msgstr "" +msgstr "Crear un objeto inmutable en PHP" #. type: Plain text #: ../src/en/guide/concept/immutability.md msgid "There is no direct way to modify an instance, but you can use clone to create a new instance with the desired changes. That is what `with*` methods do." -msgstr "" +msgstr "No hay una forma directa de modificar una instancia, pero puedes usar clone para crear una nueva instancia con los cambios deseados. Eso es lo que hacen los métodos `with*`." #. type: Fenced code block (php) #: ../src/en/guide/concept/immutability.md @@ -137,16 +146,88 @@ msgid "" "$discounted = $price->withAmount(800);\n" "// $price is still 1000 USD, $discounted is 800 USD\n" msgstr "" +"final class Money\n" +"{\n" +" public function __construct(\n" +" private int $amount,\n" +" private string $currency,\n" +" ) {\n" +" $this->validateAmount($amount);\n" +" $this->validateCurrency($currency);\n" +" }\n" +" \n" +" private function validateAmount(string $amount) \n" +" {\n" +" if ($amount < 0) {\n" +" throw new InvalidArgumentException('Amount must be positive.');\n" +" }\n" +" }\n" +" \n" +" private function validateCurrency(string $currency)\n" +" {\n" +" if (!in_array($currency, ['USD', 'EUR'])) {\n" +" throw new InvalidArgumentException('Invalid currency. Only USD and EUR are supported.');\n" +" }\n" +" } \n" +"\n" +" public function withAmount(int $amount): self\n" +" {\n" +" $this->validateAmount($amount);\n" +" \n" +" if ($amount === $this->amount) {\n" +" return $this;\n" +" }\n" +" \n" +" $clone = clone $this;\n" +" $clone->amount = $amount;\n" +" return $clone;\n" +" }\n" +" \n" +" public function withCurrency(string $currency): self\n" +" {\n" +" $this->validateCurrency($currency);\n" +" \n" +" if ($currency === $this->currency) {\n" +" return $this;\n" +" }\n" +" \n" +" $clone = clone $this;\n" +" $clone->currency = $currency;\n" +" return $clone;\n" +" }\n" +" \n" +" public function amount(): int \n" +" {\n" +" return $this->amount;\n" +" }\n" +" \n" +" public function currency(): string \n" +" {\n" +" return $this->currency;\n" +" }\n" +"\n" +" public function add(self $money): self\n" +" {\n" +" if ($money->currency !== $this->currency) {\n" +" throw new InvalidArgumentException('Currency mismatch. Cannot add money of different currency.');\n" +" }\n" +" return $this->withAmount($this->amount + $money->amount);\n" +" }\n" +"}\n" +"\n" +"$price = new Money(1000, 'USD');\n" +"$discounted = $price->withAmount(800);\n" +"// $price sigue siendo 1000 USD y $discounted es 800 USD\n" #. type: Bullet: '- ' #: ../src/en/guide/concept/immutability.md msgid "We mark the class `final` to prevent subclass mutations; alternatively, design for extension carefully." -msgstr "" +msgstr "Marcamos la clase como `final` para evitar mutaciones en subclases; otra opción es diseñarla con cuidado para que se pueda extender." #. type: Bullet: '- ' #: ../src/en/guide/concept/immutability.md msgid "Validate in the constructor and `with*` methods so every instance is always valid." -msgstr "" +msgstr "Valida en el constructor y en los métodos `with*` para que todas las instancias sean siempre válidas." #. type: Plain text #: ../src/en/guide/concept/immutability.md @@ -156,22 +237,25 @@ msgid "" "> If you define a simple DTO, you can use modern PHP `readonly` and leave properties `public`. The `readonly` keyword\n" "> would ensure that the properties cannot be modified after the object is created.\n" msgstr "" +"> [!TIP]\n" +"> Si defines un DTO sencillo, puedes usar `readonly` del PHP moderno y dejar las propiedades como `public`. La palabra clave `readonly`\n" +"> garantiza que las propiedades no se puedan modificar después de crear el objeto.\n" #. type: Title ## #: ../src/en/guide/concept/immutability.md #, no-wrap msgid "Using clone (and why it is inexpensive)" -msgstr "" +msgstr "Usar clone (y por qué es barato)" #. type: Plain text #: ../src/en/guide/concept/immutability.md msgid "PHP's clone performs a shallow copy of the object. For immutable value objects that contain only scalars or other immutable objects, shallow cloning is enough and fast. In modern PHP, cloning small value objects is inexpensive in both time and memory." -msgstr "" +msgstr "El clone de PHP hace una copia superficial del objeto. En los objetos de valor inmutables que solo contienen escalares u otros objetos inmutables, la clonación superficial es suficiente y rápida. En el PHP moderno, clonar objetos de valor pequeños es barato tanto en tiempo como en memoria." #. type: Plain text #: ../src/en/guide/concept/immutability.md msgid "If your object holds mutable sub-objects that must also be copied, implement `__clone` to deep-clone them:" -msgstr "" +msgstr "Si tu objeto contiene subobjetos mutables que también hay que copiar, implementa `__clone` para clonarlos en profundidad:" #. type: Fenced code block (php) #: ../src/en/guide/concept/immutability.md @@ -202,24 +286,48 @@ msgid "" " }\n" "}\n" msgstr "" +"final class Order\n" +"{\n" +" public function __construct(\n" +" private Money $total\n" +" ) {}\n" +" \n" +" public function total(): Money \n" +" {\n" +" return $this->total;\n" +" }\n" +"\n" +" public function __clone(): void\n" +" {\n" +" // En nuestro ejemplo, Money es inmutable, así que no hace falta una clonación profunda.\n" +" // Si fuera mutable, podrías hacer: $this->total = clone $this->total;\n" +" }\n" +"\n" +" public function withTotal(Money $total): self\n" +" {\n" +" $clone = clone $this;\n" +" $clone->total = $total;\n" +" return $clone;\n" +" }\n" +"}\n" #. type: Title ## #: ../src/en/guide/concept/immutability.md #, no-wrap msgid "Usage style" -msgstr "" +msgstr "Estilo de uso" #. type: Bullet: '- ' #: ../src/en/guide/concept/immutability.md msgid "Build a value object once and pass it around. If you need a change, use a `with*` method that returns a new instance." -msgstr "" +msgstr "Construye un objeto de valor una vez y pásalo de un lado a otro. Si necesitas un cambio, usa un método `with*` que devuelva una nueva instancia." #. type: Bullet: '- ' #: ../src/en/guide/concept/immutability.md msgid "Prefer scalar/immutable fields inside immutable objects; if a field can mutate, isolate it and deep-clone in `__clone` when needed." -msgstr "" +msgstr "Usa preferentemente campos escalares o inmutables dentro de los objetos inmutables; si un campo puede mutar, aíslalo y clónalo en profundidad en `__clone` cuando haga falta." #. type: Plain text #: ../src/en/guide/concept/immutability.md msgid "Immutability aligns well with Yii's preference for predictable, side-effect-free code and makes services, caching, and configuration more robust." -msgstr "" +msgstr "La inmutabilidad encaja bien con la preferencia de Yii por un código predecible y sin efectos secundarios, y hace que los servicios, la caché y la configuración sean más robustos." diff --git a/_translations/po/es/guide_glossary.md.po b/_translations/po/es/guide_glossary.md.po index bf63cdbb..b3744d12 100644 --- a/_translations/po/es/guide_glossary.md.po +++ b/_translations/po/es/guide_glossary.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-05-30 06:43+0000\n" -"PO-Revision-Date: 2025-09-11 10:15+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,536 +20,529 @@ msgstr "" #: ../src/guide/glossary.md #, no-wrap msgid "A" -msgstr "" +msgstr "A" #. type: Title ## #: ../src/guide/glossary.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "action" -msgstr "Introducción" +msgstr "acción (action)" #. type: Plain text #: ../src/guide/glossary.md msgid "Action is a callable, class, or class method that handles a matched route and returns a response. Read more in [\"Actions\"](structure/action.md)." -msgstr "" +msgstr "Una acción es un callable, una clase o un método de clase que gestiona una ruta coincidente y devuelve una respuesta. Más información en [\"Acciones\"](structure/action.md)." #. type: Title ## #: ../src/guide/glossary.md -#, fuzzy, no-wrap -#| msgid "Aliases" +#, no-wrap msgid "alias" -msgstr "Alias" +msgstr "alias" #. type: Plain text #: ../src/guide/glossary.md msgid "Alias is a string used by Yii to refer to the class or directory such as `@app/vendor`. Read more in [\"Aliases\"](concept/aliases.md)." -msgstr "" +msgstr "Un alias es una cadena que Yii usa para referirse a una clase o a un directorio, como `@app/vendor`. Más información en [\"Alias\"](concept/aliases.md)." #. type: Title ## #: ../src/guide/glossary.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "application" -msgstr "Introducción" +msgstr "aplicación (application)" #. type: Plain text #: ../src/guide/glossary.md msgid "Application is an object that starts up, handles a request through configured middleware, and shuts down. Read more in [\"Application\"](structure/application.md)." -msgstr "" +msgstr "La aplicación es un objeto que se inicia, gestiona una solicitud a través de los middlewares configurados y finaliza. Más información en [\"Aplicación\"](structure/application.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "asset" -msgstr "" +msgstr "asset" #. type: Plain text #: ../src/guide/glossary.md msgid "Asset refers to a resource file. Typically, it contains JavaScript or CSS code but can be any static content accessed via HTTP. Read more in [\"Assets\"](views/asset.md)." -msgstr "" +msgstr "Un asset es un archivo de recursos. Normalmente contiene código JavaScript o CSS, pero puede ser cualquier contenido estático al que se accede por HTTP. Más información en [\"Assets\"](views/asset.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "asset bundle" -msgstr "" +msgstr "asset bundle (paquete de assets)" #. type: Plain text #: ../src/guide/glossary.md msgid "Asset bundle is a PHP class that declares a group of CSS, JavaScript, image, or font files that should be published and registered together. Read more in [\"Asset Bundles\"](views/asset.md#asset-bundles)." -msgstr "" +msgstr "Un paquete de assets es una clase PHP que declara un grupo de archivos CSS, JavaScript, imágenes o fuentes que deben publicarse y registrarse juntos. Más información en [\"Paquetes de assets\"](views/asset.md#asset-bundles)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "authentication" -msgstr "" +msgstr "autenticación (authentication)" #. type: Plain text #: ../src/guide/glossary.md msgid "Authentication is the process of determining the identity of the current user. Read more in [\"Authentication\"](security/authentication.md)." -msgstr "" +msgstr "La autenticación es el proceso de determinar la identidad del usuario actual. Más información en [\"Autenticación\"](security/authentication.md)." #. type: Title ## #: ../src/guide/glossary.md -#, fuzzy, no-wrap +#, no-wrap msgid "authorization" -msgstr "Introducción" +msgstr "autorización (authorization)" #. type: Plain text #: ../src/guide/glossary.md msgid "Authorization is the process of checking whether an authenticated or anonymous user is allowed to perform an action. Read more in [\"Authorization\"](security/authorization.md)." -msgstr "" +msgstr "La autorización es el proceso de comprobar si un usuario autenticado o anónimo tiene permiso para realizar una acción. Más información en [\"Autorización\"](security/authorization.md)." #. type: Title ## #: ../src/guide/glossary.md -#, fuzzy, no-wrap -#| msgid "Class autoloading" +#, no-wrap msgid "autoloading" -msgstr "Autocarga de Clases (Autoloading)" +msgstr "autocarga (autoloading)" #. type: Plain text #: ../src/guide/glossary.md msgid "Autoloading is the process of loading PHP classes automatically when they are first used. Read more in [\"Class autoloading\"](concept/autoloading.md)." -msgstr "" +msgstr "La autocarga es el proceso de cargar las clases PHP automáticamente la primera vez que se usan. Más información en [\"Autocarga de clases\"](concept/autoloading.md)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "bootstrap" -msgstr "" +msgstr "bootstrap (arranque)" #. type: Plain text #: ../src/guide/glossary.md msgid "Bootstrap is application startup code that prepares services, configuration, and runtime state before request handling. Read more in [\"Configuration\"](concept/configuration.md)." -msgstr "" +msgstr "El arranque (bootstrap) es el código de inicio de la aplicación que prepara los servicios, la configuración y el estado de ejecución antes de gestionar las solicitudes. Más información en [\"Configuración\"](concept/configuration.md)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "C" -msgstr "" +msgstr "C" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "configuration" -msgstr "" +msgstr "configuración (configuration)" #. type: Plain text #: ../src/guide/glossary.md msgid "Configuration may refer either to the process of setting properties of an object or to a configuration file that stores settings for an object, or a class of objects. Read more in [\"Configuration\"](concept/configuration.md)." -msgstr "" +msgstr "La configuración puede referirse al proceso de establecer las propiedades de un objeto o a un archivo de configuración que guarda los ajustes de un objeto o de una clase de objetos. Más información en [\"Configuración\"](concept/configuration.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "container" -msgstr "" +msgstr "contenedor (container)" #. type: Plain text #: ../src/guide/glossary.md msgid "Container is an object that creates services, resolves their dependencies, and returns configured instances. Read more in [\"DI container\"](concept/di-container.md#di-container)." -msgstr "" +msgstr "El contenedor es un objeto que crea servicios, resuelve sus dependencias y devuelve instancias configuradas. Más información en [\"Contenedor DI\"](concept/di-container.md#contenedor-di)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "controller" -msgstr "" +msgstr "controlador (controller)" #. type: Plain text #: ../src/guide/glossary.md msgid "Controller is a class that groups action methods for related routes. Read more in [\"Actions\"](structure/action.md)." -msgstr "" +msgstr "Un controlador es una clase que agrupa los métodos de acción de rutas relacionadas. Más información en [\"Acciones\"](structure/action.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "cookie" -msgstr "" +msgstr "cookie" #. type: Plain text #: ../src/guide/glossary.md msgid "Cookie is a small piece of data stored by a browser and sent with later requests to the same site. Read more in [\"Cookies\"](runtime/cookies.md)." -msgstr "" +msgstr "Una cookie es un pequeño fragmento de datos que el navegador guarda y envía en las solicitudes posteriores al mismo sitio. Más información en [\"Cookies\"](runtime/cookies.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "CSRF" -msgstr "" +msgstr "CSRF" #. type: Plain text #: ../src/guide/glossary.md msgid "CSRF means cross-site request forgery, an attack where another site tries to make a user's browser submit an unwanted request to your application. Read more in [\"Avoiding CSRF\"](security/best-practices.md#avoiding-csrf)." -msgstr "" +msgstr "CSRF significa falsificación de solicitudes entre sitios (cross-site request forgery), un ataque en el que otro sitio intenta que el navegador de un usuario envíe una solicitud no deseada a tu aplicación. Más información en [\"Evitar CSRF\"](security/best-practices.md#avoiding-csrf)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "D" -msgstr "" +msgstr "D" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "DI" -msgstr "" +msgstr "DI" #. type: Plain text #: ../src/guide/glossary.md msgid "Dependency injection is a programming technique where an object receives its dependencies from the outside. Read more in [\"Dependency injection and container\"](concept/di-container.md)." -msgstr "" +msgstr "La inyección de dependencias (DI, dependency injection) es una técnica de programación en la que un objeto recibe sus dependencias desde fuera. Más información en [\"Inyección de dependencias y contenedor\"](concept/di-container.md)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "E" -msgstr "" +msgstr "E" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "entry script" -msgstr "" +msgstr "entry script (script de entrada)" #. type: Plain text #: ../src/guide/glossary.md msgid "Entry script is the first PHP script executed for a web or console application. Read more in [\"Entry scripts\"](structure/entry-script.md)." -msgstr "" +msgstr "El script de entrada es el primer script PHP que se ejecuta en una aplicación web o de consola. Más información en [\"Scripts de entrada\"](structure/entry-script.md)." #. type: Title ## #: ../src/guide/glossary.md -#, fuzzy, no-wrap -#| msgid "Events" +#, no-wrap msgid "event" -msgstr "Eventos" +msgstr "evento (event)" #. type: Plain text #: ../src/guide/glossary.md msgid "Event is an object that represents something that happened and can be passed to listeners. Read more in [\"Events\"](concept/events.md)." -msgstr "" +msgstr "Un evento es un objeto que representa algo que ha ocurrido y que se puede pasar a los listeners. Más información en [\"Eventos\"](concept/events.md)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "H" -msgstr "" +msgstr "H" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "handler" -msgstr "" +msgstr "handler (manejador)" #. type: Plain text #: ../src/guide/glossary.md msgid "Handler is callable code selected by routing or middleware to process a request and produce a response. Read more in [\"Routing and URL generation\"](runtime/routing.md)." -msgstr "" +msgstr "Un manejador es código callable que el enrutamiento o un middleware selecciona para procesar una solicitud y producir una respuesta. Más información en [\"Enrutamiento y generación de URL\"](runtime/routing.md)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "I" -msgstr "" +msgstr "I" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "installation" -msgstr "" +msgstr "instalación (installation)" #. type: Plain text #: ../src/guide/glossary.md msgid "Installation is a process of preparing something to work either by following a readme file or by executing a specially prepared script. In the case of Yii, it's setting permissions and fulfilling software requirements." -msgstr "" +msgstr "La instalación es el proceso de preparar algo para que funcione, ya sea siguiendo un archivo readme o ejecutando un script preparado para ello. En el caso de Yii, consiste en establecer los permisos y cumplir los requisitos de software." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "L" -msgstr "" +msgstr "L" #. type: Title ## #: ../src/guide/glossary.md -#, fuzzy, no-wrap -#| msgid "Generating API documentation" +#, no-wrap msgid "layout" -msgstr "Generación de Documentación de API" +msgstr "layout" #. type: Plain text #: ../src/guide/glossary.md msgid "Layout is a view template that wraps page-specific content with shared page structure. Read more in [\"Working with layouts\"](views/view.md#working-with-layouts)." -msgstr "" +msgstr "Un layout es una plantilla de vista que envuelve el contenido propio de cada página con la estructura común de la página. Más información en [\"Trabajar con layouts\"](views/view.md#working-with-layouts)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "M" -msgstr "" +msgstr "M" #. type: Title ## #: ../src/guide/glossary.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "migration" -msgstr "Introducción" +msgstr "migración (migration)" #. type: Plain text #: ../src/guide/glossary.md msgid "Migration is a versioned PHP class that applies or reverts a database schema or data change. Read more in [\"Migrations\"](databases/db-migrations.md)." -msgstr "" +msgstr "Una migración es una clase PHP versionada que aplica o revierte un cambio en el esquema o en los datos de la base de datos. Más información en [\"Migraciones\"](databases/db-migrations.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "middleware" -msgstr "" +msgstr "middleware" #. type: Plain text #: ../src/guide/glossary.md msgid "Middleware is a processor in the request processing stack. Given a request, it may either produce a response or do some action and pass processing to the next middleware. Read more in [\"Middleware\"](structure/middleware.md)." -msgstr "" +msgstr "Un middleware es un procesador de la pila de procesamiento de solicitudes. Dada una solicitud, puede producir una respuesta o realizar alguna acción y pasar el procesamiento al siguiente middleware. Más información en [\"Middleware\"](structure/middleware.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "model" -msgstr "" +msgstr "modelo (model)" #. type: Plain text #: ../src/guide/glossary.md msgid "Model is an object that represents application data and usually contains validation or business rules for that data. Read more in [\"Working with forms\"](start/forms.md)." -msgstr "" +msgstr "Un modelo es un objeto que representa datos de la aplicación y que suele contener reglas de validación o de negocio para esos datos. Más información en [\"Trabajar con formularios\"](start/forms.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "module" -msgstr "" +msgstr "módulo (module)" #. type: Plain text #: ../src/guide/glossary.md msgid "The module is a namespace that groups some code based on a use-case. It's typically used within the main application and may contain any source code, define additional URL handlers or console commands." -msgstr "" +msgstr "Un módulo es un espacio de nombres que agrupa código según un caso de uso. Normalmente se usa dentro de la aplicación principal y puede contener cualquier código fuente, definir manejadores de URL adicionales o comandos de consola." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "N" -msgstr "" +msgstr "N" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "namespace" -msgstr "" +msgstr "namespace (espacio de nombres)" #. type: Plain text #: ../src/guide/glossary.md msgid "Namespace refers to a [PHP language feature](https://www.php.net/manual/en/language.namespaces.php) to group multiple classes under a certain name." -msgstr "" +msgstr "Un espacio de nombres es una [funcionalidad del lenguaje PHP](https://www.php.net/manual/en/language.namespaces.php) que permite agrupar varias clases bajo un nombre determinado." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "P" -msgstr "" +msgstr "P" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "package" -msgstr "" +msgstr "paquete (package)" #. type: Plain text #: ../src/guide/glossary.md msgid "A package usually refers to [Composer package](https://getcomposer.org/doc/). It's code ready for reuse and redistribution installable automatically via a package manager." -msgstr "" +msgstr "Un paquete suele referirse a un [paquete de Composer](https://getcomposer.org/doc/). Es código listo para reutilizarse y redistribuirse que se puede instalar automáticamente con un gestor de paquetes." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "parameter" -msgstr "" +msgstr "parámetro (parameter)" #. type: Plain text #: ../src/guide/glossary.md msgid "Parameter is a configuration value that can be used by application or package config files. Read more in [\"Parameters\"](concept/configuration.md#parameters)." -msgstr "" +msgstr "Un parámetro es un valor de configuración que pueden usar los archivos de configuración de la aplicación o de los paquetes. Más información en [\"Parámetros\"](concept/configuration.md#parametros)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "Q" -msgstr "" +msgstr "Q" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "queue" -msgstr "" +msgstr "queue (cola)" #. type: Plain text #: ../src/guide/glossary.md msgid "A queue is a data structure that processes items in first-in, first-out order. Yii has a [yiisoft/queue](https://github.com/yiisoft/queue) package." -msgstr "" +msgstr "Una cola es una estructura de datos que procesa los elementos en orden de llegada (el primero en entrar es el primero en salir). Yii tiene el paquete [yiisoft/queue](https://github.com/yiisoft/queue)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "R" -msgstr "" +msgstr "R" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "request" -msgstr "" +msgstr "request (solicitud)" #. type: Plain text #: ../src/guide/glossary.md msgid "Request is a PSR-7 object that represents an incoming HTTP message, including method, URI, headers, body, uploaded files, and attributes. Read more in [\"Request\"](runtime/request.md)." -msgstr "" +msgstr "La solicitud es un objeto PSR-7 que representa un mensaje HTTP entrante, con su método, URI, cabeceras, cuerpo, archivos subidos y atributos. Más información en [\"Solicitud\"](runtime/request.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "response" -msgstr "" +msgstr "response (respuesta)" #. type: Plain text #: ../src/guide/glossary.md msgid "Response is a PSR-7 object that represents an outgoing HTTP message, including status code, headers, and body. Read more in [\"Response\"](runtime/response.md)." -msgstr "" +msgstr "La respuesta es un objeto PSR-7 que representa un mensaje HTTP saliente, con su código de estado, cabeceras y cuerpo. Más información en [\"Respuesta\"](runtime/response.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "route" -msgstr "" +msgstr "ruta (route)" #. type: Plain text #: ../src/guide/glossary.md msgid "Route describes which request method and URL pattern should be handled by which action or middleware. Read more in [\"Routing and URL generation\"](runtime/routing.md)." -msgstr "" +msgstr "Una ruta describe qué método de solicitud y qué patrón de URL debe gestionar cada acción o middleware. Más información en [\"Enrutamiento y generación de URL\"](runtime/routing.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "rule" -msgstr "" +msgstr "regla (rule)" #. type: Plain text #: ../src/guide/glossary.md msgid "The rule usually refers to a validation rule of the [yiisoft/validator](https://github.com/yiisoft/validator) package. It holds a set of parameters for checking if a data set is valid. \"Rule handler\" does the actual processing." -msgstr "" +msgstr "Una regla suele referirse a una regla de validación del paquete [yiisoft/validator](https://github.com/yiisoft/validator). Contiene un conjunto de parámetros para comprobar si un conjunto de datos es válido. El procesamiento real lo hace el \"manejador de la regla\" (rule handler)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "S" -msgstr "" +msgstr "S" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "service" -msgstr "" +msgstr "servicio (service)" #. type: Plain text #: ../src/guide/glossary.md msgid "Service is a focused object that performs application work or provides infrastructure behavior and is usually stored in the DI container. Read more in [\"Service components\"](../cookbook/organizing-code/service.md)." -msgstr "" +msgstr "Un servicio es un objeto con un propósito concreto que realiza trabajo de la aplicación o aporta comportamiento de infraestructura, y que normalmente se guarda en el contenedor DI. Más información en [\"Componentes de servicio\"](../cookbook/organizing-code/service.md)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "service provider" -msgstr "" +msgstr "service provider (proveedor de servicios)" #. type: Plain text #: ../src/guide/glossary.md msgid "Service provider is a class that registers related service definitions for the DI container. Read more in [\"Service providers\"](concept/configuration.md#service-providers)." -msgstr "" +msgstr "Un proveedor de servicios es una clase que registra definiciones de servicios relacionados en el contenedor DI. Más información en [\"Proveedores de servicios\"](concept/configuration.md#proveedores-de-servicios)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "session" -msgstr "" +msgstr "sesión (session)" #. type: Plain text #: ../src/guide/glossary.md msgid "Session is server-side storage associated with a browser across multiple requests. Read more in [\"Sessions\"](runtime/sessions.md)." -msgstr "" +msgstr "La sesión es un almacenamiento en el servidor asociado a un navegador a lo largo de varias solicitudes. Más información en [\"Sesiones\"](runtime/sessions.md)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "T" -msgstr "" +msgstr "T" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "template" -msgstr "" +msgstr "template (plantilla)" #. type: Plain text #: ../src/guide/glossary.md msgid "Template is a file used by a view or template engine to produce presentation output such as HTML. Read more in [\"Views\"](views/view.md)." -msgstr "" +msgstr "Una plantilla es un archivo que usa una vista o un motor de plantillas para generar la salida de presentación, como HTML. Más información en [\"Vistas\"](views/view.md)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "V" -msgstr "" +msgstr "V" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "vendor" -msgstr "" +msgstr "vendor" #. type: Plain text #: ../src/guide/glossary.md msgid "A vendor is an organization or individual developer providing code in the form of packages. It also may refer to [Composer's `vendor` directory](https://getcomposer.org/doc/)." -msgstr "" +msgstr "Un vendor es una organización o un desarrollador individual que proporciona código en forma de paquetes. También puede referirse al [directorio `vendor` de Composer](https://getcomposer.org/doc/)." #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "view" -msgstr "" +msgstr "vista (view)" #. type: Plain text #: ../src/guide/glossary.md msgid "View is responsible for presenting data to end users, usually by executing a template with provided data. Read more in [\"Views\"](views/view.md)." -msgstr "" +msgstr "La vista se encarga de presentar los datos a los usuarios finales, normalmente ejecutando una plantilla con los datos proporcionados. Más información en [\"Vistas\"](views/view.md)." #. type: Title # #: ../src/guide/glossary.md #, no-wrap msgid "W" -msgstr "" +msgstr "W" #. type: Title ## #: ../src/guide/glossary.md #, no-wrap msgid "widget" -msgstr "" +msgstr "widget" #. type: Plain text #: ../src/guide/glossary.md msgid "Widget is a reusable view component that renders a piece of user interface. Read more in [\"Widgets\"](views/widget.md)." -msgstr "" +msgstr "Un widget es un componente de vista reutilizable que renderiza una parte de la interfaz de usuario. Más información en [\"Widgets\"](views/widget.md)." diff --git a/_translations/po/es/guide_index.md.po b/_translations/po/es/guide_index.md.po index 4ec1ec51..35288e40 100644 --- a/_translations/po/es/guide_index.md.po +++ b/_translations/po/es/guide_index.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-10-11 10:37+0000\n" -"PO-Revision-Date: 2025-12-24 08:23+0000\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,668 +20,614 @@ msgstr "" #: ../src/cookbook/making-http-requests.md ../src/guide/index.md #: ../src/guide/intro/upgrade-from-v2.md ../src/guide/testing/overview.md #: ../src/guide/tutorial/docker.md -#, fuzzy, no-wrap +#, no-wrap msgid "Testing" -msgstr "Pruebas (Testing)" +msgstr "Pruebas" #. type: Title ## #: ../src/guide/caching/overview.md ../src/guide/index.md #, no-wrap msgid "Caching" -msgstr "" +msgstr "Caché" #. type: Title # #: ../src/guide/index.md -#, fuzzy, no-wrap -#| msgid "The definitive guide to Yii 3.0" +#, no-wrap msgid "The definitive guide to Yii3" -msgstr "La Guía Definitiva de Yii 3.0" +msgstr "La guía definitiva de Yii3" #. type: Plain text #: ../src/guide/index.md msgid "We release this guide under the [Terms of Yii Documentation](https://www.yiiframework.com/license#docs)." -msgstr "" +msgstr "Publicamos esta guía según los [Términos de la documentación de Yii](https://www.yiiframework.com/license#docs)." #. type: Title ## #: ../src/guide/index.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Introduction" msgstr "Introducción" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[About Yii](intro/what-is-yii.md)" -msgstr "" +msgstr "[Acerca de Yii](intro/what-is-yii.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Upgrading from version 1.1](intro/upgrade-from-v1.md)" -msgstr "" +msgstr "[Actualizar desde la versión 1.1](intro/upgrade-from-v1.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Upgrading from version 2.0](intro/upgrade-from-v2.md)" -msgstr "" +msgstr "[Actualizar desde la versión 2.0](intro/upgrade-from-v2.md)" #. type: Title ## #: ../src/guide/index.md ../src/guide/tutorial/console-applications.md #, no-wrap msgid "Getting started" -msgstr "" +msgstr "Primeros pasos" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[What do you need to know?](start/prerequisites.md)" -msgstr "" +msgstr "[¿Qué necesitas saber?](start/prerequisites.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Creating a project](start/creating-project.md)" -msgstr "" +msgstr "[Crear un proyecto](start/creating-project.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Application structure overview](structure/overview.md) +" msgid "[Application Workflow](start/workflow.md)" -msgstr "[Información General de Estructura de Una Aplicación](structure/overview.md)" +msgstr "[Flujo de trabajo de la aplicación](start/workflow.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Saying hello](start/hello.md)" -msgstr "" +msgstr "[Decir hola](start/hello.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Working with forms](start/forms.md)" -msgstr "" +msgstr "[Trabajar con formularios](start/forms.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Working with databases](start/databases.md)" -msgstr "" +msgstr "[Trabajar con bases de datos](start/databases.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Generating code with Gii](start/gii.md) TODO" -msgstr "" +msgstr "[Generar código con Gii](start/gii.md) TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Looking ahead](start/looking-ahead.md)" -msgstr "" +msgstr "[Próximos pasos](start/looking-ahead.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Demo applications](start/demo-apps.md)" -msgstr "" +msgstr "[Aplicaciones de demostración](start/demo-apps.md)" #. type: Title ## #: ../src/guide/index.md -#, fuzzy, no-wrap +#, no-wrap msgid "Key concepts" -msgstr "Conceptos Clave" +msgstr "Conceptos clave" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Aliases](concept/aliases.md)" -msgstr "" +msgstr "[Alias](concept/aliases.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Autoloading](concept/autoloading.md)" -msgstr "" +msgstr "[Autocarga](concept/autoloading.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Configuration](concept/configuration.md)" -msgstr "" +msgstr "[Configuración](concept/configuration.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Dependency injection container](concept/di-container.md) +" msgid "[Dependency injection container](concept/di-container.md)" -msgstr "[Contenedor de Inyección de Dependencia](concept/di-container.md)" +msgstr "[Contenedor de inyección de dependencias](concept/di-container.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Events](concept/events.md)" -msgstr "" +msgstr "[Eventos](concept/events.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Immutability](concept/immutability.md)" -msgstr "" +msgstr "[Inmutabilidad](concept/immutability.md)" #. type: Title ## #: ../src/guide/index.md ../src/guide/start/workflow.md #, no-wrap msgid "Application structure" -msgstr "" +msgstr "Estructura de la aplicación" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Application structure overview](structure/overview.md) +" msgid "[Application structure overview](structure/overview.md)" -msgstr "[Información General de Estructura de Una Aplicación](structure/overview.md)" +msgstr "[Resumen de la estructura de la aplicación](structure/overview.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Entry scripts](structure/entry-script.md)" -msgstr "" +msgstr "[Scripts de entrada](structure/entry-script.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Application](structure/application.md)" -msgstr "" +msgstr "[Aplicación](structure/application.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Actions](structure/action.md) +" msgid "[Modules](structure/module.md)" -msgstr "[Acciones](structure/action.md)" +msgstr "[Módulos](structure/module.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Actions](structure/action.md) +" msgid "[Actions](structure/action.md)" msgstr "[Acciones](structure/action.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Middleware](structure/middleware.md)" -msgstr "" +msgstr "[Middleware](structure/middleware.md)" #. type: Title ## #: ../src/guide/index.md #, no-wrap msgid "Packages" -msgstr "" +msgstr "Paquetes" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Actions](structure/action.md) +" msgid "[Using packages](structure/package.md)" -msgstr "[Acciones](structure/action.md)" +msgstr "[Usar paquetes](structure/package.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Designing packages](structure/designing-packages.md)" -msgstr "" +msgstr "[Diseñar paquetes](structure/designing-packages.md)" #. type: Title ## #: ../src/guide/index.md -#, fuzzy, no-wrap -#| msgid "Handling requests +" +#, no-wrap msgid "Handling requests" -msgstr "Gestión de las Peticiones" +msgstr "Manejo de solicitudes" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Routing and URL generation](runtime/routing.md)" -msgstr "" +msgstr "[Enrutamiento y generación de URL](runtime/routing.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Request](runtime/request.md)" -msgstr "" +msgstr "[Solicitud](runtime/request.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Response](runtime/response.md)" -msgstr "" +msgstr "[Respuesta](runtime/response.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Sessions](runtime/sessions.md)" -msgstr "" +msgstr "[Sesiones](runtime/sessions.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Cookies](runtime/cookies.md)" -msgstr "" +msgstr "[Cookies](runtime/cookies.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Handling errors](runtime/handling-errors.md)" -msgstr "" +msgstr "[Manejo de errores](runtime/handling-errors.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Logging](runtime/logging.md) +" msgid "[Logging](runtime/logging.md)" -msgstr "[Registros (logs)](runtime/logging.md)" +msgstr "[Registro](runtime/logging.md)" #. type: Title # #: ../src/guide/index.md ../src/guide/security/overview.md #, no-wrap msgid "Security" -msgstr "" +msgstr "Seguridad" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Security overview](security/overview.md)" -msgstr "" +msgstr "[Resumen de seguridad](security/overview.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Authentication](security/authentication.md) +" msgid "[Authentication](security/authentication.md)" msgstr "[Autenticación](security/authentication.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Authorization](security/authorization.md) TODO: verify and complete!" -msgstr "" +msgstr "[Autorización](security/authorization.md) TODO: verify and complete!" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Working with passwords](security/passwords.md)" -msgstr "" +msgstr "[Trabajar con contraseñas](security/passwords.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Cryptography](security/cryptography.md)" -msgstr "" +msgstr "[Criptografía](security/cryptography.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Best practices](security/best-practices.md) +" msgid "[Trusted request](security/trusted-request.md)" -msgstr "[Buenas Prácticas](security/best-practices.md)" +msgstr "[Solicitud de confianza](security/trusted-request.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Best practices](security/best-practices.md) +" msgid "[Best practices](security/best-practices.md)" -msgstr "[Buenas Prácticas](security/best-practices.md)" +msgstr "[Buenas prácticas](security/best-practices.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Caching overview](caching/overview.md)" -msgstr "" +msgstr "[Resumen de la caché](caching/overview.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Data caching](caching/data.md)" -msgstr "" +msgstr "[Caché de datos](caching/data.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Fragment caching TODO" -msgstr "" +msgstr "Caché de fragmentos TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Page caching TODO" -msgstr "" +msgstr "Caché de páginas TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "HTTP caching TODO" -msgstr "" +msgstr "Caché HTTP TODO" #. type: Title # #: ../src/guide/index.md ../src/guide/start/databases.md #, no-wrap msgid "Working with databases" -msgstr "" +msgstr "Trabajar con bases de datos" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[Yii DB](https://github.com/yiisoft/db/blob/master/docs/guide/en/README.md)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[Yii DB](https://github.com/yiisoft/db/blob/master/docs/guide/en/README.md)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[Active Record](https://github.com/yiisoft/active-record/blob/master/README.md)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[Active Record](https://github.com/yiisoft/active-record/blob/master/README.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Migrations](databases/db-migrations.md) TODO: verify/update!" -msgstr "" +msgstr "[Migraciones](databases/db-migrations.md) TODO: verify/update!" #. type: Title # #: ../src/guide/index.md ../src/guide/views/view.md -#, fuzzy, no-wrap +#, no-wrap msgid "Views" msgstr "Vistas" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[View](views/view.md)" -msgstr "" +msgstr "[Vista](views/view.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Assets](views/asset.md) TODO: verify!" -msgstr "" +msgstr "[Assets](views/asset.md) TODO: verify!" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Assets](views/asset.md) -" msgid "[Scripts, styles and metatags](views/script-style-meta.md) TODO: verify!" -msgstr "[Assets](views/asset.md)" +msgstr "[Scripts, estilos y metaetiquetas](views/script-style-meta.md) TODO: verify!" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Template engines](views/template-engines.md) TODO: verify!" -msgstr "" +msgstr "[Motores de plantillas](views/template-engines.md) TODO: verify!" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Views](views/view.md) -" msgid "[View injections](views/view-injections.md)" -msgstr "[Vistas](views/view.md)" +msgstr "[Inyecciones de vista](views/view-injections.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Widgets](views/widget.md) TODO: verify!" -msgstr "" +msgstr "[Widgets](views/widget.md) TODO: verify!" #. type: Title ## #: ../src/guide/index.md #, no-wrap msgid "Getting data from users" -msgstr "" +msgstr "Obtener datos de los usuarios" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Creating forms TODO" -msgstr "" +msgstr "Crear formularios TODO" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Application structure overview](structure/overview.md) +" msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" -msgstr "[Información General de Estructura de Una Aplicación](structure/overview.md)" +msgstr "[Validar la entrada](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Uploading files TODO" -msgstr "" +msgstr "Subir archivos TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Collecting tabular input TODO" -msgstr "" +msgstr "Recoger entradas tabulares TODO" #. type: Title ## #: ../src/guide/index.md #, no-wrap msgid "Displaying data" -msgstr "" +msgstr "Mostrar datos" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Data formatting TODO" -msgstr "" +msgstr "Formato de datos TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Pagination TODO" -msgstr "" +msgstr "Paginación TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Sorting TODO" -msgstr "" +msgstr "Ordenación TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Data providers TODO" -msgstr "" +msgstr "Proveedores de datos TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Data widgets TODO" -msgstr "" +msgstr "Widgets de datos TODO" #. type: Title ## #: ../src/guide/index.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "REST APIs" -msgstr "" +msgstr "API REST" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Quick start](rest/quick-start.md)" -msgstr "" +msgstr "[Inicio rápido](rest/quick-start.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Resources TODO" -msgstr "" +msgstr "Recursos TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Controllers TODO" -msgstr "" +msgstr "Controladores TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Routing TODO" -msgstr "" +msgstr "Enrutamiento TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Authentication TODO" -msgstr "" +msgstr "Autenticación TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Rate limiting TODO" -msgstr "" +msgstr "Limitación de solicitudes TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Versioning TODO" -msgstr "" +msgstr "Versionado TODO" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Error handling TODO" -msgstr "" +msgstr "Manejo de errores TODO" #. type: Title ## #: ../src/guide/index.md -#, fuzzy, no-wrap -#| msgid "Development tools -" +#, no-wrap msgid "Development tools" -msgstr "Herramientas de Desarrollo" +msgstr "Herramientas de desarrollo" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "Debug toolbar and debugger" msgid "Debug toolbar and debugger" -msgstr "Depurador y Barra de Herramientas de Depuración" +msgstr "Barra de depuración y depurador" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "Generating code using Gii" -msgstr "" +msgstr "Generar código con Gii" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "Generating API documentation" msgid "Generating API documentation" -msgstr "Generación de Documentación de API" +msgstr "Generar documentación de la API" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Application structure overview](structure/overview.md) +" msgid "[Testing overview](testing/overview.md)" -msgstr "[Información General de Estructura de Una Aplicación](structure/overview.md)" +msgstr "[Resumen de las pruebas](testing/overview.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Testing environment setup](testing/environment-setup.md)" -msgstr "" +msgstr "[Configuración del entorno de pruebas](testing/environment-setup.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Unit tests](testing/unit.md)" -msgstr "" +msgstr "[Pruebas unitarias](testing/unit.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Functional tests](testing/functional.md)" -msgstr "" +msgstr "[Pruebas funcionales](testing/functional.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[End-to-end tests](testing/end-to-end.md)" -msgstr "" +msgstr "[Pruebas de extremo a extremo](testing/end-to-end.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Static analysis and mutation testing](testing/quality-tools.md)" -msgstr "" +msgstr "[Análisis estático y pruebas de mutación](testing/quality-tools.md)" #. type: Title ## #: ../src/guide/index.md #, no-wrap msgid "Special topics" -msgstr "" +msgstr "Temas especiales" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Console applications](tutorial/console-applications.md)" -msgstr "" +msgstr "[Aplicaciones de consola](tutorial/console-applications.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Mailing](tutorial/mailing.md)" -msgstr "" +msgstr "[Envío de correo](tutorial/mailing.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Performance tuning](tutorial/performance-tuning.md)" -msgstr "" +msgstr "[Optimización del rendimiento](tutorial/performance-tuning.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Using Yii with event loop](tutorial/using-with-event-loop.md)" -msgstr "" +msgstr "[Usar Yii con un bucle de eventos](tutorial/using-with-event-loop.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Using Yii with FrankenPHP](tutorial/using-yii-with-frankenphp.md)" -msgstr "" +msgstr "[Usar Yii con FrankenPHP](tutorial/using-yii-with-frankenphp.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Using Yii with Rapira](tutorial/using-yii-with-rapira.md)" -msgstr "" +msgstr "[Usar Yii con Rapira](tutorial/using-yii-with-rapira.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Using Yii with RoadRunner](tutorial/using-yii-with-roadrunner.md)" -msgstr "" +msgstr "[Usar Yii con RoadRunner](tutorial/using-yii-with-roadrunner.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Using Yii with Swoole](tutorial/using-yii-with-swoole.md)" -msgstr "" +msgstr "[Usar Yii con Swoole](tutorial/using-yii-with-swoole.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Docker in application templates](tutorial/docker.md)" -msgstr "" +msgstr "[Docker en las plantillas de aplicación](tutorial/docker.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Internationalization](tutorial/i18n.md)" -msgstr "" +msgstr "[Internacionalización](tutorial/i18n.md)" #. type: Title ## #: ../src/guide/index.md #, no-wrap msgid "Helpers" -msgstr "" +msgstr "Helpers" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[Arrays](https://github.com/yiisoft/arrays/)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[Arrays](https://github.com/yiisoft/arrays/)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[Files](https://github.com/yiisoft/files/)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[Archivos](https://github.com/yiisoft/files/)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[Html](https://github.com/yiisoft/html/)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[Html](https://github.com/yiisoft/html/)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[Json](https://github.com/yiisoft/json)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[Json](https://github.com/yiisoft/json)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[Network utilities](https://github.com/yiisoft/network-utilities/)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[Utilidades de red](https://github.com/yiisoft/network-utilities/)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[VarDumper](https://github.com/yiisoft/var-dumper)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[VarDumper](https://github.com/yiisoft/var-dumper)" #. type: Bullet: '- ' #: ../src/guide/index.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[Strings](https://github.com/yiisoft/strings)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[Cadenas](https://github.com/yiisoft/strings)" #. type: Title ## #: ../src/guide/index.md #, no-wrap msgid "Extras" -msgstr "" +msgstr "Extras" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Cookbook](../cookbook/index.md)" -msgstr "" +msgstr "[Recetario](../cookbook/index.md)" #. type: Bullet: '- ' #: ../src/guide/index.md msgid "[Glossary](glossary.md)" -msgstr "" +msgstr "[Glosario](glossary.md)" diff --git a/_translations/po/es/guide_intro_upgrade-from-v1.md.po b/_translations/po/es/guide_intro_upgrade-from-v1.md.po index 34a07f03..14c33bd4 100644 --- a/_translations/po/es/guide_intro_upgrade-from-v1.md.po +++ b/_translations/po/es/guide_intro_upgrade-from-v1.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-09-25 14:35+0000\n" -"PO-Revision-Date: 2026-05-28 20:46+0000\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -21,7 +21,7 @@ msgstr "" #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Project structure" -msgstr "" +msgstr "Estructura del proyecto" #. type: Fenced code block (json) #: ../src/guide/concept/autoloading.md ../src/guide/intro/upgrade-from-v1.md @@ -48,7 +48,7 @@ msgstr "" #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Upgrading from Version 1.1" -msgstr "" +msgstr "Actualizar desde la versión 1.1" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md @@ -57,93 +57,95 @@ msgid "" "> If you haven't used Yii 1.1, you can skip this section and get directly to\n" "> \"[getting started](../start/prerequisites.md)\" section.\n" msgstr "" +"> Si no has usado Yii 1.1, puedes saltarte esta sección e ir directamente a la sección\n" +"> \"[primeros pasos](../start/prerequisites.md)\".\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 is not an incremental upgrade from Yii 1.1. Yii 2.0 was a full rewrite, and Yii3 changes the architecture again: Composer packages, namespaces, PHP 8, PSR interfaces, dependency injection, explicit routes, middleware, and separate packages for features that were built into the framework in Yii 1.1." -msgstr "" +msgstr "Yii3 no es una actualización incremental de Yii 1.1. Yii 2.0 fue una reescritura completa, y Yii3 vuelve a cambiar la arquitectura: paquetes de Composer, espacios de nombres, PHP 8, interfaces PSR, inyección de dependencias, rutas explícitas, middleware y paquetes independientes para funcionalidades que en Yii 1.1 venían integradas en el framework." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Treat this as building a new Yii3 application with the benefit of Yii 1.1 experience. Reuse the domain knowledge, database schema, user workflows, and selected code after refactoring. Do not try to reproduce the Yii 1.1 application structure in Yii3. A direct search-and-replace conversion is not realistic." -msgstr "" +msgstr "Plantéatelo como la construcción de una nueva aplicación Yii3 aprovechando tu experiencia con Yii 1.1. Reutiliza el conocimiento del dominio, el esquema de la base de datos, los flujos de trabajo de los usuarios y una parte del código tras refactorizarlo. No intentes reproducir en Yii3 la estructura de la aplicación Yii 1.1. Una conversión directa a base de buscar y reemplazar no es realista." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "For additional background, read the Yii 2.0 guide section [Upgrading from Version 1.1](https://www.yiiframework.com/doc/guide/2.0/en/intro-upgrade-from-v1). It explains the first major break from Yii 1.1: Composer, namespaces, object configuration, view changes, controller return values, widgets, assets, helpers, forms, query builder, Active Record, and URL management. Yii3 builds on many of those changes and makes dependencies more explicit." -msgstr "" +msgstr "Para más contexto, lee la sección [Actualizar desde la versión 1.1](https://www.yiiframework.com/doc/guide/2.0/en/intro-upgrade-from-v1) de la guía de Yii 2.0. Explica la primera gran ruptura con Yii 1.1: Composer, espacios de nombres, configuración de objetos, cambios en las vistas, valores de retorno de los controladores, widgets, assets, helpers, formularios, constructor de consultas, Active Record y gestión de URL. Yii3 se basa en muchos de esos cambios y hace más explícitas las dependencias." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Recommended approach" -msgstr "" +msgstr "Enfoque recomendado" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Choose one of these paths:" -msgstr "" +msgstr "Elige uno de estos caminos:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "Build a new Yii3 application directly when the Yii 1.1 application is small or you are already rewriting request flows." -msgstr "" +msgstr "Construye directamente una nueva aplicación Yii3 cuando la aplicación Yii 1.1 sea pequeña o ya estés reescribiendo los flujos de solicitud." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "Move Yii 1.1 concepts to Yii 2.0 first when the team needs a smaller conceptual step." -msgstr "" +msgstr "Traslada primero los conceptos de Yii 1.1 a Yii 2.0 cuando el equipo necesite un salto conceptual más pequeño." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "Keep Yii 1.1 running and rebuild critical flows in Yii3 one by one." -msgstr "" +msgstr "Mantén Yii 1.1 en funcionamiento y reconstruye en Yii3 los flujos críticos uno a uno." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "For most long-lived applications, the third option is the least risky. Create a Yii3 application, connect it to the same database, and build vertical slices: route, action, input validation, persistence, view, assets, and tests. Each slice should be idiomatic Yii3, even when it is based on behavior from the Yii 1.1 application." -msgstr "" +msgstr "Para la mayoría de las aplicaciones de larga duración, la tercera opción es la menos arriesgada. Crea una aplicación Yii3, conéctala a la misma base de datos y construye porciones verticales: ruta, acción, validación de la entrada, persistencia, vista, assets y pruebas. Cada porción debe ser código Yii3 idiomático, aunque se base en el comportamiento de la aplicación Yii 1.1." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Prepare the Yii 1.1 application" -msgstr "" +msgstr "Preparar la aplicación Yii 1.1" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Useful preparation can happen before the Yii3 application is ready. These refactorings make old behavior easier to understand and reduce the amount of Yii 1.1 framework state that crosses into the new code:" -msgstr "" +msgstr "Parte de la preparación útil puede hacerse antes de que la aplicación Yii3 esté lista. Estas refactorizaciones hacen que el comportamiento antiguo sea más fácil de entender y reducen la cantidad de estado del framework Yii 1.1 que pasa al código nuevo:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "Remove direct `Yii::app()` access from reusable code where practical. If a full refactoring is too large, keep `Yii::app()` calls near controllers, widgets, and commands, then pass values and services to lower-level code explicitly." -msgstr "" +msgstr "Elimina el acceso directo a `Yii::app()` del código reutilizable cuando sea viable. Si una refactorización completa es demasiado grande, mantén las llamadas a `Yii::app()` cerca de los controladores, widgets y comandos, y pasa explícitamente los valores y servicios al código de nivel inferior." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "Introduce repositories or query services for database reads currently spread across controllers, views, `CActiveRecord` methods, and widgets. Yii3 can use Active Record, but it does not require it for every persistence task." -msgstr "" +msgstr "Introduce repositorios o servicios de consulta para las lecturas de la base de datos que ahora están repartidas entre controladores, vistas, métodos de `CActiveRecord` y widgets. Yii3 puede usar Active Record, pero no lo exige para todas las tareas de persistencia." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "Separate business rules from framework infrastructure. Code that does not extend `CComponent`, read global application state, or render views is easier to reuse as a specification for Yii3 code." -msgstr "" +msgstr "Separa las reglas de negocio de la infraestructura del framework. El código que no extiende `CComponent`, no lee el estado global de la aplicación ni renderiza vistas es más fácil de reutilizar como especificación para el código de Yii3." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "Move reusable behavior out of large controllers and Active Record classes into Yii 1.1 application components or plain services. Yii3 services are configured and injected differently, but the responsibility boundary is similar." -msgstr "" +msgstr "Saca el comportamiento reutilizable de los controladores grandes y las clases Active Record y llévalo a componentes de aplicación de Yii 1.1 o a servicios simples. Los servicios de Yii3 se configuran e inyectan de otra manera, pero el reparto de responsabilidades es similar." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "Add tests or characterization checks around routes and workflows you plan to rebuild first. They become the executable specification for the Yii3 slice." -msgstr "" +msgstr "Añade pruebas o comprobaciones de caracterización para las rutas y los flujos de trabajo que planeas reconstruir primero. Se convertirán en la especificación ejecutable de la porción de Yii3." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "For example, instead of reading post archive data directly from several controllers or widgets, create a small service that describes the application need:" -msgstr "" +msgstr "Por ejemplo, en lugar de leer los datos del histórico de publicaciones directamente desde varios controladores o widgets, crea un pequeño servicio que describa la necesidad de la aplicación:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -162,68 +164,80 @@ msgid "" " }\n" "}\n" msgstr "" +"class PostRepository extends CComponent\n" +"{\n" +" public function getArchive()\n" +" {\n" +" // ...\n" +" }\n" +"\n" +" public function getTopForFrontPage($limit = 10)\n" +" {\n" +" // ...\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "The Yii3 implementation may use `yiisoft/active-record`, `yiisoft/db`, or another persistence layer. The important point is that controllers and views no longer need to know that detail." -msgstr "" +msgstr "La implementación de Yii3 puede usar `yiisoft/active-record`, `yiisoft/db` u otra capa de persistencia. Lo importante es que los controladores y las vistas ya no necesiten conocer ese detalle." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Things to learn before starting" -msgstr "" +msgstr "Qué aprender antes de empezar" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Some Yii3 application-template choices are likely to be new in a Yii 1.1 codebase:" -msgstr "" +msgstr "Algunas decisiones de la plantilla de aplicación de Yii3 probablemente sean nuevas si vienes de un código base de Yii 1.1:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "[Composer](https://getcomposer.org/). Yii3 applications and packages are installed through Composer and loaded with PSR-4 autoloading." -msgstr "" +msgstr "[Composer](https://getcomposer.org/). Las aplicaciones y los paquetes de Yii3 se instalan mediante Composer y se cargan con la autocarga PSR-4." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "[Namespaces](https://www.php.net/manual/en/language.namespaces.php). Yii3 classes are namespaced instead of using Yii 1.1-style class prefixes and path aliases for class loading." -msgstr "" +msgstr "[Espacios de nombres](https://www.php.net/manual/en/language.namespaces.php). Las clases de Yii3 usan espacios de nombres en lugar de los prefijos de clase y los alias de ruta al estilo de Yii 1.1 para cargar las clases." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "[Docker](https://www.docker.com/get-started/). The default Yii3 application template includes Docker configuration. Using it gives each application its own repeatable environment and reduces differences between local development and production." -msgstr "" +msgstr "[Docker](https://www.docker.com/get-started/). La plantilla de aplicación predeterminada de Yii3 incluye configuración de Docker. Usarla proporciona a cada aplicación su propio entorno reproducible y reduce las diferencias entre el desarrollo local y producción." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "[Environment variables](https://en.wikipedia.org/wiki/Environment_variable). Yii3 templates commonly use them for environment-specific settings and secrets, especially in Docker-based deployments. This follows the same idea as [12-factor app configuration](https://12factor.net/config)." -msgstr "" +msgstr "[Variables de entorno](https://en.wikipedia.org/wiki/Environment_variable). Las plantillas de Yii3 suelen usarlas para los ajustes específicos de cada entorno y para los secretos, sobre todo en despliegues basados en Docker. Sigue la misma idea que la [configuración de las aplicaciones de 12 factores](https://12factor.net/config)." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "[Actions](../structure/action.md). Yii3 does not require controller inheritance. A route can point to any callable, and the default template uses invokable action classes." -msgstr "" +msgstr "[Acciones](../structure/action.md). Yii3 no exige heredar de un controlador. Una ruta puede apuntar a cualquier callable, y la plantilla predeterminada usa clases de acción invocables." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "[Application structure](../structure/overview.md). Yii3's default structure is different from Yii 1.1. Start with the Yii3 template and change it only when the application needs it." -msgstr "" +msgstr "[Estructura de la aplicación](../structure/overview.md). La estructura predeterminada de Yii3 es distinta de la de Yii 1.1. Empieza con la plantilla de Yii3 y cámbiala solo cuando la aplicación lo necesite." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "PHP, Composer, and namespaces" -msgstr "" +msgstr "PHP, Composer y espacios de nombres" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 applications commonly rely on PHP 5-era code, class prefixes such as `CController`, and autoloading by class name. Yii3 applications require modern PHP and Composer autoloading." -msgstr "" +msgstr "Las aplicaciones Yii 1.1 suelen basarse en código de la época de PHP 5, en prefijos de clase como `CController` y en la autocarga por nombre de clase. Las aplicaciones Yii3 requieren un PHP moderno y la autocarga de Composer." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1:" -msgstr "" +msgstr "Yii 1.1:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -233,11 +247,14 @@ msgid "" "{\n" "}\n" msgstr "" +"class SiteController extends CController\n" +"{\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3:" -msgstr "" +msgstr "Yii3:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -249,32 +266,37 @@ msgid "" "{\n" "}\n" msgstr "" +"namespace App\\Web\\HomePage;\n" +"\n" +"final readonly class Action\n" +"{\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "Configure your application namespace with PSR-4:" -msgstr "" +msgstr "Configura el espacio de nombres de tu aplicación con PSR-4:" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Run:" -msgstr "" +msgstr "Ejecuta:" #. type: Fenced code block (shell) #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "composer dump-autoload\n" -msgstr "" +msgstr "composer dump-autoload\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "When reusing a class, give it a namespace, add strict types, replace Yii 1.1 base classes, and inject dependencies instead of reading them from global application state. If these changes make the class awkward, use the old class as a specification and write a new Yii3 class instead." -msgstr "" +msgstr "Al reutilizar una clase, dale un espacio de nombres, añade tipos estrictos, sustituye las clases base de Yii 1.1 e inyecta las dependencias en lugar de leerlas del estado global de la aplicación. Si estos cambios hacen que la clase resulte forzada, usa la clase antigua como especificación y escribe en su lugar una nueva clase de Yii3." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "A Yii 1.1 application often uses:" -msgstr "" +msgstr "Una aplicación Yii 1.1 suele usar:" #. type: Fenced code block (text) #: ../src/guide/intro/upgrade-from-v1.md @@ -293,11 +315,23 @@ msgid "" "themes/\n" "webroot/\n" msgstr "" +"protected/\n" +" commands/\n" +" components/\n" +" config/\n" +" controllers/\n" +" extensions/\n" +" messages/\n" +" migrations/\n" +" models/\n" +" views/\n" +"themes/\n" +"webroot/\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "The current Yii3 application template uses:" -msgstr "" +msgstr "La plantilla de aplicación actual de Yii3 usa:" #. type: Fenced code block (text) #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md @@ -310,11 +344,17 @@ msgid "" "src/\n" "tests/\n" msgstr "" +"assets/\n" +"config/\n" +"public/\n" +"runtime/\n" +"src/\n" +"tests/\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "Typical mappings to consider are:" -msgstr "" +msgstr "Las correspondencias habituales que conviene tener en cuenta son:" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md @@ -333,22 +373,34 @@ msgid "" "| `protected/config` | `config/common`, `config/web`, `config/console`, `config/environments` |\n" "| `webroot` | `public` |\n" msgstr "" +"| Yii 1.1 | Yii3 |\n" +"|---------|------|\n" +"| `protected/controllers` | `src/Web/*/Action.php` o servicios similares a controladores |\n" +"| `protected/models` | `src/Domain`, `src/Shared`, `src/Db` o modelos de formulario, según la responsabilidad |\n" +"| `protected/views` | plantillas junto a la funcionalidad, por ejemplo `src/Web/HomePage/template.php` |\n" +"| `protected/views/layouts` | plantillas de layout y assets dentro de `src/Web/Shared/Layout` |\n" +"| `protected/components` | servicios configurados en el contenedor de inyección de dependencias |\n" +"| `protected/extensions` | paquetes de Composer o paquetes locales |\n" +"| `protected/commands` | `src/Console/*Command.php` |\n" +"| `protected/messages` | archivos de mensajes del traductor |\n" +"| `protected/config` | `config/common`, `config/web`, `config/console`, `config/environments` |\n" +"| `webroot` | `public` |\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Do not recreate `protected` in Yii3. Put PHP source under `src`, public files under `public`, generated/runtime files under `runtime`, and configuration under `config`." -msgstr "" +msgstr "No recrees `protected` en Yii3. Pon el código fuente PHP en `src`, los archivos públicos en `public`, los archivos generados y de tiempo de ejecución en `runtime`, y la configuración en `config`." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Configuration and application components" -msgstr "" +msgstr "Configuración y componentes de la aplicación" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 configuration is usually one large array:" -msgstr "" +msgstr "La configuración de Yii 1.1 suele ser un único array grande:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -371,58 +423,68 @@ msgid "" " ],\n" "];\n" msgstr "" +"return [\n" +" 'basePath' => dirname(__DIR__),\n" +" 'components' => [\n" +" 'db' => [\n" +" 'connectionString' => 'mysql:host=localhost;dbname=app',\n" +" 'username' => 'root',\n" +" 'password' => '',\n" +" ],\n" +" 'urlManager' => [\n" +" 'urlFormat' => 'path',\n" +" 'rules' => [\n" +" 'post/' => 'post/view',\n" +" ],\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "In Yii3, configuration is split by purpose and services are wired through the container:" -msgstr "" +msgstr "En Yii3, la configuración se divide según su finalidad y los servicios se conectan a través del contenedor:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "aliases in `config/common/aliases.php`;" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "los alias, en `config/common/aliases.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "parameters in `config/common/params.php` and environment files;" -msgstr "" +msgstr "los parámetros, en `config/common/params.php` y en los archivos de entorno;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "shared service definitions in `config/common/di/*.php`;" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "las definiciones de servicios compartidas, en `config/common/di/*.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "web-only service definitions in `config/web/di/*.php`;" -msgstr "" +msgstr "las definiciones de servicios exclusivas de la web, en `config/web/di/*.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "routes in `config/common/routes.php`;" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "las rutas, en `config/common/routes.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "console commands in `config/console/*.php`." -msgstr "" +msgstr "los comandos de consola, en `config/console/*.php`." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "The default template's console DI group reuses shared definitions from `config/common/di/*.php`. If you need console-only container definitions, add files for them to the `di-console` group in `config/configuration.php` and rebuild the merge plan." -msgstr "" +msgstr "El grupo DI de consola de la plantilla predeterminada reutiliza las definiciones compartidas de `config/common/di/*.php`. Si necesitas definiciones del contenedor exclusivas de la consola, añade sus archivos al grupo `di-console` en `config/configuration.php` y vuelve a generar el plan de fusión." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Replace `Yii::app()->componentName` with constructor-injected services:\n" -msgstr "" +msgstr "Sustituye `Yii::app()->componentName` por servicios inyectados en el constructor:\n" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -440,22 +502,33 @@ msgid "" " }\n" "}\n" msgstr "" +"use Yiisoft\\Db\\Connection\\ConnectionInterface;\n" +"use Yiisoft\\Router\\UrlGeneratorInterface;\n" +"\n" +"final readonly class PostRepository\n" +"{\n" +" public function __construct(\n" +" private ConnectionInterface $db,\n" +" private UrlGeneratorInterface $urlGenerator,\n" +" ) {\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Configuration](../concept/configuration.md), [Aliases](../concept/aliases.md), and [Dependency injection container](../concept/di-container.md)." -msgstr "" +msgstr "Consulta [Configuración](../concept/configuration.md), [Alias](../concept/aliases.md) e [Inyección de dependencias y contenedor](../concept/di-container.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Entry script" -msgstr "" +msgstr "Script de entrada" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 entry scripts commonly load `yii.php` and create a web application:" -msgstr "" +msgstr "Los scripts de entrada de Yii 1.1 suelen cargar `yii.php` y crear una aplicación web:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -465,27 +538,30 @@ msgid "" "\n" "Yii::createWebApplication($config)->run();\n" msgstr "" +"require_once __DIR__ . '/../framework/yii.php';\n" +"\n" +"Yii::createWebApplication($config)->run();\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 entry scripts load Composer and bootstrap the configured application. Start with the `public/index.php` file from `yiisoft/app` and adjust configuration instead of building the application manually in the entry script." -msgstr "" +msgstr "Los scripts de entrada de Yii3 cargan Composer y arrancan la aplicación configurada. Parte del archivo `public/index.php` de `yiisoft/app` y ajusta la configuración en lugar de construir la aplicación manualmente en el script de entrada." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Entry scripts](../structure/entry-script.md) and [Application workflow](../start/workflow.md)." -msgstr "" +msgstr "Consulta [Scripts de entrada](../structure/entry-script.md) y [Flujo de trabajo de la aplicación](../start/workflow.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Controllers, actions, and routes" -msgstr "" +msgstr "Controladores, acciones y rutas" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 controllers extend `CController`, and actions are methods named `actionName`:" -msgstr "" +msgstr "Los controladores de Yii 1.1 extienden `CController`, y las acciones son métodos con nombres del tipo `actionName`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -505,34 +581,28 @@ msgid "" " }\n" "}\n" msgstr "" +"class PostController extends CController\n" +"{\n" +" public function actionView($id)\n" +" {\n" +" $post = Post::model()->findByPk($id);\n" +"\n" +" if ($post === null) {\n" +" throw new CHttpException(404);\n" +" }\n" +"\n" +" $this->render('view', ['post' => $post]);\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 does not require controller inheritance. The current template uses invokable action classes:" -msgstr "" +msgstr "Yii3 no exige heredar de un controlador. La plantilla actual usa clases de acción invocables:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md -#, fuzzy, no-wrap -#| msgid "" -#| "use Psr\\EventDispatcher\\EventDispatcherInterface;\n" -#| "\n" -#| "final readonly class SignupService\n" -#| "{\n" -#| " public function __construct(\n" -#| " private EventDispatcherInterface $eventDispatcher\n" -#| " )\n" -#| " {\n" -#| " }\n" -#| "\n" -#| " public function signup(SignupForm $form)\n" -#| " {\n" -#| " // handle signup\n" -#| "\n" -#| " $event = new UserSignedUp($form);\n" -#| " $this->eventDispatcher->dispatch($event);\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "namespace App\\Web\\Post\\View;\n" "\n" @@ -560,29 +630,36 @@ msgid "" " }\n" "}\n" msgstr "" -"use Psr\\EventDispatcher\\EventDispatcherInterface;\n" +"namespace App\\Web\\Post\\View;\n" +"\n" +"use App\\Post\\PostRepository;\n" +"use Psr\\Http\\Message\\ResponseInterface;\n" +"use Yiisoft\\Router\\CurrentRoute;\n" +"use Yiisoft\\Yii\\View\\Renderer\\WebViewRenderer;\n" "\n" -"final readonly class SignupService\n" +"final readonly class Action\n" "{\n" " public function __construct(\n" -" private EventDispatcherInterface $eventDispatcher\n" -" )\n" -" {\n" +" private CurrentRoute $currentRoute,\n" +" private PostRepository $posts,\n" +" private WebViewRenderer $viewRenderer,\n" +" ) {\n" " }\n" "\n" -" public function signup(SignupForm $form)\n" +" public function __invoke(): ResponseInterface\n" " {\n" -" // handle signup\n" +" $post = $this->posts->findById((int) $this->currentRoute->getArgument('id'));\n" "\n" -" $event = new UserSignedUp($form);\n" -" $this->eventDispatcher->dispatch($event);\n" +" return $this->viewRenderer->render(__DIR__ . '/template', [\n" +" 'post' => $post,\n" +" ]);\n" " }\n" "}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "The route is explicit:" -msgstr "" +msgstr "La ruta es explícita:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -597,27 +674,35 @@ msgid "" " ->name('post/view'),\n" "];\n" msgstr "" +"use App\\Web\\Post\\View;\n" +"use Yiisoft\\Router\\Route;\n" +"\n" +"return [\n" +" Route::get('/post/{id:\\d+}')\n" +" ->action(View\\Action::class)\n" +" ->name('post/view'),\n" +"];\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Define routes before action bodies. It gives you a checklist of request flows you decided to keep in the Yii3 application." -msgstr "" +msgstr "Define las rutas antes que el cuerpo de las acciones. Así tendrás una lista de comprobación de los flujos de solicitud que has decidido conservar en la aplicación Yii3." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Actions](../structure/action.md), [Middleware](../structure/middleware.md), and [Routing and URL generation](../runtime/routing.md)." -msgstr "" +msgstr "Consulta [Acciones](../structure/action.md), [Middleware](../structure/middleware.md) y [Enrutamiento y generación de URL](../runtime/routing.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Requests, responses, redirects, sessions, and cookies" -msgstr "" +msgstr "Solicitudes, respuestas, redirecciones, sesiones y cookies" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 code often reads and writes through `Yii::app()`:" -msgstr "" +msgstr "El código de Yii 1.1 suele leer y escribir a través de `Yii::app()`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -627,27 +712,30 @@ msgid "" "Yii::app()->user->setFlash('success', 'Saved.');\n" "$this->redirect(['post/view', 'id' => $id]);\n" msgstr "" +"$id = Yii::app()->request->getParam('id');\n" +"Yii::app()->user->setFlash('success', 'Saved.');\n" +"$this->redirect(['post/view', 'id' => $id]);\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 uses PSR-7 request and response objects and injectable services. Request input is available from `ServerRequestInterface`; redirects, sessions, cookies, and responses are explicit dependencies." -msgstr "" +msgstr "Yii3 usa objetos de solicitud y respuesta PSR-7 y servicios inyectables. La entrada de la solicitud está disponible en `ServerRequestInterface`; las redirecciones, las sesiones, las cookies y las respuestas son dependencias explícitas." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Request](../runtime/request.md), [Response](../runtime/response.md), [Sessions](../runtime/sessions.md), and [Cookies](../runtime/cookies.md)." -msgstr "" +msgstr "Consulta [Solicitud](../runtime/request.md), [Respuesta](../runtime/response.md), [Sesiones](../runtime/sessions.md) y [Cookies](../runtime/cookies.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Views and layouts" -msgstr "" +msgstr "Vistas y layouts" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 views use `$this` as the controller or widget context. Layouts and partials are rendered through controller methods:" -msgstr "" +msgstr "Las vistas de Yii 1.1 usan `$this` como contexto del controlador o del widget. Los layouts y las vistas parciales se renderizan mediante métodos del controlador:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -660,11 +748,17 @@ msgid "" "\n" "

title); ?>

\n" msgstr "" +"\n" +"\n" +"

title); ?>

\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "In Yii3 templates, `$this` is a `Yiisoft\\View\\WebView` instance:" -msgstr "" +msgstr "En las plantillas de Yii3, `$this` es una instancia de `Yiisoft\\View\\WebView`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -683,27 +777,39 @@ msgid "" "\n" "

getTitle()) ?>

\n" msgstr "" +"use Yiisoft\\Html\\Html;\n" +"use Yiisoft\\View\\WebView;\n" +"\n" +"/**\n" +" * @var WebView $this\n" +" * @var Post $post\n" +" */\n" +"\n" +"$this->setTitle($post->getTitle());\n" +"?>\n" +"\n" +"

getTitle()) ?>

\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Move controller-specific view logic to the action or to a presenter. Pass only the data a template needs." -msgstr "" +msgstr "Traslada la lógica de vista específica del controlador a la acción o a un presentador (presenter). Pasa solo los datos que necesita la plantilla." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "See [View](../views/view.md), [View injections](../views/view-injections.md), and [Template engines](../views/template-engines.md)." -msgstr "" +msgstr "Consulta [Vistas](../views/view.md), [Inyecciones de vista](../views/view-injections.md) y [Motores de plantillas](../views/template-engines.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Assets and client scripts" -msgstr "" +msgstr "Assets y scripts de cliente" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 applications often use `CClientScript`, themes, and extension-specific asset publishing:" -msgstr "" +msgstr "Las aplicaciones Yii 1.1 suelen usar `CClientScript`, temas y la publicación de assets propia de cada extensión:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -712,11 +818,13 @@ msgid "" "Yii::app()->clientScript->registerCssFile('/css/site.css');\n" "Yii::app()->clientScript->registerScriptFile('/js/site.js');\n" msgstr "" +"Yii::app()->clientScript->registerCssFile('/css/site.css');\n" +"Yii::app()->clientScript->registerScriptFile('/js/site.js');\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 uses asset bundles from `yiisoft/assets`:" -msgstr "" +msgstr "Yii3 usa paquetes de assets de `yiisoft/assets`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -736,64 +844,75 @@ msgid "" " public array $js = ['site.js'];\n" "}\n" msgstr "" +"namespace App\\Web\\Shared\\Layout\\Main;\n" +"\n" +"use Yiisoft\\Assets\\AssetBundle;\n" +"\n" +"final class MainAsset extends AssetBundle\n" +"{\n" +" public ?string $basePath = '@assets/main';\n" +" public ?string $baseUrl = '@assetsUrl/main';\n" +" public ?string $sourcePath = '@assetsSource/main';\n" +"\n" +" public array $css = ['site.css'];\n" +" public array $js = ['site.js'];\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Register bundles through the asset manager in layouts or views." -msgstr "" +msgstr "Registra los paquetes mediante el gestor de assets en los layouts o las vistas." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md -#, fuzzy -#| msgid "[Assets](views/asset.md) -" msgid "See [Assets](../views/asset.md) and [Scripts, styles and metatags](../views/script-style-meta.md)." -msgstr "[Assets](views/asset.md)" +msgstr "Consulta [Assets](../views/asset.md) y [Scripts, estilos y metaetiquetas](../views/script-style-meta.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Models, forms, and validation" -msgstr "" +msgstr "Modelos, formularios y validación" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 has `CModel`, `CFormModel`, and `CActiveRecord`. It is common for one model class to contain input data, labels, validation rules, database persistence, and business logic." -msgstr "" +msgstr "Yii 1.1 tiene `CModel`, `CFormModel` y `CActiveRecord`. Es habitual que una sola clase de modelo contenga los datos de entrada, las etiquetas, las reglas de validación, la persistencia en la base de datos y la lógica de negocio." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 works better when these responsibilities are split:" -msgstr "" +msgstr "Yii3 funciona mejor cuando estas responsabilidades están separadas:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "form data and labels: `yiisoft/form-model`;" -msgstr "" +msgstr "datos y etiquetas del formulario: `yiisoft/form-model`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "validation rules: `yiisoft/validator`;" -msgstr "" +msgstr "reglas de validación: `yiisoft/validator`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "form rendering: `yiisoft/form`;" -msgstr "" +msgstr "renderizado de formularios: `yiisoft/form`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "persistence: repositories, `yiisoft/db`, or `yiisoft/active-record`;" -msgstr "" +msgstr "persistencia: repositorios, `yiisoft/db` o `yiisoft/active-record`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "business workflows: application services." -msgstr "" +msgstr "flujos de negocio: servicios de la aplicación." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 form model:" -msgstr "" +msgstr "Modelo de formulario de Yii 1.1:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -813,11 +932,24 @@ msgid "" " }\n" "}\n" msgstr "" +"class ContactForm extends CFormModel\n" +"{\n" +" public $name;\n" +" public $email;\n" +"\n" +" public function rules()\n" +" {\n" +" return [\n" +" ['name, email', 'required'],\n" +" ['email', 'email'],\n" +" ];\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 form model:" -msgstr "" +msgstr "Modelo de formulario de Yii3:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md @@ -837,22 +969,35 @@ msgid "" " public ?string $email = null;\n" "}\n" msgstr "" +"use Yiisoft\\FormModel\\FormModel;\n" +"use Yiisoft\\Validator\\Rule\\Email;\n" +"use Yiisoft\\Validator\\Rule\\Required;\n" +"\n" +"final class ContactForm extends FormModel\n" +"{\n" +" #[Required]\n" +" public ?string $name = null;\n" +"\n" +" #[Required]\n" +" #[Email]\n" +" public ?string $email = null;\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Working with forms](../start/forms.md), [Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md), [yiisoft/form](https://github.com/yiisoft/form), and [yiisoft/form-model](https://github.com/yiisoft/form-model)." -msgstr "" +msgstr "Consulta [Trabajar con formularios](../start/forms.md), [Validar la entrada](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md), [yiisoft/form](https://github.com/yiisoft/form) y [yiisoft/form-model](https://github.com/yiisoft/form-model)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Active Record" -msgstr "" +msgstr "Active Record" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 Active Record uses `CActiveRecord::model()` and dynamic attributes:" -msgstr "" +msgstr "Active Record de Yii 1.1 usa `CActiveRecord::model()` y atributos dinámicos:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -879,13 +1024,31 @@ msgid "" " }\n" "}\n" msgstr "" +"class Post extends CActiveRecord\n" +"{\n" +" public static function model($className = __CLASS__)\n" +" {\n" +" return parent::model($className);\n" +" }\n" +"\n" +" public function tableName()\n" +" {\n" +" return '{{post}}';\n" +" }\n" +"\n" +" public function rules()\n" +" {\n" +" return [\n" +" ['title, body', 'required'],\n" +" ['title', 'length', 'max' => 255],\n" +" ];\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "The incremental Yii3 option is [yiisoft/active-record](https://github.com/yiisoft/active-record):" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "La opción incremental en Yii3 es [yiisoft/active-record](https://github.com/yiisoft/active-record):" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -915,54 +1078,76 @@ msgid "" " }\n" "}\n" msgstr "" +"use Yiisoft\\ActiveRecord\\ActiveRecord;\n" +"\n" +"final class Post extends ActiveRecord\n" +"{\n" +" protected int $id;\n" +" protected string $title;\n" +" protected string $body;\n" +"\n" +" public function tableName(): string\n" +" {\n" +" return '{{%post}}';\n" +" }\n" +"\n" +" public function getTitle(): ?string\n" +" {\n" +" return $this->title ?? null;\n" +" }\n" +"\n" +" public function setTitle(string $title): void\n" +" {\n" +" $this->title = $title;\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Move Yii 1.1 `rules()` to a form model, validator rules, or a service. Keep Active Record focused on persistence: table mapping, properties, relations, and database operations." -msgstr "" +msgstr "Traslada `rules()` de Yii 1.1 a un modelo de formulario, a reglas del validador o a un servicio. Mantén Active Record centrado en la persistencia: mapeo de tablas, propiedades, relaciones y operaciones de base de datos." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "For more complex applications, consider replacing Active Record-heavy code with repositories and domain objects. That is more work initially, but it avoids carrying Yii 1.1 form and persistence coupling into the new application." -msgstr "" +msgstr "En aplicaciones más complejas, plantéate sustituir el código que depende mucho de Active Record por repositorios y objetos de dominio. Al principio supone más trabajo, pero evita arrastrar a la nueva aplicación el acoplamiento entre formularios y persistencia de Yii 1.1." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Working with databases](../start/databases.md), [Migrations](../databases/db-migrations.md), and [yiisoft/active-record](https://github.com/yiisoft/active-record)." -msgstr "" +msgstr "Consulta [Trabajar con bases de datos](../start/databases.md), [Migraciones](../databases/db-migrations.md) y [yiisoft/active-record](https://github.com/yiisoft/active-record)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md -#, fuzzy, no-wrap -#| msgid "Generating API documentation" +#, no-wrap msgid "Database queries and migrations" -msgstr "Generación de Documentación de API" +msgstr "Consultas a la base de datos y migraciones" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 code may use `CDbCriteria`, `CDbCommand`, `CActiveDataProvider`, and `CGridView` data providers. In Yii3, use `yiisoft/db` for database access and query building, and `yiisoft/data` / `yiisoft/yii-dataview` for data readers and widgets." -msgstr "" +msgstr "El código de Yii 1.1 puede usar `CDbCriteria`, `CDbCommand`, `CActiveDataProvider` y proveedores de datos de `CGridView`. En Yii3, usa `yiisoft/db` para el acceso a la base de datos y la construcción de consultas, y `yiisoft/data` / `yiisoft/yii-dataview` para los lectores de datos y los widgets." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Migrations are not compatible across Yii 1.1 and Yii3. For an existing application, create a baseline from the current schema and use Yii3 migrations for new changes." -msgstr "" +msgstr "Las migraciones no son compatibles entre Yii 1.1 y Yii3. En una aplicación existente, crea una línea base a partir del esquema actual y usa las migraciones de Yii3 para los cambios nuevos." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "See [Working with databases](../start/databases.md) and [Migrations](../databases/db-migrations.md)." -msgstr "" +msgstr "Consulta [Trabajar con bases de datos](../start/databases.md) y [Migraciones](../databases/db-migrations.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "GridView and data widgets" -msgstr "" +msgstr "GridView y widgets de datos" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 `CGridView` is often configured with `CActiveDataProvider`:" -msgstr "" +msgstr "En Yii 1.1, `CGridView` suele configurarse con `CActiveDataProvider`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -979,13 +1164,21 @@ msgid "" " ],\n" "]);\n" msgstr "" +"$this->widget('zii.widgets.grid.CGridView', [\n" +" 'dataProvider' => $dataProvider,\n" +" 'columns' => [\n" +" 'id',\n" +" 'title',\n" +" [\n" +" 'class' => 'CButtonColumn',\n" +" ],\n" +" ],\n" +"]);\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "Yii3 uses [yiisoft/yii-dataview](https://github.com/yiisoft/yii-dataview):" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "Yii3 usa [yiisoft/yii-dataview](https://github.com/yiisoft/yii-dataview):" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -1008,22 +1201,38 @@ msgid "" " new ActionColumn(),\n" " );\n" msgstr "" +"use Yiisoft\\Data\\Reader\\ReadableDataInterface;\n" +"use Yiisoft\\Yii\\DataView\\Column\\DataColumn;\n" +"use Yiisoft\\Yii\\DataView\\GridView\\Column\\ActionColumn;\n" +"use Yiisoft\\Yii\\DataView\\GridView\\GridView;\n" +"\n" +"/**\n" +" * @var ReadableDataInterface $dataReader\n" +" */\n" +"\n" +"echo GridView::widget()\n" +" ->dataReader($dataReader)\n" +" ->columns(\n" +" new DataColumn('id'),\n" +" new DataColumn('title'),\n" +" new ActionColumn(),\n" +" );\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Replace the old data provider with a query service that returns a data reader. Model filters as validator rules and route or query parameters." -msgstr "" +msgstr "Sustituye el antiguo proveedor de datos por un servicio de consulta que devuelva un lector de datos. Modela los filtros como reglas del validador y como parámetros de ruta o de consulta." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "See [Using htmx for partial reloads](../../cookbook/using-htmx-for-partial-reloads.md) and [yii-dataview GridView docs](https://github.com/yiisoft/yii-dataview/blob/master/docs/en/guide/gridview.md)." -msgstr "" +msgstr "Consulta [Usar htmx para recargas parciales](../../cookbook/using-htmx-for-partial-reloads.md) y la [documentación de GridView de yii-dataview](https://github.com/yiisoft/yii-dataview/blob/master/docs/en/guide/gridview.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "URL management" -msgstr "" +msgstr "Gestión de URL" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -1032,6 +1241,8 @@ msgid "" "echo CHtml::link('View', ['post/view', 'id' => $post->id]);\n" "$url = Yii::app()->createUrl('post/view', ['id' => $post->id]);\n" msgstr "" +"echo CHtml::link('View', ['post/view', 'id' => $post->id]);\n" +"$url = Yii::app()->createUrl('post/view', ['id' => $post->id]);\n" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -1044,27 +1255,33 @@ msgid "" "\n" "echo Html::a('View', $url)->render();\n" msgstr "" +"use Yiisoft\\Html\\Html;\n" +"use Yiisoft\\Router\\UrlGeneratorInterface;\n" +"\n" +"$url = $urlGenerator->generate('post/view', ['id' => $post->getId()]);\n" +"\n" +"echo Html::a('View', $url)->render();\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Prefer named routes. They make views and GridView action columns easier to design and maintain." -msgstr "" +msgstr "Es preferible usar rutas con nombre. Facilitan el diseño y el mantenimiento de las vistas y de las columnas de acción de GridView." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "See [Routing and URL generation](../runtime/routing.md)." -msgstr "" +msgstr "Consulta [Enrutamiento y generación de URL](../runtime/routing.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Filters, access control, and authentication" -msgstr "" +msgstr "Filtros, control de acceso y autenticación" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 controller filters are controller methods or filter classes:" -msgstr "" +msgstr "Los filtros de controlador de Yii 1.1 son métodos del controlador o clases de filtro:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -1077,64 +1294,70 @@ msgid "" " ];\n" "}\n" msgstr "" +"public function filters()\n" +"{\n" +" return [\n" +" 'accessControl',\n" +" ];\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 uses middleware and focused packages. Move authentication, authorization, CSRF, locale detection, and request body parsing out of controllers and into middleware or services." -msgstr "" +msgstr "Yii3 usa middleware y paquetes especializados. Saca de los controladores la autenticación, la autorización, CSRF, la detección del idioma (locale) y el análisis del cuerpo de la solicitud, y llévalos a middlewares o servicios." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Middleware](../structure/middleware.md), [Authentication](../security/authentication.md), and [Authorization](../security/authorization.md)." -msgstr "" +msgstr "Consulta [Middleware](../structure/middleware.md), [Autenticación](../security/authentication.md) y [Autorización](../security/authorization.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "Widgets, helpers, and extensions" -msgstr "" +msgstr "Widgets, helpers y extensiones" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 widgets and helpers usually depend on Yii-specific base classes such as `CWidget`, `CHtml`, and extension autoloading. In Yii3:" -msgstr "" +msgstr "Los widgets y helpers de Yii 1.1 suelen depender de clases base específicas de Yii, como `CWidget` y `CHtml`, y de la autocarga de extensiones. En Yii3:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "replace helper calls with `yiisoft/html`, `yiisoft/arrays`, `yiisoft/strings`, or application helpers;" -msgstr "" +msgstr "sustituye las llamadas a helpers por `yiisoft/html`, `yiisoft/arrays`, `yiisoft/strings` o helpers de la aplicación;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "replace extensions with Composer packages;" -msgstr "" +msgstr "sustituye las extensiones por paquetes de Composer;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "rebuild custom widgets with `yiisoft/widget` or plain services/templates;" -msgstr "" +msgstr "reconstruye los widgets personalizados con `yiisoft/widget` o con servicios/plantillas simples;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "replace jQuery UI and Bootstrap widgets with current frontend packages or Yii3 widget packages where available." -msgstr "" +msgstr "sustituye los widgets de jQuery UI y Bootstrap por paquetes frontend actuales o por paquetes de widgets de Yii3 cuando existan." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "See [Widgets](../views/widget.md)." -msgstr "" +msgstr "Consulta [Widgets](../views/widget.md)." #. type: Title # #: ../src/guide/intro/upgrade-from-v1.md #: ../src/guide/tutorial/console-applications.md #, no-wrap msgid "Console applications" -msgstr "" +msgstr "Aplicaciones de consola" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 console commands extend `CConsoleCommand`:" -msgstr "" +msgstr "Los comandos de consola de Yii 1.1 extienden `CConsoleCommand`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -1147,11 +1370,17 @@ msgid "" " }\n" "}\n" msgstr "" +"class ReportCommand extends CConsoleCommand\n" +"{\n" +" public function actionSend()\n" +" {\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii3 console commands are Symfony Console commands configured as services:" -msgstr "" +msgstr "Los comandos de consola de Yii3 son comandos de Symfony Console configurados como servicios:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md @@ -1173,75 +1402,90 @@ msgid "" " }\n" "}\n" msgstr "" +"namespace App\\Console;\n" +"\n" +"use Symfony\\Component\\Console\\Attribute\\AsCommand;\n" +"use Symfony\\Component\\Console\\Command\\Command;\n" +"use Symfony\\Component\\Console\\Input\\InputInterface;\n" +"use Symfony\\Component\\Console\\Output\\OutputInterface;\n" +"\n" +"#[AsCommand(name: 'report/send')]\n" +"final class SendReportCommand extends Command\n" +"{\n" +" protected function execute(InputInterface $input, OutputInterface $output): int\n" +" {\n" +" return Command::SUCCESS;\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Console applications](../tutorial/console-applications.md)." -msgstr "" +msgstr "Consulta [Aplicaciones de consola](../tutorial/console-applications.md)." #. type: Title # #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/tutorial/i18n.md -#, fuzzy, no-wrap +#, no-wrap msgid "Internationalization" -msgstr "Introducción" +msgstr "Internacionalización" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "Yii 1.1 message files under `protected/messages` can usually be kept conceptually, but configuration changes. Yii3 uses translator packages and explicit message sources. Move message files into the structure expected by the selected translator message package and inject translation services where needed." -msgstr "" +msgstr "Los archivos de mensajes de Yii 1.1 en `protected/messages` normalmente pueden conservarse a nivel conceptual, pero la configuración cambia. Yii3 usa paquetes de traducción y fuentes de mensajes explícitas. Traslada los archivos de mensajes a la estructura que espera el paquete de mensajes del traductor elegido e inyecta los servicios de traducción donde se necesiten." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "See [Internationalization](../tutorial/i18n.md)." -msgstr "" +msgstr "Consulta [Internacionalización](../tutorial/i18n.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md #, no-wrap msgid "What to refactor before reusing" -msgstr "" +msgstr "Qué refactorizar antes de reutilizar" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "These Yii 1.1 refactorings make the old behavior easier to understand and reuse:" -msgstr "" +msgstr "Estas refactorizaciones de Yii 1.1 hacen que el comportamiento antiguo sea más fácil de entender y de reutilizar:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "isolate database queries from controllers;" -msgstr "" +msgstr "aísla las consultas a la base de datos de los controladores;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "remove direct `Yii::app()` access from domain code;" -msgstr "" +msgstr "elimina el acceso directo a `Yii::app()` del código de dominio;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "move validation out of Active Record when it describes request input rather than database invariants;" -msgstr "" +msgstr "saca la validación de Active Record cuando describa la entrada de la solicitud y no invariantes de la base de datos;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "replace large controller actions with services;" -msgstr "" +msgstr "sustituye las acciones de controlador grandes por servicios;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "document all routes and URL rules;" -msgstr "" +msgstr "documenta todas las rutas y reglas de URL;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "add tests around the flows you plan to rebuild first;" -msgstr "" +msgstr "añade pruebas para los flujos que planeas reconstruir primero;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md msgid "upgrade PHP syntax gradually if the old runtime allows it." -msgstr "" +msgstr "actualiza la sintaxis de PHP de forma gradual si el entorno de ejecución antiguo lo permite." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md msgid "The goal is not to make Yii 1.1 look like Yii3. The goal is to reduce hidden coupling before the code crosses the framework boundary." -msgstr "" +msgstr "El objetivo no es que Yii 1.1 se parezca a Yii3. El objetivo es reducir el acoplamiento oculto antes de que el código cruce la frontera del framework." diff --git a/_translations/po/es/guide_intro_upgrade-from-v2.md.po b/_translations/po/es/guide_intro_upgrade-from-v2.md.po index 8686f392..9fb0304f 100644 --- a/_translations/po/es/guide_intro_upgrade-from-v2.md.po +++ b/_translations/po/es/guide_intro_upgrade-from-v2.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-09-25 14:35+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -21,15 +21,15 @@ msgstr "" #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Project structure" -msgstr "" +msgstr "Estructura del proyecto" #. type: Title ### #: ../src/cookbook/making-http-requests.md ../src/guide/index.md #: ../src/guide/intro/upgrade-from-v2.md ../src/guide/testing/overview.md #: ../src/guide/tutorial/docker.md -#, fuzzy, no-wrap +#, no-wrap msgid "Testing" -msgstr "Pruebas (Testing)" +msgstr "Pruebas" #. type: Fenced code block (json) #: ../src/guide/concept/autoloading.md ../src/guide/intro/upgrade-from-v1.md @@ -69,55 +69,67 @@ msgid "" " ),\n" "];\n" msgstr "" +"use App\\Web;\n" +"use Yiisoft\\Router\\Group;\n" +"use Yiisoft\\Router\\Route;\n" +"\n" +"return [\n" +" Group::create()\n" +" ->routes(\n" +" Route::get('/')\n" +" ->action(Web\\HomePage\\Action::class)\n" +" ->name('home'),\n" +" ),\n" +"];\n" #. type: Title ## #: ../src/guide/index.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "REST APIs" -msgstr "" +msgstr "API REST" #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Recommended approach" -msgstr "" +msgstr "Enfoque recomendado" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "For example, instead of reading post archive data directly from several controllers or widgets, create a small service that describes the application need:" -msgstr "" +msgstr "Por ejemplo, en lugar de leer los datos del histórico de publicaciones directamente desde varios controladores o widgets, crea un pequeño servicio que describa la necesidad de la aplicación:" #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Things to learn before starting" -msgstr "" +msgstr "Qué aprender antes de empezar" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "[Docker](https://www.docker.com/get-started/). The default Yii3 application template includes Docker configuration. Using it gives each application its own repeatable environment and reduces differences between local development and production." -msgstr "" +msgstr "[Docker](https://www.docker.com/get-started/). La plantilla de aplicación predeterminada de Yii3 incluye configuración de Docker. Usarla proporciona a cada aplicación su propio entorno reproducible y reduce las diferencias entre el desarrollo local y producción." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "[Environment variables](https://en.wikipedia.org/wiki/Environment_variable). Yii3 templates commonly use them for environment-specific settings and secrets, especially in Docker-based deployments. This follows the same idea as [12-factor app configuration](https://12factor.net/config)." -msgstr "" +msgstr "[Variables de entorno](https://en.wikipedia.org/wiki/Environment_variable). Las plantillas de Yii3 suelen usarlas para los ajustes específicos de cada entorno y para los secretos, sobre todo en despliegues basados en Docker. Sigue la misma idea que la [configuración de las aplicaciones de 12 factores](https://12factor.net/config)." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "[Actions](../structure/action.md). Yii3 does not require controller inheritance. A route can point to any callable, and the default template uses invokable action classes." -msgstr "" +msgstr "[Acciones](../structure/action.md). Yii3 no exige heredar de un controlador. Una ruta puede apuntar a cualquier callable, y la plantilla predeterminada usa clases de acción invocables." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "Configure your application namespace with PSR-4:" -msgstr "" +msgstr "Configura el espacio de nombres de tu aplicación con PSR-4:" #. type: Fenced code block (shell) #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "composer dump-autoload\n" -msgstr "" +msgstr "composer dump-autoload\n" #. type: Fenced code block (text) #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md @@ -130,31 +142,37 @@ msgid "" "src/\n" "tests/\n" msgstr "" +"assets/\n" +"config/\n" +"public/\n" +"runtime/\n" +"src/\n" +"tests/\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "Typical mappings to consider are:" -msgstr "" +msgstr "Las correspondencias habituales que conviene tener en cuenta son:" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Configuration](../concept/configuration.md), [Aliases](../concept/aliases.md), and [Dependency injection container](../concept/di-container.md)." -msgstr "" +msgstr "Consulta [Configuración](../concept/configuration.md), [Alias](../concept/aliases.md) e [Inyección de dependencias y contenedor](../concept/di-container.md)." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Entry scripts](../structure/entry-script.md) and [Application workflow](../start/workflow.md)." -msgstr "" +msgstr "Consulta [Scripts de entrada](../structure/entry-script.md) y [Flujo de trabajo de la aplicación](../start/workflow.md)." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Actions](../structure/action.md), [Middleware](../structure/middleware.md), and [Routing and URL generation](../runtime/routing.md)." -msgstr "" +msgstr "Consulta [Acciones](../structure/action.md), [Middleware](../structure/middleware.md) y [Enrutamiento y generación de URL](../runtime/routing.md)." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Request](../runtime/request.md), [Response](../runtime/response.md), [Sessions](../runtime/sessions.md), and [Cookies](../runtime/cookies.md)." -msgstr "" +msgstr "Consulta [Solicitud](../runtime/request.md), [Respuesta](../runtime/response.md), [Sesiones](../runtime/sessions.md) y [Cookies](../runtime/cookies.md)." #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md @@ -174,38 +192,51 @@ msgid "" " public ?string $email = null;\n" "}\n" msgstr "" +"use Yiisoft\\FormModel\\FormModel;\n" +"use Yiisoft\\Validator\\Rule\\Email;\n" +"use Yiisoft\\Validator\\Rule\\Required;\n" +"\n" +"final class ContactForm extends FormModel\n" +"{\n" +" #[Required]\n" +" public ?string $name = null;\n" +"\n" +" #[Required]\n" +" #[Email]\n" +" public ?string $email = null;\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Working with forms](../start/forms.md), [Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md), [yiisoft/form](https://github.com/yiisoft/form), and [yiisoft/form-model](https://github.com/yiisoft/form-model)." -msgstr "" +msgstr "Consulta [Trabajar con formularios](../start/forms.md), [Validar la entrada](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md), [yiisoft/form](https://github.com/yiisoft/form) y [yiisoft/form-model](https://github.com/yiisoft/form-model)." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Working with databases](../start/databases.md), [Migrations](../databases/db-migrations.md), and [yiisoft/active-record](https://github.com/yiisoft/active-record)." -msgstr "" +msgstr "Consulta [Trabajar con bases de datos](../start/databases.md), [Migraciones](../databases/db-migrations.md) y [yiisoft/active-record](https://github.com/yiisoft/active-record)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "GridView and data widgets" -msgstr "" +msgstr "GridView y widgets de datos" #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Middleware](../structure/middleware.md), [Authentication](../security/authentication.md), and [Authorization](../security/authorization.md)." -msgstr "" +msgstr "Consulta [Middleware](../structure/middleware.md), [Autenticación](../security/authentication.md) y [Autorización](../security/authorization.md)." #. type: Plain text #: ../src/guide/intro/upgrade-from-v1.md ../src/guide/intro/upgrade-from-v2.md msgid "See [Console applications](../tutorial/console-applications.md)." -msgstr "" +msgstr "Consulta [Aplicaciones de consola](../tutorial/console-applications.md)." #. type: Title # #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Upgrading from Version 2.0" -msgstr "" +msgstr "Actualizar desde la versión 2.0" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md @@ -214,128 +245,124 @@ msgid "" "> If you haven't used Yii 2.0, you can skip this section and get directly to \"[getting started](../start/prerequisites.md)\"\n" "> section.\n" msgstr "" +"> Si no has usado Yii 2.0, puedes saltarte esta sección e ir directamente a la sección\n" +"> \"[primeros pasos](../start/prerequisites.md)\".\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 keeps many Yii ideas, but it is not a drop-in replacement for Yii 2.0. It uses PHP 8 features, PSR interfaces, dependency injection, explicit package composition, and a different application template. Use your Yii 2.0 experience to design a new Yii3 application deliberately instead of trying to reproduce the old application structure." -msgstr "" +msgstr "Yii3 conserva muchas ideas de Yii, pero no es un sustituto directo de Yii 2.0. Usa funcionalidades de PHP 8, interfaces PSR, inyección de dependencias, composición explícita de paquetes y una plantilla de aplicación diferente. Aprovecha tu experiencia con Yii 2.0 para diseñar de forma deliberada una nueva aplicación Yii3, en lugar de intentar reproducir la estructura de la aplicación antigua." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "For source applications, compare against:" -msgstr "" +msgstr "Para la aplicación de origen, toma como referencia:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[yiisoft/yii2-app-basic](https://github.com/yiisoft/yii2-app-basic)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[yiisoft/yii2-app-basic](https://github.com/yiisoft/yii2-app-basic)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[yiisoft/yii2-app-advanced](https://github.com/yiisoft/yii2-app-advanced)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[yiisoft/yii2-app-advanced](https://github.com/yiisoft/yii2-app-advanced)" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "For the target structure, compare against:" -msgstr "" +msgstr "Para la estructura de destino, toma como referencia:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy -#| msgid "[Validating input](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md) +" msgid "[yiisoft/app](https://github.com/yiisoft/app)" -msgstr "[Validar Datos](https://github.com/yiisoft/validator/blob/master/docs/guide/en/README.md)" +msgstr "[yiisoft/app](https://github.com/yiisoft/app)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Yii3 guide](../index.md)" -msgstr "" +msgstr "[Guía de Yii3](../index.md)" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Before starting, [check maintenance policy and end-of-life dates for Yii 2.0](https://www.yiiframework.com/release-cycle). Keeping a mature Yii 2.0 application on Yii 2.0 can be a valid choice. A Yii3 project is most useful when you want the new package ecosystem, stricter typing, PSR middleware, and a more explicit architecture." -msgstr "" +msgstr "Antes de empezar, [consulta la política de mantenimiento y las fechas de fin de vida de Yii 2.0](https://www.yiiframework.com/release-cycle). Mantener en Yii 2.0 una aplicación Yii 2.0 madura puede ser una opción válida. Un proyecto Yii3 resulta más útil cuando quieres el nuevo ecosistema de paquetes, un tipado más estricto, middleware PSR y una arquitectura más explícita." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Think of the work as building a Yii3 application that is informed by the old one. The old project tells you which routes, forms, database tables, business rules, and user workflows matter. The Yii3 project should decide again where these responsibilities belong." -msgstr "" +msgstr "Plantéate el trabajo como la construcción de una aplicación Yii3 que se apoya en lo aprendido con la antigua. El proyecto antiguo te dice qué rutas, formularios, tablas de la base de datos, reglas de negocio y flujos de trabajo de los usuarios importan. El proyecto Yii3 debe decidir de nuevo dónde van esas responsabilidades." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Build it in vertical slices:" -msgstr "" +msgstr "Constrúyela por porciones verticales:" #. type: Bullet: '1. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Create a new Yii3 application with `yiisoft/app`." -msgstr "" +msgstr "Crea una nueva aplicación Yii3 con `yiisoft/app`." #. type: Bullet: '2. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Configure Composer autoloading and add only the code needed for the slice you are building." -msgstr "" +msgstr "Configura la autocarga de Composer y añade solo el código necesario para la porción que estás construyendo." #. type: Bullet: '3. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Define configuration and routes before writing actions." -msgstr "" +msgstr "Define la configuración y las rutas antes de escribir las acciones." #. type: Bullet: '4. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Build one request flow at a time: route, action, input model, service, persistence, view, assets, tests." -msgstr "" +msgstr "Construye un flujo de solicitud cada vez: ruta, acción, modelo de entrada, servicio, persistencia, vista, assets y pruebas." #. type: Bullet: '5. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Keep the Yii 2.0 application running until each flow is verified in Yii3." -msgstr "" +msgstr "Mantén la aplicación Yii 2.0 en funcionamiento hasta haber verificado cada flujo en Yii3." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Avoid moving the whole directory tree first. Yii3's defaults are intentionally different, and a mechanical copy tends to preserve Yii 2.0 service-locator assumptions. Prefer small, reviewed decisions over carrying old structure forward because it is familiar." -msgstr "" +msgstr "Evita trasladar primero todo el árbol de directorios. Los valores predeterminados de Yii3 son distintos a propósito, y una copia mecánica tiende a conservar las suposiciones de Yii 2.0 basadas en el localizador de servicios. Es preferible tomar decisiones pequeñas y revisadas que arrastrar la estructura antigua solo porque resulta familiar." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Prepare the Yii 2.0 application" -msgstr "" +msgstr "Preparar la aplicación Yii 2.0" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Useful preparation can happen before the Yii3 application is ready. These refactorings improve the Yii 2.0 project itself and make the later rewrite less dependent on hidden framework state:" -msgstr "" +msgstr "Parte de la preparación útil puede hacerse antes de que la aplicación Yii3 esté lista. Estas refactorizaciones mejoran el propio proyecto Yii 2.0 y hacen que la reescritura posterior dependa menos del estado oculto del framework:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Replace `Yii::$app` access in reusable code with constructor arguments where practical. If a full dependency injection refactoring is too large, keep `Yii::$app` calls near controllers and widgets, then pass values and services to lower-level code explicitly." -msgstr "" +msgstr "Sustituye el acceso a `Yii::$app` en el código reutilizable por argumentos del constructor cuando sea viable. Si una refactorización completa hacia la inyección de dependencias es demasiado grande, mantén las llamadas a `Yii::$app` cerca de los controladores y widgets, y pasa explícitamente los valores y servicios al código de nivel inferior." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Introduce repositories or query services for database reads that are currently scattered across controllers, views, widgets, and Active Record methods. Yii3 does not require Active Record for persistence, so a repository boundary gives you a natural place to change the implementation later." -msgstr "" +msgstr "Introduce repositorios o servicios de consulta para las lecturas de la base de datos que ahora están repartidas entre controladores, vistas, widgets y métodos de Active Record. Yii3 no exige Active Record para la persistencia, así que la frontera de un repositorio te da un lugar natural para cambiar la implementación más adelante." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Separate business rules from framework infrastructure. Domain code that does not extend Yii classes, read global application state, or render views is much easier to reuse or rewrite." -msgstr "" +msgstr "Separa las reglas de negocio de la infraestructura del framework. El código de dominio que no extiende clases de Yii, no lee el estado global de la aplicación ni renderiza vistas es mucho más fácil de reutilizar o reescribir." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Move reusable behavior into Yii 2.0 components or services instead of keeping it inside large controllers and Active Record classes. Yii3 services are configured and injected differently, but the responsibility boundary is similar." -msgstr "" +msgstr "Traslada el comportamiento reutilizable a componentes o servicios de Yii 2.0 en lugar de mantenerlo dentro de controladores grandes y clases Active Record. Los servicios de Yii3 se configuran e inyectan de otra manera, pero el reparto de responsabilidades es similar." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Add tests around routes and workflows you plan to rebuild first. They become the executable specification for the Yii3 slice." -msgstr "" +msgstr "Añade pruebas para las rutas y los flujos de trabajo que planeas reconstruir primero. Se convertirán en la especificación ejecutable de la porción de Yii3." #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -354,102 +381,114 @@ msgid "" " }\n" "}\n" msgstr "" +"final class PostRepository\n" +"{\n" +" public function getArchive(): array\n" +" {\n" +" // ...\n" +" }\n" +"\n" +" public function getTopForFrontPage(int $limit = 10): array\n" +" {\n" +" // ...\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "The Yii3 implementation may still use Active Record, or it may use `yiisoft/db` queries. The important point is that controllers and views no longer need to know that detail." -msgstr "" +msgstr "La implementación de Yii3 puede seguir usando Active Record, o puede usar consultas de `yiisoft/db`. Lo importante es que los controladores y las vistas ya no necesiten conocer ese detalle." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Some Yii3 application-template choices are worth learning before you start moving features:" -msgstr "" +msgstr "Merece la pena conocer algunas decisiones de la plantilla de aplicación de Yii3 antes de empezar a trasladar funcionalidades:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Application structure](../structure/overview.md). Yii3's default structure is different from Yii 2.0. The structure is flexible, but start with the Yii3 template and change it only when the application needs it." -msgstr "" +msgstr "[Estructura de la aplicación](../structure/overview.md). La estructura predeterminada de Yii3 es distinta de la de Yii 2.0. La estructura es flexible, pero empieza con la plantilla de Yii3 y cámbiala solo cuando la aplicación lo necesite." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "PHP requirements" -msgstr "" +msgstr "Requisitos de PHP" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 application templates require PHP 8.2 or above. As a result, application code can use language features that were not common in Yii 2.0 applications:" -msgstr "" +msgstr "Las plantillas de aplicación de Yii3 requieren PHP 8.2 o superior. Por ello, el código de la aplicación puede usar funcionalidades del lenguaje que no eran habituales en las aplicaciones Yii 2.0:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Type declarations](https://www.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration)" -msgstr "" +msgstr "[Declaraciones de tipo](https://www.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Return type declarations](https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration)" -msgstr "" +msgstr "[Declaraciones de tipo de retorno](https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Class constant visibility](https://www.php.net/manual/en/language.oop5.constants.php)" -msgstr "" +msgstr "[Visibilidad de las constantes de clase](https://www.php.net/manual/en/language.oop5.constants.php)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Named arguments](https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments)" -msgstr "" +msgstr "[Argumentos con nombre](https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Anonymous classes](https://www.php.net/manual/en/language.oop5.anonymous.php)" -msgstr "" +msgstr "[Clases anónimas](https://www.php.net/manual/en/language.oop5.anonymous.php)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[::class](https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class)" -msgstr "" +msgstr "[::class](https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Generators](https://www.php.net/manual/en/language.generators.php)" -msgstr "" +msgstr "[Generadores](https://www.php.net/manual/en/language.generators.php)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Variadic functions](https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list)" -msgstr "" +msgstr "[Funciones variádicas](https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Readonly properties](https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.readonly-properties)" -msgstr "" +msgstr "[Propiedades de solo lectura](https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.readonly-properties)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Readonly classes](https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.readonly)" -msgstr "" +msgstr "[Clases de solo lectura](https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.readonly)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Constructor property promotion](https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion)" -msgstr "" +msgstr "[Promoción de propiedades en el constructor](https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion)" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "[Attributes](https://www.php.net/manual/en/language.attributes.php)" -msgstr "" +msgstr "[Atributos](https://www.php.net/manual/en/language.attributes.php)" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Run static analysis and tests on Yii 2.0 before reusing code in Yii3. Code with explicit types, small services, and few implicit `Yii::$app` dependencies is easier to understand and easier to place in the new application." -msgstr "" +msgstr "Ejecuta el análisis estático y las pruebas en Yii 2.0 antes de reutilizar código en Yii3. El código con tipos explícitos, servicios pequeños y pocas dependencias implícitas de `Yii::$app` es más fácil de entender y de ubicar en la nueva aplicación." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 applications commonly keep framework roles in top-level directories:" -msgstr "" +msgstr "Las aplicaciones Yii 2.0 suelen organizar los roles del framework en directorios de primer nivel:" #. type: Fenced code block (text) #: ../src/guide/intro/upgrade-from-v2.md @@ -465,11 +504,20 @@ msgid "" "web/\n" "widgets/\n" msgstr "" +"assets/\n" +"commands/\n" +"config/\n" +"controllers/\n" +"models/\n" +"runtime/\n" +"views/\n" +"web/\n" +"widgets/\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "The Yii 2.0 advanced template splits the same roles by application:" -msgstr "" +msgstr "La plantilla avanzada de Yii 2.0 divide esos mismos roles por aplicación:" #. type: Fenced code block (text) #: ../src/guide/intro/upgrade-from-v2.md @@ -480,11 +528,15 @@ msgid "" "console/\n" "frontend/\n" msgstr "" +"backend/\n" +"common/\n" +"console/\n" +"frontend/\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "The current Yii3 application template is organized around source code, configuration, public files, and runtime files:" -msgstr "" +msgstr "La plantilla de aplicación actual de Yii3 se organiza en torno al código fuente, la configuración, los archivos públicos y los archivos de tiempo de ejecución:" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md @@ -501,44 +553,53 @@ msgid "" "| `commands/` | `console/controllers/` | `src/Console/*Command.php` |\n" "| `config/*.php` | app and common config files | `config/common`, `config/web`, `config/console`, `config/environments` |\n" msgstr "" +"| Yii 2.0 básica | Yii 2.0 avanzada | Yii3 |\n" +"|---------------|------------------|------|\n" +"| `controllers/` | `frontend/controllers/`, `backend/controllers/` | `src/Web/*/Action.php` o clases similares a controladores |\n" +"| `models/` | `common/models/`, modelos específicos de cada aplicación | `src/Domain`, `src/Shared`, `src/Web/*` o `src/Db`, según la responsabilidad |\n" +"| `views/` | `frontend/views/`, `backend/views/` | plantillas junto a la funcionalidad, por ejemplo `src/Web/HomePage/template.php` |\n" +"| `views/layouts/` | directorios de layouts de cada aplicación | clases/plantillas de layout, por ejemplo `src/Web/Shared/Layout/Main` |\n" +"| `assets/` | paquetes de assets de cada aplicación | `assets/` para los archivos fuente y `src/Web/.../*Asset.php` para los paquetes |\n" +"| `web/` | `frontend/web/`, `backend/web/` | `public/` |\n" +"| `commands/` | `console/controllers/` | `src/Console/*Command.php` |\n" +"| `config/*.php` | archivos de configuración comunes y de cada aplicación | `config/common`, `config/web`, `config/console`, `config/environments` |\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "There is no single required layout. The important change is that Yii3 applications should group code by responsibility and make dependencies explicit. If you are coming from the advanced template, treat `frontend` and `backend` as separate web contexts. Shared domain code can live in `src/Shared` or in application-specific packages." -msgstr "" +msgstr "No hay una única estructura obligatoria. El cambio importante es que las aplicaciones Yii3 deben agrupar el código por responsabilidad y hacer explícitas las dependencias. Si vienes de la plantilla avanzada, trata `frontend` y `backend` como contextos web independientes. El código de dominio compartido puede estar en `src/Shared` o en paquetes específicos de la aplicación." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy, no-wrap -#| msgid "Class autoloading" +#, no-wrap msgid "Composer and autoloading" -msgstr "Autocarga de Clases (Autoloading)" +msgstr "Composer y autocarga" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 applications usually require `vendor/autoload.php` and `vendor/yiisoft/yii2/Yii.php` in `web/index.php`. Yii3 applications require only Composer's autoloader and application bootstrap code." -msgstr "" +msgstr "Las aplicaciones Yii 2.0 suelen incluir `vendor/autoload.php` y `vendor/yiisoft/yii2/Yii.php` en `web/index.php`. Las aplicaciones Yii3 solo incluyen el cargador automático de Composer y el código de arranque de la aplicación." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Then rebuild Composer autoload files:" -msgstr "" +msgstr "Después, vuelve a generar los archivos de autocarga de Composer:" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Install Yii3 packages intentionally. Yii3 is split into focused packages, so features such as database access, forms, validation, assets, data widgets, authentication, and caching are separate Composer dependencies." -msgstr "" +msgstr "Instala los paquetes de Yii3 de forma deliberada. Yii3 está dividido en paquetes especializados, así que funcionalidades como el acceso a bases de datos, los formularios, la validación, los assets, los widgets de datos, la autenticación y la caché son dependencias de Composer independientes." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Configuration and services" -msgstr "" +msgstr "Configuración y servicios" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "In Yii 2.0, many services are configured as application components and accessed through the service locator:" -msgstr "" +msgstr "En Yii 2.0, muchos servicios se configuran como componentes de la aplicación y se accede a ellos a través del localizador de servicios:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -548,11 +609,14 @@ msgid "" "$db = Yii::$app->db;\n" "$url = Yii::$app->urlManager->createUrl(['post/view', 'id' => $id]);\n" msgstr "" +"$cache = Yii::$app->cache;\n" +"$db = Yii::$app->db;\n" +"$url = Yii::$app->urlManager->createUrl(['post/view', 'id' => $id]);\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "In Yii3, services are configured for the container and injected where they are needed:" -msgstr "" +msgstr "En Yii3, los servicios se configuran para el contenedor y se inyectan allí donde se necesitan:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -572,70 +636,75 @@ msgid "" " }\n" "}\n" msgstr "" +"use Psr\\SimpleCache\\CacheInterface;\n" +"use Yiisoft\\Db\\Connection\\ConnectionInterface;\n" +"use Yiisoft\\Router\\UrlGeneratorInterface;\n" +"\n" +"final readonly class PostService\n" +"{\n" +" public function __construct(\n" +" private ConnectionInterface $db,\n" +" private CacheInterface $cache,\n" +" private UrlGeneratorInterface $urlGenerator,\n" +" ) {\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy -#| msgid "Introduction +" msgid "Move configuration in groups:" -msgstr "Introducción" +msgstr "Traslada la configuración por grupos:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "aliases to `config/common/aliases.php`;" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "los alias, a `config/common/aliases.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "route definitions to `config/common/routes.php`;" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "las definiciones de rutas, a `config/common/routes.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "shared service definitions to `config/common/di/*.php`;" -msgstr "" +msgstr "las definiciones de servicios compartidas, a `config/common/di/*.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "web-only service definitions to `config/web/di/*.php`;" -msgstr "" +msgstr "las definiciones de servicios exclusivas de la web, a `config/web/di/*.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "console parameters and commands to `config/console/*.php`;" -msgstr "" +msgstr "los parámetros y comandos de consola, a `config/console/*.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "shared parameters to `config/common/params.php`;" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "los parámetros compartidos, a `config/common/params.php`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "environment overrides to `config/environments`." -msgstr "" +msgstr "las sobrescrituras por entorno, a `config/environments`." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "The default template's `di-console` group reuses shared definitions from `config/common/di/*.php`. If you need console-only container definitions, add the corresponding files to the `di-console` group in `config/configuration.php` and rebuild the merge plan." -msgstr "" +msgstr "El grupo `di-console` de la plantilla predeterminada reutiliza las definiciones compartidas de `config/common/di/*.php`. Si necesitas definiciones del contenedor exclusivas de la consola, añade los archivos correspondientes al grupo `di-console` en `config/configuration.php` y vuelve a generar el plan de fusión." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Entry script and bootstrap" -msgstr "" +msgstr "Script de entrada y arranque" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "A Yii 2.0 basic entry script commonly creates the application directly:" -msgstr "" +msgstr "Un script de entrada de la plantilla básica de Yii 2.0 suele crear la aplicación directamente:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -651,22 +720,31 @@ msgid "" "\n" "(new yii\\web\\Application($config))->run();\n" msgstr "" +"defined('YII_DEBUG') or define('YII_DEBUG', true);\n" +"defined('YII_ENV') or define('YII_ENV', 'dev');\n" +"\n" +"require __DIR__ . '/../vendor/autoload.php';\n" +"require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';\n" +"\n" +"$config = require __DIR__ . '/../config/web.php';\n" +"\n" +"(new yii\\web\\Application($config))->run();\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "In Yii3, use the application template entry script as the source of truth. It loads Composer and bootstraps the configured application runner. Avoid recreating the old `yii\\web\\Application` pattern in `public/index.php`; put configuration in config files and dependencies in the container." -msgstr "" +msgstr "En Yii3, toma como referencia el script de entrada de la plantilla de aplicación. Carga Composer y arranca el ejecutor (runner) de la aplicación configurado. Evita recrear el antiguo patrón `yii\\web\\Application` en `public/index.php`; pon la configuración en los archivos de configuración y las dependencias en el contenedor." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Controllers, actions, and routing" -msgstr "" +msgstr "Controladores, acciones y enrutamiento" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 routes usually point to controller action methods:" -msgstr "" +msgstr "En Yii 2.0, las rutas suelen apuntar a métodos de acción de controladores:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -684,34 +762,26 @@ msgid "" " }\n" "}\n" msgstr "" +"namespace app\\controllers;\n" +"\n" +"use yii\\web\\Controller;\n" +"\n" +"final class SiteController extends Controller\n" +"{\n" +" public function actionIndex(): string\n" +" {\n" +" return $this->render('index');\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 does not require controller base classes. The current application template uses invokable action classes:" -msgstr "" +msgstr "Yii3 no requiere clases base de controlador. La plantilla de aplicación actual usa clases de acción invocables:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy, no-wrap -#| msgid "" -#| "use Psr\\EventDispatcher\\EventDispatcherInterface;\n" -#| "\n" -#| "final readonly class SignupService\n" -#| "{\n" -#| " public function __construct(\n" -#| " private EventDispatcherInterface $eventDispatcher\n" -#| " )\n" -#| " {\n" -#| " }\n" -#| "\n" -#| " public function signup(SignupForm $form)\n" -#| " {\n" -#| " // handle signup\n" -#| "\n" -#| " $event = new UserSignedUp($form);\n" -#| " $this->eventDispatcher->dispatch($event);\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "namespace App\\Web\\HomePage;\n" "\n" @@ -731,45 +801,44 @@ msgid "" " }\n" "}\n" msgstr "" -"use Psr\\EventDispatcher\\EventDispatcherInterface;\n" +"namespace App\\Web\\HomePage;\n" "\n" -"final readonly class SignupService\n" +"use Psr\\Http\\Message\\ResponseInterface;\n" +"use Yiisoft\\Yii\\View\\Renderer\\WebViewRenderer;\n" +"\n" +"final readonly class Action\n" "{\n" " public function __construct(\n" -" private EventDispatcherInterface $eventDispatcher\n" -" )\n" -" {\n" +" private WebViewRenderer $viewRenderer,\n" +" ) {\n" " }\n" "\n" -" public function signup(SignupForm $form)\n" +" public function __invoke(): ResponseInterface\n" " {\n" -" // handle signup\n" -"\n" -" $event = new UserSignedUp($form);\n" -" $this->eventDispatcher->dispatch($event);\n" +" return $this->viewRenderer->render(__DIR__ . '/template');\n" " }\n" "}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Routes are explicit:" -msgstr "" +msgstr "Las rutas son explícitas:" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "When redesigning a controller flow, list all Yii 2.0 actions and create named routes for the flows you still need. Then implement each flow as an invokable class or a controller-like service. Constructor injection replaces calls to `Yii::$app` and controller properties." -msgstr "" +msgstr "Al rediseñar el flujo de un controlador, enumera todas las acciones de Yii 2.0 y crea rutas con nombre para los flujos que todavía necesites. Después, implementa cada flujo como una clase invocable o como un servicio similar a un controlador. La inyección por constructor sustituye a las llamadas a `Yii::$app` y a las propiedades del controlador." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Requests, responses, sessions, and cookies" -msgstr "" +msgstr "Solicitudes, respuestas, sesiones y cookies" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 actions often read request data and write response data through application components:" -msgstr "" +msgstr "Las acciones de Yii 2.0 suelen leer los datos de la solicitud y escribir los de la respuesta a través de componentes de la aplicación:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -780,34 +849,19 @@ msgid "" "\n" "return $this->redirect(['post/view', 'id' => $id]);\n" msgstr "" +"$id = Yii::$app->request->get('id');\n" +"Yii::$app->session->setFlash('success', 'Saved.');\n" +"\n" +"return $this->redirect(['post/view', 'id' => $id]);\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 uses PSR-7 request and response objects and injectable services:" -msgstr "" +msgstr "Yii3 usa objetos de solicitud y respuesta PSR-7 y servicios inyectables:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md -#, fuzzy, no-wrap -#| msgid "" -#| "use Psr\\EventDispatcher\\EventDispatcherInterface;\n" -#| "\n" -#| "final readonly class SignupService\n" -#| "{\n" -#| " public function __construct(\n" -#| " private EventDispatcherInterface $eventDispatcher\n" -#| " )\n" -#| " {\n" -#| " }\n" -#| "\n" -#| " public function signup(SignupForm $form)\n" -#| " {\n" -#| " // handle signup\n" -#| "\n" -#| " $event = new UserSignedUp($form);\n" -#| " $this->eventDispatcher->dispatch($event);\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "use Psr\\Http\\Message\\ResponseInterface;\n" "use Psr\\Http\\Message\\ResponseFactoryInterface;\n" @@ -834,40 +888,46 @@ msgid "" " }\n" "}\n" msgstr "" -"use Psr\\EventDispatcher\\EventDispatcherInterface;\n" +"use Psr\\Http\\Message\\ResponseInterface;\n" +"use Psr\\Http\\Message\\ResponseFactoryInterface;\n" +"use Psr\\Http\\Message\\ServerRequestInterface;\n" +"use Yiisoft\\Http\\Status;\n" +"use Yiisoft\\Router\\UrlGeneratorInterface;\n" "\n" -"final readonly class SignupService\n" +"final readonly class SavePostAction\n" "{\n" " public function __construct(\n" -" private EventDispatcherInterface $eventDispatcher\n" -" )\n" -" {\n" +" private ResponseFactoryInterface $responseFactory,\n" +" private UrlGeneratorInterface $urlGenerator,\n" +" ) {\n" " }\n" "\n" -" public function signup(SignupForm $form)\n" +" public function __invoke(ServerRequestInterface $request): ResponseInterface\n" " {\n" -" // handle signup\n" +" $id = (int) ($request->getQueryParams()['id'] ?? 0);\n" +" $url = $this->urlGenerator->generate('post/view', ['id' => $id]);\n" "\n" -" $event = new UserSignedUp($form);\n" -" $this->eventDispatcher->dispatch($event);\n" +" return $this->responseFactory\n" +" ->createResponse(Status::SEE_OTHER)\n" +" ->withHeader('Location', $url);\n" " }\n" "}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Design request handling early because it affects forms, filters, REST endpoints, redirects, and tests." -msgstr "" +msgstr "Diseña pronto el manejo de las solicitudes, porque afecta a los formularios, los filtros, los endpoints REST, las redirecciones y las pruebas." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Views, layouts, assets, and URLs" -msgstr "" +msgstr "Vistas, layouts, assets y URL" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "In Yii 2.0, controller rendering finds files under `views/{controller}` and layouts under `views/layouts`:" -msgstr "" +msgstr "En Yii 2.0, el renderizado del controlador busca los archivos en `views/{controller}` y los layouts en `views/layouts`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -877,11 +937,14 @@ msgid "" " 'model' => $model,\n" "]);\n" msgstr "" +"return $this->render('view', [\n" +" 'model' => $model,\n" +"]);\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "In Yii3, the template path is explicit in the action:" -msgstr "" +msgstr "En Yii3, la ruta de la plantilla es explícita en la acción:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -891,11 +954,14 @@ msgid "" " 'post' => $post,\n" "]);\n" msgstr "" +"return $this->viewRenderer->render(__DIR__ . '/view', [\n" +" 'post' => $post,\n" +"]);\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "A Yii3 template receives a `Yiisoft\\View\\WebView` instance as `$this`:" -msgstr "" +msgstr "Una plantilla de Yii3 recibe una instancia de `Yiisoft\\View\\WebView` como `$this`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -916,11 +982,25 @@ msgid "" "\n" "

\n" msgstr "" +"use App\\Shared\\ApplicationParams;\n" +"use Yiisoft\\Html\\Html;\n" +"use Yiisoft\\View\\WebView;\n" +"\n" +"/**\n" +" * @var WebView $this\n" +" * @var ApplicationParams $applicationParams\n" +" * @var string $title\n" +" */\n" +"\n" +"$this->setTitle($title . ' - ' . $applicationParams->name);\n" +"?>\n" +"\n" +"

\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Asset bundles move from `yii\\web\\AssetBundle` to `Yiisoft\\Assets\\AssetBundle`:" -msgstr "" +msgstr "Los paquetes de assets pasan de `yii\\web\\AssetBundle` a `Yiisoft\\Assets\\AssetBundle`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -941,11 +1021,25 @@ msgid "" " ];\n" "}\n" msgstr "" +"namespace App\\Web\\Shared\\Layout\\Main;\n" +"\n" +"use Yiisoft\\Assets\\AssetBundle;\n" +"\n" +"final class MainAsset extends AssetBundle\n" +"{\n" +" public ?string $basePath = '@assets/main';\n" +" public ?string $baseUrl = '@assetsUrl/main';\n" +" public ?string $sourcePath = '@assetsSource/main';\n" +"\n" +" public array $css = [\n" +" 'site.css',\n" +" ];\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Register assets in a layout or view via the asset manager:" -msgstr "" +msgstr "Registra los assets en un layout o una vista mediante el gestor de assets:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -956,6 +1050,10 @@ msgid "" "$this->addCssFiles($assetManager->getCssFiles());\n" "$this->addJsFiles($assetManager->getJsFiles());\n" msgstr "" +"$assetManager->register(MainAsset::class);\n" +"\n" +"$this->addCssFiles($assetManager->getCssFiles());\n" +"$this->addJsFiles($assetManager->getJsFiles());\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md @@ -964,28 +1062,30 @@ msgid "" "Replace `yii\\helpers\\Url` and `Yii::$app->urlManager` usage with named routes and\n" "`Yiisoft\\Router\\UrlGeneratorInterface`:\n" msgstr "" +"Sustituye el uso de `yii\\helpers\\Url` y `Yii::$app->urlManager` por rutas con nombre y\n" +"`Yiisoft\\Router\\UrlGeneratorInterface`:\n" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "$url = $urlGenerator->generate('post/view', ['id' => $post->getId()]);\n" -msgstr "" +msgstr "$url = $urlGenerator->generate('post/view', ['id' => $post->getId()]);\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "See [View](../views/view.md), [Assets](../views/asset.md), [Scripts, styles and metatags](../views/script-style-meta.md), and [Template engines](../views/template-engines.md)." -msgstr "" +msgstr "Consulta [Vistas](../views/view.md), [Assets](../views/asset.md), [Scripts, estilos y metaetiquetas](../views/script-style-meta.md) y [Motores de plantillas](../views/template-engines.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Forms and validation" -msgstr "" +msgstr "Formularios y validación" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 frequently combines form data, labels, validation, and sometimes persistence in a `yii\\base\\Model` or `yii\\db\\ActiveRecord` class:" -msgstr "" +msgstr "Yii 2.0 a menudo combina los datos del formulario, las etiquetas, la validación y, a veces, la persistencia en una clase `yii\\base\\Model` o `yii\\db\\ActiveRecord`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1005,42 +1105,55 @@ msgid "" " }\n" "}\n" msgstr "" +"final class ContactForm extends \\yii\\base\\Model\n" +"{\n" +" public $name;\n" +" public $email;\n" +"\n" +" public function rules(): array\n" +" {\n" +" return [\n" +" [['name', 'email'], 'required'],\n" +" ['email', 'email'],\n" +" ];\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 separates these concerns. Use `yiisoft/form-model` for form data and metadata, and `yiisoft/validator` for rules:" -msgstr "" +msgstr "Yii3 separa estas responsabilidades. Usa `yiisoft/form-model` para los datos y metadatos del formulario, y `yiisoft/validator` para las reglas:" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "For form rendering, replace `yii\\widgets\\ActiveForm` with `yiisoft/form` fields and form model integration. For input hydration, prefer the form-model and hydrator packages instead of mass-assigning arbitrary request data to persistence objects." -msgstr "" +msgstr "Para renderizar formularios, sustituye `yii\\widgets\\ActiveForm` por los campos de `yiisoft/form` y su integración con los modelos de formulario. Para hidratar la entrada, es preferible usar los paquetes form-model e hydrator en lugar de asignar de forma masiva datos arbitrarios de la solicitud a objetos de persistencia." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Active Record and persistence" -msgstr "" +msgstr "Active Record y persistencia" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "There are two common Yii3 choices for code that used Yii 2.0 Active Record classes." -msgstr "" +msgstr "Hay dos opciones habituales en Yii3 para el código que usaba clases Active Record de Yii 2.0." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "The first path is architectural: move business logic to services and domain objects, then use repositories for persistence. This is recommended when the Yii 2.0 model contains validation, form scenarios, authorization checks, mailing, file uploads, and database access in the same class." -msgstr "" +msgstr "El primer camino es arquitectónico: traslada la lógica de negocio a servicios y objetos de dominio, y después usa repositorios para la persistencia. Es lo recomendable cuando el modelo de Yii 2.0 contiene en la misma clase validación, escenarios de formulario, comprobaciones de autorización, envío de correo, subida de archivos y acceso a la base de datos." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "The second path is incremental: represent the database model with [yiisoft/active-record](https://github.com/yiisoft/active-record). This is closer to Yii 2.0 and can be significantly faster when your Active Record classes mostly describe tables and relations." -msgstr "" +msgstr "El segundo camino es incremental: representa el modelo de la base de datos con [yiisoft/active-record](https://github.com/yiisoft/active-record). Se parece más a Yii 2.0 y puede ser bastante más rápido cuando tus clases Active Record se limitan sobre todo a describir tablas y relaciones." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0:" -msgstr "" +msgstr "Yii 2.0:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1062,11 +1175,26 @@ msgid "" " }\n" "}\n" msgstr "" +"final class Post extends \\yii\\db\\ActiveRecord\n" +"{\n" +" public static function tableName(): string\n" +" {\n" +" return '{{%post}}';\n" +" }\n" +"\n" +" public function rules(): array\n" +" {\n" +" return [\n" +" [['title', 'body'], 'required'],\n" +" ['title', 'string', 'max' => 255],\n" +" ];\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 Active Record:" -msgstr "" +msgstr "Active Record de Yii3:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1101,11 +1229,39 @@ msgid "" " }\n" "}\n" msgstr "" +"use Yiisoft\\ActiveRecord\\ActiveRecord;\n" +"\n" +"final class Post extends ActiveRecord\n" +"{\n" +" protected int $id;\n" +" protected string $title;\n" +" protected string $body;\n" +"\n" +" public function tableName(): string\n" +" {\n" +" return '{{%post}}';\n" +" }\n" +"\n" +" public function getId(): ?int\n" +" {\n" +" return $this->id ?? null;\n" +" }\n" +"\n" +" public function getTitle(): ?string\n" +" {\n" +" return $this->title ?? null;\n" +" }\n" +"\n" +" public function setTitle(string $title): void\n" +" {\n" +" $this->title = $title;\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Do not move Yii 2.0 `rules()` directly into the Active Record class. In Yii3, validation belongs to validator rules, form models, command objects, or services:" -msgstr "" +msgstr "No traslades `rules()` de Yii 2.0 directamente a la clase Active Record. En Yii3, la validación corresponde a las reglas del validador, los modelos de formulario, los objetos de comando o los servicios:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1125,11 +1281,24 @@ msgid "" " public ?string $body = null;\n" "}\n" msgstr "" +"use Yiisoft\\FormModel\\FormModel;\n" +"use Yiisoft\\Validator\\Rule\\Length;\n" +"use Yiisoft\\Validator\\Rule\\Required;\n" +"\n" +"final class PostInput extends FormModel\n" +"{\n" +" #[Required]\n" +" #[Length(max: 255)]\n" +" public ?string $title = null;\n" +"\n" +" #[Required]\n" +" public ?string $body = null;\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Then copy validated data into the record or pass it to an application service:" -msgstr "" +msgstr "Después, copia los datos validados en el registro o pásalos a un servicio de la aplicación:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1139,56 +1308,59 @@ msgid "" "$post->setTitle($input->title);\n" "$post->save();\n" msgstr "" +"$post = new Post();\n" +"$post->setTitle($input->title);\n" +"$post->save();\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "When deciding what to reuse, check each Active Record method:" -msgstr "" +msgstr "Para decidir qué reutilizar, revisa cada método de Active Record:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "table mapping and relations can usually move to `yiisoft/active-record`;" -msgstr "" +msgstr "el mapeo de tablas y las relaciones normalmente pueden pasar a `yiisoft/active-record`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "validation should move to `yiisoft/validator`;" -msgstr "" +msgstr "la validación debe pasar a `yiisoft/validator`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "form labels and hints should move to `yiisoft/form-model`;" -msgstr "" +msgstr "las etiquetas y los textos de ayuda de los formularios deben pasar a `yiisoft/form-model`;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "search models should become query/data-reader services;" -msgstr "" +msgstr "los modelos de búsqueda deben convertirse en servicios de consulta o de lectura de datos;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "business workflows should become services;" -msgstr "" +msgstr "los flujos de negocio deben convertirse en servicios;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "events should use PSR-14 events or package-specific events;" -msgstr "" +msgstr "los eventos deben usar eventos PSR-14 o eventos específicos del paquete;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "direct `Yii::$app->db` usage should become injected database dependencies." -msgstr "" +msgstr "el uso directo de `Yii::$app->db` debe convertirse en dependencias de base de datos inyectadas." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 migrations and Yii3 `yiisoft/db-migration` migrations are not compatible. Start a new migration history or create structure dumps for the current schema, then use Yii3 migrations for future schema changes." -msgstr "" +msgstr "Las migraciones de Yii 2.0 y las migraciones de `yiisoft/db-migration` de Yii3 no son compatibles. Empieza un nuevo historial de migraciones o crea volcados de la estructura del esquema actual y, después, usa las migraciones de Yii3 para los futuros cambios del esquema." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 `GridView` is commonly used with `ActiveDataProvider`:" -msgstr "" +msgstr "En Yii 2.0, `GridView` se usa habitualmente con `ActiveDataProvider`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1207,11 +1379,23 @@ msgid "" " ],\n" "]);\n" msgstr "" +"use yii\\grid\\GridView;\n" +"\n" +"echo GridView::widget([\n" +" 'dataProvider' => $dataProvider,\n" +" 'filterModel' => $searchModel,\n" +" 'columns' => [\n" +" 'id',\n" +" 'title',\n" +" 'created_at:datetime',\n" +" ['class' => 'yii\\grid\\ActionColumn'],\n" +" ],\n" +"]);\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 uses [yiisoft/yii-dataview](https://github.com/yiisoft/yii-dataview). It renders data from a data reader and uses fluent widget configuration:" -msgstr "" +msgstr "Yii3 usa [yiisoft/yii-dataview](https://github.com/yiisoft/yii-dataview). Renderiza datos a partir de un lector de datos (data reader) y usa una configuración fluida del widget:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1235,11 +1419,28 @@ msgid "" " new ActionColumn(),\n" " );\n" msgstr "" +"use Yiisoft\\Data\\Reader\\ReadableDataInterface;\n" +"use Yiisoft\\Yii\\DataView\\Column\\DataColumn;\n" +"use Yiisoft\\Yii\\DataView\\GridView\\Column\\ActionColumn;\n" +"use Yiisoft\\Yii\\DataView\\GridView\\GridView;\n" +"\n" +"/**\n" +" * @var ReadableDataInterface $dataReader\n" +" */\n" +"\n" +"echo GridView::widget()\n" +" ->dataReader($dataReader)\n" +" ->columns(\n" +" new DataColumn('id'),\n" +" new DataColumn('title', header: 'Title'),\n" +" new DataColumn('created_at', header: 'Created'),\n" +" new ActionColumn(),\n" +" );\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "For sorting, pagination, filtering, and action URLs, wire the widget to Yii Router:" -msgstr "" +msgstr "Para la ordenación, la paginación, el filtrado y las URL de las acciones, conecta el widget con Yii Router:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1263,47 +1464,64 @@ msgid "" " ),\n" " );\n" msgstr "" +"use Yiisoft\\Yii\\DataView\\YiiRouter\\ActionColumnUrlConfig;\n" +"use Yiisoft\\Yii\\DataView\\YiiRouter\\ActionColumnUrlCreator;\n" +"use Yiisoft\\Yii\\DataView\\YiiRouter\\UrlCreator;\n" +"use Yiisoft\\Yii\\DataView\\YiiRouter\\UrlParameterProvider;\n" +"\n" +"echo GridView::widget()\n" +" ->dataReader($dataReader)\n" +" ->urlParameterProvider(new UrlParameterProvider($currentRoute))\n" +" ->urlCreator(new UrlCreator($urlGenerator))\n" +" ->columns(\n" +" new DataColumn('id'),\n" +" new DataColumn('title'),\n" +" new ActionColumn(\n" +" urlCreator: new ActionColumnUrlCreator($urlGenerator, $currentRoute),\n" +" urlConfig: new ActionColumnUrlConfig(baseRouteName: 'post'),\n" +" ),\n" +" );\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "A Yii 2.0 search model usually becomes a query service that:" -msgstr "" +msgstr "Un modelo de búsqueda de Yii 2.0 suele convertirse en un servicio de consulta que:" #. type: Bullet: '1. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "reads filter and sort parameters from the request;" -msgstr "" +msgstr "lee los parámetros de filtrado y ordenación de la solicitud;" #. type: Bullet: '2. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "validates them with `yiisoft/validator`;" -msgstr "" +msgstr "los valida con `yiisoft/validator`;" #. type: Bullet: '3. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "builds a database query or repository query;" -msgstr "" +msgstr "construye una consulta a la base de datos o al repositorio;" #. type: Bullet: '4. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "exposes a data reader to GridView." -msgstr "" +msgstr "expone un lector de datos al GridView." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "See [Using htmx for partial reloads](../../cookbook/using-htmx-for-partial-reloads.md) for a complete Yii3 GridView workflow and [yii-dataview GridView docs](https://github.com/yiisoft/yii-dataview/blob/master/docs/en/guide/gridview.md)." -msgstr "" +msgstr "Consulta [Usar htmx para recargas parciales](../../cookbook/using-htmx-for-partial-reloads.md) para ver un flujo completo de GridView en Yii3, y la [documentación de GridView de yii-dataview](https://github.com/yiisoft/yii-dataview/blob/master/docs/en/guide/gridview.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Filters, middleware, and access control" -msgstr "" +msgstr "Filtros, middleware y control de acceso" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 controller filters and behaviors usually look like this:" -msgstr "" +msgstr "Los filtros y comportamientos (behaviors) de los controladores de Yii 2.0 suelen tener este aspecto:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1321,23 +1539,34 @@ msgid "" " ];\n" "}\n" msgstr "" +"public function behaviors(): array\n" +"{\n" +" return [\n" +" 'access' => [\n" +" 'class' => \\yii\\filters\\AccessControl::class,\n" +" 'rules' => [\n" +" ['allow' => true, 'roles' => ['@']],\n" +" ],\n" +" ],\n" +" ];\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "In Yii3, request processing is middleware-based. Move cross-cutting concerns such as authentication, authorization, body parsing, locale negotiation, CSRF checks, and error handling to middleware or dedicated services. Keep actions focused on the request flow they implement." -msgstr "" +msgstr "En Yii3, el procesamiento de las solicitudes se basa en middleware. Traslada las responsabilidades transversales, como la autenticación, la autorización, el análisis del cuerpo de la solicitud, la negociación del idioma (locale), las comprobaciones CSRF y el manejo de errores, a middlewares o servicios dedicados. Mantén las acciones centradas en el flujo de solicitud que implementan." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Console commands" -msgstr "" +msgstr "Comandos de consola" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 console commands extend `yii\\console\\Controller`:" -msgstr "" +msgstr "Los comandos de consola de Yii 2.0 extienden `yii\\console\\Controller`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1352,11 +1581,19 @@ msgid "" " }\n" "}\n" msgstr "" +"final class ReportController extends \\yii\\console\\Controller\n" +"{\n" +" public function actionSend(): int\n" +" {\n" +" // ...\n" +" return self::EXIT_CODE_NORMAL;\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 console commands are services in `src/Console`:" -msgstr "" +msgstr "Los comandos de consola de Yii3 son servicios en `src/Console`:" #. type: Fenced code block (php) #: ../src/guide/intro/upgrade-from-v2.md @@ -1379,129 +1616,145 @@ msgid "" " }\n" "}\n" msgstr "" +"namespace App\\Console;\n" +"\n" +"use Symfony\\Component\\Console\\Attribute\\AsCommand;\n" +"use Symfony\\Component\\Console\\Command\\Command;\n" +"use Symfony\\Component\\Console\\Input\\InputInterface;\n" +"use Symfony\\Component\\Console\\Output\\OutputInterface;\n" +"\n" +"#[AsCommand(name: 'report/send')]\n" +"final class SendReportCommand extends Command\n" +"{\n" +" protected function execute(InputInterface $input, OutputInterface $output): int\n" +" {\n" +" // ...\n" +" return Command::SUCCESS;\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Move command dependencies to constructor injection and register commands in console configuration." -msgstr "" +msgstr "Traslada las dependencias de los comandos a la inyección por constructor y registra los comandos en la configuración de consola." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii 2.0 REST controllers, serializers, and response formatters do not move directly to Yii3. Start from PSR-7 responses and explicit routing. Build one resource at a time:" -msgstr "" +msgstr "Los controladores REST, los serializadores y los formateadores de respuesta de Yii 2.0 no se trasladan directamente a Yii3. Parte de respuestas PSR-7 y de un enrutamiento explícito. Construye un recurso cada vez:" #. type: Bullet: '1. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "define routes for collection and item operations;" -msgstr "" +msgstr "define las rutas para las operaciones sobre colecciones y sobre elementos;" #. type: Bullet: '2. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "inject request, persistence, serializer, and response factory dependencies;" -msgstr "" +msgstr "inyecta las dependencias de solicitud, persistencia, serialización y factoría de respuestas;" #. type: Bullet: '3. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "validate input with `yiisoft/validator`;" -msgstr "" +msgstr "valida la entrada con `yiisoft/validator`;" #. type: Bullet: '4. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "return JSON responses through Yii3 response helpers or PSR-7 factories;" -msgstr "" +msgstr "devuelve respuestas JSON mediante los helpers de respuesta de Yii3 o factorías PSR-7;" #. type: Bullet: '5. ' #: ../src/guide/intro/upgrade-from-v2.md msgid "move authentication and rate limiting to middleware." -msgstr "" +msgstr "traslada la autenticación y la limitación de la tasa de solicitudes a middleware." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "See [Response](../runtime/response.md), [Authentication](../security/authentication.md), and [Authorization](../security/authorization.md)." -msgstr "" +msgstr "Consulta [Respuesta](../runtime/response.md), [Autenticación](../security/authentication.md) y [Autorización](../security/authorization.md)." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Do not postpone tests until the whole Yii3 application is done. For each new request flow, add:" -msgstr "" +msgstr "No dejes las pruebas para cuando toda la aplicación Yii3 esté terminada. Para cada nuevo flujo de solicitud, añade:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "unit tests for services and validators;" -msgstr "" +msgstr "pruebas unitarias para los servicios y los validadores;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "functional tests for actions and middleware;" -msgstr "" +msgstr "pruebas funcionales para las acciones y los middlewares;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "end-to-end tests for critical browser flows;" -msgstr "" +msgstr "pruebas de extremo a extremo para los flujos críticos en el navegador;" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "static analysis for stricter type checks." -msgstr "" +msgstr "análisis estático para comprobaciones de tipos más estrictas." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "Yii3 code is more explicit, so tests should assert services directly instead of constructing large application component arrays." -msgstr "" +msgstr "El código de Yii3 es más explícito, así que las pruebas deben verificar directamente los servicios en lugar de construir grandes arrays de componentes de la aplicación." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "See [Testing overview](../testing/overview.md), [Unit tests](../testing/unit.md), [Functional tests](../testing/functional.md), and [End-to-end tests](../testing/end-to-end.md)." -msgstr "" +msgstr "Consulta [Pruebas](../testing/overview.md), [Pruebas unitarias](../testing/unit.md), [Pruebas funcionales](../testing/functional.md) y [Pruebas de extremo a extremo](../testing/end-to-end.md)." #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #, no-wrap msgid "Refactoring Yii 2.0 code before reusing it" -msgstr "" +msgstr "Refactorizar el código de Yii 2.0 antes de reutilizarlo" #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "These changes are useful even if the old application stays on Yii 2.0 for a while:" -msgstr "" +msgstr "Estos cambios son útiles aunque la aplicación antigua siga en Yii 2.0 durante un tiempo:" #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Replace `Yii::$app` access in domain code with constructor arguments." -msgstr "" +msgstr "Sustituye el acceso a `Yii::$app` en el código de dominio por argumentos del constructor." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Move queries out of controllers and views into repositories or query services." -msgstr "" +msgstr "Saca las consultas de los controladores y las vistas y llévalas a repositorios o servicios de consulta." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Move business workflows out of Active Record classes." -msgstr "" +msgstr "Saca los flujos de negocio de las clases Active Record." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Separate form models from persistence models." -msgstr "" +msgstr "Separa los modelos de formulario de los modelos de persistencia." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Add return types and parameter types." -msgstr "" +msgstr "Añade tipos de retorno y tipos de parámetros." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Replace route arrays scattered in views with named route constants or helper methods." -msgstr "" +msgstr "Sustituye los arrays de rutas dispersos por las vistas por constantes de rutas con nombre o métodos auxiliares." #. type: Bullet: '- ' #: ../src/guide/intro/upgrade-from-v2.md msgid "Add tests around each flow before rebuilding it in Yii3." -msgstr "" +msgstr "Añade pruebas para cada flujo antes de reconstruirlo en Yii3." #. type: Plain text #: ../src/guide/intro/upgrade-from-v2.md msgid "The less framework state your Yii 2.0 code assumes, the easier it is to understand what should be reused and what should be redesigned for Yii3." -msgstr "" +msgstr "Cuanto menos estado del framework presuponga tu código de Yii 2.0, más fácil será entender qué debe reutilizarse y qué debe rediseñarse para Yii3." diff --git a/_translations/po/es/guide_intro_what-is-yii.md.po b/_translations/po/es/guide_intro_what-is-yii.md.po index 02a9397e..a3bb0bb8 100644 --- a/_translations/po/es/guide_intro_what-is-yii.md.po +++ b/_translations/po/es/guide_intro_what-is-yii.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2025-12-27 03:24+0000\n" -"PO-Revision-Date: 2025-09-04 07:51+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -19,70 +19,70 @@ msgstr "" #. type: Plain text #: ../src/cookbook/preface.md ../src/guide/intro/what-is-yii.md msgid "Yii is a high-performance, package-based PHP framework for developing modern applications. The name Yii (pronounced `Yee` or `[ji:]`) means \"simple and evolutionary\" in Chinese. You can also think about it as an acronym for **Yes It Is**!" -msgstr "" +msgstr "Yii es un framework PHP de alto rendimiento y basado en paquetes para desarrollar aplicaciones modernas. El nombre Yii (se pronuncia `Yee` o `[ji:]`) significa \"sencillo y evolutivo\" en chino. ¡También puedes verlo como el acrónimo de **Yes It Is**!" #. type: Plain text #: ../src/cookbook/preface.md ../src/guide/intro/what-is-yii.md msgid "Yii is a generic Web programming framework. You can use it for developing all kinds of Web applications using PHP. Because of its architecture and sophisticated caching support, it's especially suitable for developing large-scale applications such as portals, content management systems, e-commerce, REST APIs, etc." -msgstr "" +msgstr "Yii es un framework de programación web de uso general. Puedes usarlo para desarrollar todo tipo de aplicaciones web con PHP. Gracias a su arquitectura y a su avanzado soporte de caché, es especialmente adecuado para desarrollar aplicaciones a gran escala, como portales, sistemas de gestión de contenidos, comercio electrónico, API REST, etc." #. type: Title # #: ../src/guide/intro/what-is-yii.md #, no-wrap msgid "What is Yii" -msgstr "" +msgstr "Qué es Yii" #. type: Title ## #: ../src/guide/intro/what-is-yii.md #, no-wrap msgid "What's Yii best for" -msgstr "" +msgstr "Para qué es mejor Yii" #. type: Title ## #: ../src/guide/intro/what-is-yii.md #, no-wrap msgid "How does Yii compare with other frameworks?" -msgstr "" +msgstr "¿Cómo se compara Yii con otros frameworks?" #. type: Plain text #: ../src/guide/intro/what-is-yii.md msgid "If you're already familiar with another framework, you may appreciate knowing how Yii compares:" -msgstr "" +msgstr "Si ya conoces otro framework, quizá te interese saber cómo se compara Yii con él:" #. type: Bullet: '- ' #: ../src/guide/intro/what-is-yii.md msgid "Yii takes the [philosophy of being practical and helpful](../../internals/001-yii-values.md) achieving:" -msgstr "" +msgstr "Yii sigue la [filosofía de ser práctico y útil](../../internals/001-yii-values.md) y consigue:" #. type: Bullet: ' - ' #: ../src/guide/intro/what-is-yii.md msgid "Performance in both development and execution." -msgstr "" +msgstr "Rendimiento tanto en el desarrollo como en la ejecución." #. type: Bullet: ' - ' #: ../src/guide/intro/what-is-yii.md msgid "Convenient customizable defaults." -msgstr "" +msgstr "Valores predeterminados prácticos y personalizables." #. type: Bullet: ' - ' #: ../src/guide/intro/what-is-yii.md msgid "Practice-orientation." -msgstr "" +msgstr "Orientación a la práctica." #. type: Bullet: ' - ' #: ../src/guide/intro/what-is-yii.md msgid "Simplicity." -msgstr "" +msgstr "Sencillez." #. type: Bullet: ' - ' #: ../src/guide/intro/what-is-yii.md msgid "Explicitness." -msgstr "" +msgstr "Explicitud." #. type: Bullet: ' - ' #: ../src/guide/intro/what-is-yii.md msgid "Consistency." -msgstr "" +msgstr "Coherencia." #. type: Plain text #: ../src/guide/intro/what-is-yii.md @@ -97,50 +97,58 @@ msgid "" " take advantage of Yii's solid architecture to use or develop redistributable packages.\n" "- High performance is always a primary goal of Yii.\n" msgstr "" +" Yii nunca intentará sobrediseñar las cosas solo por seguir ciertos patrones de diseño.\n" +"- Yii usa ampliamente las interfaces PSR, lo que permite reutilizar lo que ha creado la comunidad de PHP e incluso\n" +" sustituir las implementaciones del núcleo si hace falta.\n" +"- Yii es a la vez un conjunto de bibliotecas y un framework full-stack que ofrece muchas funcionalidades probadas y listas para usar:\n" +" caché, registro de logs, motor de plantillas, abstracción de datos, herramientas de desarrollo, generación de código y mucho más.\n" +"- Yii es extensible. Puedes personalizar o sustituir cualquier parte del código del núcleo. También puedes\n" +" aprovechar la sólida arquitectura de Yii para usar o desarrollar paquetes redistribuibles.\n" +"- El alto rendimiento es siempre uno de los objetivos principales de Yii.\n" #. type: Plain text #: ../src/guide/intro/what-is-yii.md msgid "Yii is backed up by a [strong core developer team](https://www.yiiframework.com/team/) financially backed from an [OpenCollective foundation](https://opencollective.com/yiisoft), as well as a large community of professionals constantly contributing to Yii's development. The Yii developer team keeps a close eye on the latest Web development trends and on the best practices and features found in other frameworks and projects. The most relevant best practices and features found elsewhere are incorporated into the core framework and exposed via simple and elegant interfaces." -msgstr "" +msgstr "Yii cuenta con el respaldo de un [sólido equipo de desarrolladores del núcleo](https://www.yiiframework.com/team/), financiado a través de [OpenCollective](https://opencollective.com/yiisoft), así como de una gran comunidad de profesionales que contribuyen constantemente a su desarrollo. El equipo de desarrollo de Yii sigue de cerca las últimas tendencias del desarrollo web y las buenas prácticas y funcionalidades de otros frameworks y proyectos. Las buenas prácticas y funcionalidades más relevantes que se encuentran en otros lugares se incorporan al núcleo del framework y se exponen mediante interfaces sencillas y elegantes." #. type: Title ## #: ../src/guide/intro/what-is-yii.md #, no-wrap msgid "Yii versions" -msgstr "" +msgstr "Versiones de Yii" #. type: Plain text #: ../src/guide/intro/what-is-yii.md msgid "Yii currently has three major versions available: 1.1, 2.0, and 3.0." -msgstr "" +msgstr "Actualmente Yii tiene tres versiones principales disponibles: 1.1, 2.0 y 3.0." #. type: Bullet: '- ' #: ../src/guide/intro/what-is-yii.md msgid "Version 1.1 is the old generation and is now in the feature freeze bugfix mode." -msgstr "" +msgstr "La versión 1.1 es la generación antigua y ahora solo recibe correcciones de errores, sin funcionalidades nuevas." #. type: Bullet: '- ' #: ../src/guide/intro/what-is-yii.md msgid "Version 2.0 is a current stable version in the feature freeze bugfix mode." -msgstr "" +msgstr "La versión 2.0 es la versión estable actual y solo recibe correcciones de errores, sin funcionalidades nuevas." #. type: Bullet: '- ' #: ../src/guide/intro/what-is-yii.md msgid "Version 3.0 is the current version in development. This guide is mainly about version 3." -msgstr "" +msgstr "La versión 3.0 es la versión actual en desarrollo. Esta guía trata principalmente de la versión 3." #. type: Title ## #: ../src/guide/intro/what-is-yii.md #, no-wrap msgid "Requirements and prerequisites" -msgstr "" +msgstr "Requisitos y conocimientos previos" #. type: Plain text #: ../src/guide/intro/what-is-yii.md msgid "Yii3 requires PHP 8.2 or above, but some packages work with older PHP, such as PHP 7.4." -msgstr "" +msgstr "Yii3 requiere PHP 8.2 o superior, aunque algunos paquetes funcionan con versiones anteriores de PHP, como PHP 7.4." #. type: Plain text #: ../src/guide/intro/what-is-yii.md msgid "Using Yii requires basic knowledge of object-oriented programming (OOP), as Yii is a pure OOP-based framework. Yii3 also makes use of the latest PHP features, such as type declarations and generators. Understanding these concepts will help you pick up Yii3 faster." -msgstr "" +msgstr "Para usar Yii necesitas conocimientos básicos de programación orientada a objetos (POO), ya que Yii es un framework basado completamente en la POO. Yii3 también aprovecha las funcionalidades más recientes de PHP, como las declaraciones de tipos y los generadores. Entender estos conceptos te ayudará a aprender Yii3 más rápido." diff --git a/_translations/po/es/guide_start_creating-project.md.po b/_translations/po/es/guide_start_creating-project.md.po index d0908747..6d10f8c5 100644 --- a/_translations/po/es/guide_start_creating-project.md.po +++ b/_translations/po/es/guide_start_creating-project.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-04-07 16:34+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,12 +20,12 @@ msgstr "" #: ../src/guide/start/creating-project.md #, no-wrap msgid "Creating a project" -msgstr "" +msgstr "Crear un proyecto" #. type: Plain text #: ../src/guide/start/creating-project.md msgid "In this guide we'll provide commands for both [Docker](https://docs.docker.com/get-started/get-docker/) and the built-in dev server with everything installed locally." -msgstr "" +msgstr "En esta guía daremos los comandos tanto para [Docker](https://docs.docker.com/get-started/get-docker/) como para el servidor de desarrollo integrado, con todo instalado en local." #. type: Plain text #: ../src/guide/start/creating-project.md @@ -35,29 +35,30 @@ msgid "" "> If you want to use another web server,\n" "> see [\"Configuring web servers\"](../../cookbook/configuring-webservers/general.md).\n" msgstr "" +"> [!NOTE]\n" +"> Si quieres usar otro servidor web,\n" +"> consulta [\"Configurar servidores web\"](../../cookbook/configuring-webservers/general.md).\n" #. type: Plain text #: ../src/guide/start/creating-project.md msgid "We recommend starting with a project template that's a minimal working Yii project implementing some basic features. It can serve as a good starting point for your projects." -msgstr "" +msgstr "Te recomendamos empezar con una plantilla de proyecto, que es un proyecto Yii mínimo y funcional que implementa algunas funcionalidades básicas. Puede ser un buen punto de partida para tus proyectos." #. type: Plain text #: ../src/guide/start/creating-project.md msgid "You can create a new project from a template using the [Composer](https://getcomposer.org) package manager:" -msgstr "" +msgstr "Puedes crear un proyecto nuevo a partir de una plantilla con el gestor de paquetes [Composer](https://getcomposer.org):" #. type: Fenced code block (sh) #: ../src/guide/start/creating-project.md #, no-wrap msgid "composer create-project yiisoft/app your_project\n" -msgstr "" +msgstr "composer create-project yiisoft/app your_project\n" #. type: Plain text #: ../src/guide/start/creating-project.md -#, fuzzy -#| msgid "Events are raised like the following:" msgid "Docker users can run the following commands:" -msgstr "Los eventos se lanzan de la siguiente forma:" +msgstr "Si usas Docker, puedes ejecutar los siguientes comandos:" #. type: Fenced code block (sh) #: ../src/guide/start/creating-project.md @@ -68,11 +69,15 @@ msgid "" "cd your_project\n" "make composer update\n" msgstr "" +"docker run --rm -it -v \"$(pwd):/app\" --user $(id -u):$(id -g) composer/composer create-project yiisoft/app your_project\n" +"sudo chown -R $(id -u):$(id -g) your_project\n" +"cd your_project\n" +"make composer update\n" #. type: Plain text #: ../src/guide/start/creating-project.md msgid "If you want development version instead of release one:" -msgstr "" +msgstr "Si quieres la versión de desarrollo en lugar de una versión publicada:" #. type: Fenced code block (sh) #: ../src/guide/start/creating-project.md @@ -83,11 +88,15 @@ msgid "" "rm -rf .git && \\\n" "make composer update\n" msgstr "" +"git clone https://github.com/yiisoft/app.git --depth 1 your_project && \\\n" +"cd your_project && \\\n" +"rm -rf .git && \\\n" +"make composer update\n" #. type: Plain text #: ../src/guide/start/creating-project.md msgid "This installs the latest stable version of the Yii project template in a directory named `your_project`. You can choose a different directory name if you want." -msgstr "" +msgstr "Esto instala la última versión estable de la plantilla de proyecto de Yii en un directorio llamado `your_project`. Si quieres, puedes elegir otro nombre de directorio." #. type: Plain text #: ../src/guide/start/creating-project.md @@ -97,33 +106,36 @@ msgid "" "> If you want to install the latest development version of Yii, you may add `--stability=dev` to the command.\n" "> Don't use the development version of Yii for production because it may break your running code.\n" msgstr "" +"> [!TIP]\n" +"> Si quieres instalar la última versión de desarrollo de Yii, puedes añadir `--stability=dev` al comando.\n" +"> No uses la versión de desarrollo de Yii en producción, porque podría romper tu código en ejecución.\n" #. type: Plain text #: ../src/guide/start/creating-project.md msgid "Go into the newly created directory, copy `.env.example` to `.env`, and run:" -msgstr "" +msgstr "Entra en el directorio recién creado, copia `.env.example` a `.env` y ejecuta:" #. type: Fenced code block (sh) #: ../src/guide/start/creating-project.md #, no-wrap msgid "./yii serve --port=80\n" -msgstr "" +msgstr "./yii serve --port=80\n" #. type: Plain text #: ../src/guide/start/creating-project.md msgid "For Docker users, run:" -msgstr "" +msgstr "Si usas Docker, ejecuta:" #. type: Fenced code block (sh) #: ../src/guide/start/creating-project.md #, no-wrap msgid "make up\n" -msgstr "" +msgstr "make up\n" #. type: Plain text #: ../src/guide/start/creating-project.md msgid "Open your browser to the URL `http://localhost/`." -msgstr "" +msgstr "Abre en tu navegador la URL `http://localhost/`." #. type: Plain text #: ../src/guide/start/creating-project.md @@ -133,8 +145,11 @@ msgid "" "> To change the port for the built-in server, pass `--port` to `./yii serve`. For Docker, set `DEV_PORT`\n" "> in `docker/.env`.\n" msgstr "" +"> [!NOTE]\n" +"> Para cambiar el puerto del servidor integrado, pasa `--port` a `./yii serve`. En Docker, establece `DEV_PORT`\n" +"> en `docker/.env`.\n" #. type: Plain text #: ../src/guide/start/creating-project.md msgid "![Successful Installation of Yii](/images/guide/start/app-installed.png)" -msgstr "" +msgstr "![Instalación correcta de Yii](/images/guide/start/app-installed.png)" diff --git a/_translations/po/es/guide_start_databases.md.po b/_translations/po/es/guide_start_databases.md.po index 92ccd9f6..fce76b4d 100644 --- a/_translations/po/es/guide_start_databases.md.po +++ b/_translations/po/es/guide_start_databases.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-10-11 10:37+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -21,13 +21,13 @@ msgstr "" #: ../src/cookbook/organizing-code/service.md ../src/guide/start/databases.md #, no-wrap msgid "Repository" -msgstr "" +msgstr "Repositorio" #. type: Fenced code block (sh) #: ../src/guide/databases/db-migrations.md ../src/guide/start/databases.md #, no-wrap msgid "make composer require yiisoft/db-migration\n" -msgstr "" +msgstr "make composer require yiisoft/db-migration\n" #. type: Fenced code block (php) #: ../src/guide/databases/db-migrations.md ../src/guide/start/databases.md @@ -38,74 +38,78 @@ msgid "" " 'sourceNamespaces' => ['App\\\\Migration'],\n" "],\n" msgstr "" +"'yiisoft/db-migration' => [\n" +" 'newMigrationNamespace' => 'App\\\\Migration',\n" +" 'sourceNamespaces' => ['App\\\\Migration'],\n" +"],\n" #. type: Title # #: ../src/guide/index.md ../src/guide/start/databases.md #, no-wrap msgid "Working with databases" -msgstr "" +msgstr "Trabajar con bases de datos" #. type: Title ### #: ../src/guide/runtime/routing.md ../src/guide/start/databases.md #, no-wrap msgid "Routing" -msgstr "" +msgstr "Enrutamiento" #. type: Plain text #: ../src/guide/start/databases.md msgid "Yii doesn't dictate using a particular database or storage for your application. There are many ways you can work with relational databases:" -msgstr "" +msgstr "Yii no impone el uso de una base de datos o un almacenamiento concretos para tu aplicación. Hay muchas formas de trabajar con bases de datos relacionales:" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "[Yii DB](https://github.com/yiisoft/db)" -msgstr "" +msgstr "[Yii DB](https://github.com/yiisoft/db)" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "[Yii Active Record](https://github.com/yiisoft/active-record)" -msgstr "" +msgstr "[Yii Active Record](https://github.com/yiisoft/active-record)" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "[Cycle](https://github.com/cycle) via [Yii Cycle package](https://github.com/yiisoft/yii-cycle)" -msgstr "" +msgstr "[Cycle](https://github.com/cycle) mediante el [paquete Yii Cycle](https://github.com/yiisoft/yii-cycle)" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "[Doctrine](https://www.doctrine-project.org/) via [Yii Doctrine package](https://github.com/stargazer-team/yii-doctrine)" -msgstr "" +msgstr "[Doctrine](https://www.doctrine-project.org/) mediante el [paquete Yii Doctrine](https://github.com/stargazer-team/yii-doctrine)" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "[PDO](https://www.php.net/manual/en/book.pdo.php)" -msgstr "" +msgstr "[PDO](https://www.php.net/manual/en/book.pdo.php)" #. type: Plain text #: ../src/guide/start/databases.md msgid "For non-relational ones, there are usually official libraries available:" -msgstr "" +msgstr "Para las no relacionales, normalmente hay bibliotecas oficiales disponibles:" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "[ElasticSearch](https://github.com/elastic/elasticsearch-php)" -msgstr "" +msgstr "[ElasticSearch](https://github.com/elastic/elasticsearch-php)" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "[Redis](https://redis.io/docs/latest/develop/clients/php/)" -msgstr "" +msgstr "[Redis](https://redis.io/docs/latest/develop/clients/php/)" #. type: Bullet: ' - ' #: ../src/guide/start/databases.md ../src/internals/000-packages.md msgid "..." -msgstr "" +msgstr "..." #. type: Title ## #: ../src/guide/start/databases.md #, no-wrap msgid "Choosing a data access approach" -msgstr "" +msgstr "Elegir un enfoque de acceso a datos" #. type: Plain text #: ../src/guide/start/databases.md @@ -114,6 +118,8 @@ msgid "" "Yii3 keeps database access in optional packages. A new application doesn't get a global `Yii::$app->db` component\n" "or a built-in Active Record layer automatically, so choose the package and boundary that fit your application.\n" msgstr "" +"Yii3 mantiene el acceso a bases de datos en paquetes opcionales. Una aplicación nueva no obtiene automáticamente un componente global `Yii::$app->db`\n" +"ni una capa de Active Record integrada, así que elige el paquete y la frontera que mejor se adapten a tu aplicación.\n" #. type: Plain text #: ../src/guide/start/databases.md @@ -123,57 +129,60 @@ msgid "" "connections, commands, schema support, and a query builder. Instead of calling `Yii::$app->db`, configure a\n" "connection as a service and inject `ConnectionInterface` where the database is needed.\n" msgstr "" +"Si usabas la capa de acceso a bases de datos de Yii 2.0, `yiisoft/db` es el equivalente más cercano en Yii3. Proporciona conexiones\n" +"a bases de datos, comandos, soporte de esquemas y un constructor de consultas. En lugar de llamar a `Yii::$app->db`, configura una\n" +"conexión como servicio e inyecta `ConnectionInterface` donde se necesite la base de datos.\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "If you used Yii 2.0 Active Record, you can install `yiisoft/active-record`. It is useful when your model classes mostly describe tables and relations. For applications where Yii 2.0 Active Record classes also contain form validation, request scenarios, authorization checks, or business workflows, move those responsibilities to form models, services, and domain objects instead of putting them back into the record class." -msgstr "" +msgstr "Si usabas Active Record de Yii 2.0, puedes instalar `yiisoft/active-record`. Es útil cuando tus clases de modelo se limitan sobre todo a describir tablas y relaciones. En las aplicaciones en las que las clases Active Record de Yii 2.0 también contienen validación de formularios, escenarios de solicitud, comprobaciones de autorización o flujos de negocio, traslada esas responsabilidades a modelos de formulario, servicios y objetos de dominio en lugar de volver a ponerlas en la clase del registro." #. type: Plain text #: ../src/guide/start/databases.md msgid "For most application code, put a repository or query service between the action/service layer and storage:" -msgstr "" +msgstr "Para la mayor parte del código de la aplicación, pon un repositorio o un servicio de consulta entre la capa de acciones/servicios y el almacenamiento:" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "actions and application services depend on repository methods such as `findOneBySlug()`, `findAll()`, `save()`, and `deleteBySlug()`;" -msgstr "" +msgstr "las acciones y los servicios de la aplicación dependen de métodos del repositorio como `findOneBySlug()`, `findAll()`, `save()` y `deleteBySlug()`;" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "the repository hides whether persistence is implemented with `yiisoft/db`, Active Record, Cycle, Doctrine, or another storage;" -msgstr "" +msgstr "el repositorio oculta si la persistencia se implementa con `yiisoft/db`, Active Record, Cycle, Doctrine u otro almacenamiento;" #. type: Bullet: '- ' #: ../src/guide/start/databases.md msgid "the repository is the place to map raw database rows or records to typed objects used by the rest of the code." -msgstr "" +msgstr "el repositorio es el lugar donde se transforman las filas en bruto de la base de datos o los registros en los objetos tipados que usa el resto del código." #. type: Plain text #: ../src/guide/start/databases.md msgid "Small CRUD applications can start with a concrete repository class. Larger applications usually benefit from a repository interface in the domain or module and an implementation in the infrastructure layer." -msgstr "" +msgstr "Las aplicaciones CRUD pequeñas pueden empezar con una clase de repositorio concreta. Las aplicaciones más grandes suelen beneficiarse de una interfaz de repositorio en el dominio o en el módulo y una implementación en la capa de infraestructura." #. type: Plain text #: ../src/guide/start/databases.md msgid "In this guide, we will focus on working with relational databases using Yii DB. We'll use PostgreSQL to implement a simple CRUD (create read update delete)." -msgstr "" +msgstr "En esta guía nos centraremos en trabajar con bases de datos relacionales mediante Yii DB. Usaremos PostgreSQL para implementar un CRUD sencillo (crear, leer, actualizar y eliminar)." #. type: Title ## #: ../src/guide/start/databases.md #, no-wrap msgid "Installing PostgreSQL" -msgstr "" +msgstr "Instalar PostgreSQL" #. type: Plain text #: ../src/guide/start/databases.md msgid "You need to install PostgreSQL. If you prefer not to use Docker, [get the installer from official website](https://www.postgresql.org/download/), install it and create a database." -msgstr "" +msgstr "Tienes que instalar PostgreSQL. Si prefieres no usar Docker, [descarga el instalador desde la web oficial](https://www.postgresql.org/download/), instálalo y crea una base de datos." #. type: Plain text #: ../src/guide/start/databases.md msgid "If you use Docker, it is a bit simpler. Modify `docker/dev/compose.yml`:" -msgstr "" +msgstr "Si usas Docker, es algo más sencillo. Modifica `docker/dev/compose.yml`:" #. type: Fenced code block (yaml) #: ../src/guide/start/databases.md @@ -221,11 +230,52 @@ msgid "" " timeout: 5s\n" " retries: 5\n" msgstr "" +"services:\n" +" app:\n" +" build:\n" +" dockerfile: docker/Dockerfile\n" +" context: ..\n" +" target: dev\n" +" args:\n" +" USER_ID: ${UID}\n" +" GROUP_ID: ${GID}\n" +" env_file:\n" +" - path: ./dev/.env\n" +" - path: ./dev/override.env\n" +" required: false\n" +" ports:\n" +" - \"${DEV_PORT:-80}:80\"\n" +" volumes:\n" +" - ../:/app\n" +" - ../runtime:/app/runtime\n" +" - caddy_data:/data\n" +" - caddy_config:/config\n" +" tty: true\n" +" depends_on:\n" +" db:\n" +" condition: service_healthy\n" +"\n" +" db:\n" +" image: postgres:${POSTGRES_VERSION:-18}-alpine\n" +" environment:\n" +" POSTGRES_DB: app\n" +" POSTGRES_PASSWORD: password\n" +" POSTGRES_USER: user\n" +" POSTGRES_INITDB_ARGS: \"--locale-provider=icu --icu-locale=und --encoding=UTF8\"\n" +" volumes:\n" +" - ../runtime/db:/var/lib/postgresql:rw\n" +" ports:\n" +" - \"${DEV_DB_PORT:-5432}:5432\"\n" +" healthcheck:\n" +" test: [ \"CMD-SHELL\", \"pg_isready -U user -d app\" ]\n" +" interval: 5s\n" +" timeout: 5s\n" +" retries: 5\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "Note that we add `depends_on` so application waits for database to be up." -msgstr "" +msgstr "Ten en cuenta que añadimos `depends_on` para que la aplicación espere a que la base de datos esté en marcha." #. type: Plain text #: ../src/guide/start/databases.md @@ -234,11 +284,13 @@ msgid "" "> [!IMPORTANT]\n" "> Also, we'll need a `pdo_pgsql` extension to communicate with PostgreSQL. You can enable it locally in `php.ini`.\n" msgstr "" +"> [!IMPORTANT]\n" +"> Además, necesitaremos la extensión `pdo_pgsql` para comunicarnos con PostgreSQL. En local, puedes habilitarla en `php.ini`.\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "If you use Docker, check `docker/Dockerfile` and add `pdo_pgsql` in `install-php-extensions` list:" -msgstr "" +msgstr "Si usas Docker, revisa `docker/Dockerfile` y añade `pdo_pgsql` a la lista de `install-php-extensions`:" #. type: Fenced code block (dockerfile) #: ../src/guide/start/databases.md @@ -259,44 +311,58 @@ msgid "" " pdo \\\n" " pdo_pgsql\n" msgstr "" +"RUN install-php-extensions \\\n" +" opcache \\\n" +" mbstring \\\n" +" intl \\\n" +" dom \\\n" +" ctype \\\n" +" curl \\\n" +" phar \\\n" +" openssl \\\n" +" xml \\\n" +" xmlwriter \\\n" +" simplexml \\\n" +" pdo \\\n" +" pdo_pgsql\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "Then rebuild PHP image with" -msgstr "" +msgstr "Después, vuelve a construir la imagen de PHP con" #. type: Fenced code block (sh) #: ../src/guide/start/databases.md #, no-wrap msgid "make build && make down && make up\n" -msgstr "" +msgstr "make build && make down && make up\n" #. type: Title ## #: ../src/guide/start/databases.md #, no-wrap msgid "Configuring connection" -msgstr "" +msgstr "Configurar la conexión" #. type: Plain text #: ../src/guide/start/databases.md msgid "Now that we have the database, it's time to define the connection." -msgstr "" +msgstr "Ahora que tenemos la base de datos, es hora de definir la conexión." #. type: Plain text #: ../src/guide/start/databases.md msgid "First we need a package to be installed:" -msgstr "" +msgstr "Primero tenemos que instalar un paquete:" #. type: Fenced code block (sh) #: ../src/guide/start/databases.md #, no-wrap msgid "make composer require yiisoft/db-pgsql:2.*\n" -msgstr "" +msgstr "make composer require yiisoft/db-pgsql:2.*\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "Now create `config/common/di/db-pgsql.php`:" -msgstr "" +msgstr "Ahora crea `config/common/di/db-pgsql.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -323,11 +389,31 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" 'class' => Connection::class,\n" +" '__construct()' => [\n" +" 'driver' => new Driver(\n" +" $params['yiisoft/db-pgsql']['dsn'],\n" +" $params['yiisoft/db-pgsql']['username'],\n" +" $params['yiisoft/db-pgsql']['password'],\n" +" ),\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "And define parameters in `config/common/params.php`. For Docker that would be:" -msgstr "" +msgstr "Y define los parámetros en `config/common/params.php`. Con Docker sería:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -344,27 +430,37 @@ msgid "" " ],\n" "];\n" msgstr "" +"use Yiisoft\\Db\\Pgsql\\Dsn;\n" +"\n" +"return [\n" +" // ...\n" +" 'yiisoft/db-pgsql' => [\n" +" 'dsn' => new Dsn('pgsql', 'db', 'app', '5432'),\n" +" 'username' => 'user',\n" +" 'password' => 'password',\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "`db` host is resolved automatically within the Docker network." -msgstr "" +msgstr "El host `db` se resuelve automáticamente dentro de la red de Docker." #. type: Plain text #: ../src/guide/start/databases.md msgid "For local installation without Docker the host in Dsn would be `localhost`. You'll have to adjust the rest to match how you configured the database." -msgstr "" +msgstr "En una instalación local sin Docker, el host del DSN sería `localhost`. Tendrás que ajustar el resto según cómo hayas configurado la base de datos." #. type: Title ### #: ../src/guide/start/databases.md #, no-wrap msgid "Multiple database connections" -msgstr "" +msgstr "Varias conexiones a bases de datos" #. type: Plain text #: ../src/guide/start/databases.md msgid "When the application works with several databases, keep `ConnectionInterface` for the primary connection and add a class alias for each named connection:" -msgstr "" +msgstr "Cuando la aplicación trabaja con varias bases de datos, mantén `ConnectionInterface` para la conexión principal y añade un alias de clase para cada conexión con nombre:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -409,16 +505,54 @@ msgid "" " ],\n" "];\n" msgstr "" +" MainDatabase::class,\n" +"\n" +" MainDatabase::class => [\n" +" 'class' => Connection::class,\n" +" '__construct()' => [\n" +" 'driver' => new Driver(\n" +" $params['app/db']['main']['dsn'],\n" +" $params['app/db']['main']['username'],\n" +" $params['app/db']['main']['password'],\n" +" ),\n" +" ],\n" +" ],\n" +"\n" +" AnalyticsDatabase::class => [\n" +" 'class' => Connection::class,\n" +" '__construct()' => [\n" +" 'driver' => new Driver(\n" +" $params['app/db']['analytics']['dsn'],\n" +" $params['app/db']['analytics']['username'],\n" +" $params['app/db']['analytics']['password'],\n" +" ),\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "The alias class names are used as service IDs and type hints. They don't need PHP files of their own." -msgstr "" +msgstr "Los nombres de las clases alias se usan como identificadores de servicio y en las declaraciones de tipo. No necesitan archivos PHP propios." #. type: Plain text #: ../src/guide/start/databases.md msgid "Define matching parameters:" -msgstr "" +msgstr "Define los parámetros correspondientes:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -442,11 +576,28 @@ msgid "" " ],\n" "];\n" msgstr "" +"use Yiisoft\\Db\\Pgsql\\Dsn;\n" +"\n" +"return [\n" +" // ...\n" +" 'app/db' => [\n" +" 'main' => [\n" +" 'dsn' => new Dsn('pgsql', 'db', 'app', '5432'),\n" +" 'username' => 'user',\n" +" 'password' => 'password',\n" +" ],\n" +" 'analytics' => [\n" +" 'dsn' => new Dsn('pgsql', 'analytics-db', 'analytics', '5432'),\n" +" 'username' => 'analytics_user',\n" +" 'password' => 'analytics_password',\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "Services that need the primary database can still depend on `ConnectionInterface`. Services that need another database should type-hint the corresponding alias:" -msgstr "" +msgstr "Los servicios que necesitan la base de datos principal pueden seguir dependiendo de `ConnectionInterface`. Los servicios que necesitan otra base de datos deben declarar como tipo el alias correspondiente:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -467,32 +618,46 @@ msgid "" " ) {}\n" "}\n" msgstr "" +"columnBuilder();\n" +"\n" +" $b->createTable('page', [\n" +" 'id' => $column::uuidPrimaryKey(),\n" +" 'title' => $column::string()->notNull(),\n" +" 'slug' => $column::string()->notNull()->unique(),\n" +" 'text' => $column::text()->notNull(),\n" +" 'created_at' => $column::dateTime(),\n" +" 'updated_at' => $column::dateTime(),\n" +" ]);\n" +" }\n" +"\n" +" public function down(MigrationBuilder $b): void\n" +" {\n" +" $b->dropTable('page');\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "The `M251102141707Page` name of the migration class is generated so replace the `Page` suffix with the actual migration name. The `M251102141707` prefix is needed to find and sort migrations in the order they were added." -msgstr "" +msgstr "El nombre `M251102141707Page` de la clase de migración se genera automáticamente, así que sustituye el sufijo `Page` por el nombre real de la migración. El prefijo `M251102141707` es necesario para encontrar las migraciones y ordenarlas según se añadieron." #. type: Plain text #: ../src/guide/start/databases.md msgid "Note that we use UUID as the primary key. We are going to generate these IDs ourselves instead of relying on database so we'll need an extra compose package for that." -msgstr "" +msgstr "Ten en cuenta que usamos UUID como clave primaria. Vamos a generar estos identificadores nosotros mismos en lugar de depender de la base de datos, así que necesitaremos un paquete de Composer adicional para ello." #. type: Fenced code block (shell) #: ../src/guide/start/databases.md #, no-wrap msgid "make composer require ramsey/uuid\n" -msgstr "" +msgstr "make composer require ramsey/uuid\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "While the storage space is a bit bigger than using int, the workflow with such IDs is beneficial. Since you generate the ID yourself so you can define a set of related data and save it in a single transaction. The entities that define this set of data in the code are often called an \"aggregate\"." -msgstr "" +msgstr "Aunque ocupa algo más de espacio que un int, trabajar con este tipo de identificadores tiene ventajas. Como generas tú mismo el identificador, puedes definir un conjunto de datos relacionados y guardarlo en una sola transacción. Las entidades que definen este conjunto de datos en el código suelen llamarse \"agregado\"." #. type: Plain text #: ../src/guide/start/databases.md msgid "Apply the migration with `make yii migrate:up`." -msgstr "" +msgstr "Aplica la migración con `make yii migrate:up`." #. type: Title ## #: ../src/guide/start/databases.md #, no-wrap msgid "An entity" -msgstr "" +msgstr "Una entidad" #. type: Plain text #: ../src/guide/start/databases.md msgid "Now that you have a table it is time to define an entity in the code. Create `src/Web/Page/Page.php`:" -msgstr "" +msgstr "Ahora que tienes una tabla, es hora de definir una entidad en el código. Crea `src/Web/Page/Page.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -612,19 +807,59 @@ msgid "" " }\n" "}\n" msgstr "" - -#. type: Plain text -#: ../src/guide/start/databases.md -msgid "Now that we have an entity, we need a place for methods to save it, delete it, and select either a single page or multiple pages. This is the repository boundary described earlier: the rest of the application works with `Page` objects and doesn't need to know how they are stored." -msgstr "" - -#. type: Plain text -#: ../src/guide/start/databases.md -msgid "Create `src/Web/Page/PageRepository.php`:" -msgstr "" - -#. type: Fenced code block (php) -#: ../src/guide/start/databases.md +"toSlug($title),\n" +" text: $text,\n" +" createdAt: $createdAt,\n" +" updatedAt: $updatedAt,\n" +" );\n" +" }\n" +"}\n" + +#. type: Plain text +#: ../src/guide/start/databases.md +msgid "Now that we have an entity, we need a place for methods to save it, delete it, and select either a single page or multiple pages. This is the repository boundary described earlier: the rest of the application works with `Page` objects and doesn't need to know how they are stored." +msgstr "Ahora que tenemos una entidad, necesitamos un lugar para los métodos que la guardan, la eliminan y seleccionan una sola página o varias. Esta es la frontera del repositorio descrita antes: el resto de la aplicación trabaja con objetos `Page` y no necesita saber cómo se almacenan." + +#. type: Plain text +#: ../src/guide/start/databases.md +msgid "Create `src/Web/Page/PageRepository.php`:" +msgstr "Crea `src/Web/Page/PageRepository.php`:" + +#. type: Fenced code block (php) +#: ../src/guide/start/databases.md #, no-wrap msgid "" " $page->id,\n" +" 'title' => $page->title,\n" +" 'slug' => $page->slug,\n" +" 'text' => $page->text,\n" +" 'created_at' => $page->createdAt,\n" +" 'updated_at' => $page->updatedAt,\n" +" ];\n" +"\n" +" if ($this->exists($page->id)) {\n" +" $this->connection->createCommand()->update('{{%page}}', $row, ['id' => $page->id])->execute();\n" +" } else {\n" +" $this->connection->createCommand()->insert('{{%page}}', $row)->execute();\n" +" }\n" +" }\n" +"\n" +" public function findOneBySlug(string $slug): ?Page\n" +" {\n" +" $query = $this->connection\n" +" ->select()\n" +" ->from('{{%page}}')\n" +" ->where('slug = :slug', ['slug' => $slug]);\n" +"\n" +" return $this->createPage($query->one());\n" +" }\n" +"\n" +" /**\n" +" * @return iterable\n" +" */\n" +" public function findAll(): iterable\n" +" {\n" +" $rows = $this->connection\n" +" ->select()\n" +" ->from('{{%page}}')\n" +" ->all();\n" +"\n" +" foreach ($rows as $row) {\n" +" yield $this->createPage($row);\n" +" }\n" +" }\n" +"\n" +" private function createPage(?array $row): ?Page\n" +" {\n" +" if ($row === null) {\n" +" return null;\n" +" }\n" +"\n" +" return Page::create(\n" +" id: $row['id'],\n" +" title: $row['title'],\n" +" text: $row['text'],\n" +" slug: $row['slug'],\n" +" createdAt: new DateTimeImmutable($row['created_at']),\n" +" updatedAt: new DateTimeImmutable($row['updated_at']),\n" +" );\n" +" }\n" +"\n" +" public function deleteBySlug(string $slug): void\n" +" {\n" +" $this->connection->createCommand()->delete(\n" +" '{{%page}}',\n" +" ['slug' => $slug],\n" +" )->execute();\n" +" }\n" +"\n" +" public function exists(string $id): bool\n" +" {\n" +" return $this->connection->createQuery()\n" +" ->from('{{%page}}')\n" +" ->where(['id' => $id])\n" +" ->exists();\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "In this repository there are both methods to get data and `save()` to do insert or update. DB returns raw data as arrays but our repository automatically creates entities from this raw data so later we operate typed data." -msgstr "" +msgstr "En este repositorio hay tanto métodos para obtener datos como `save()`, que inserta o actualiza. La base de datos devuelve los datos en bruto como arrays, pero nuestro repositorio crea automáticamente entidades a partir de ellos, de modo que después trabajamos con datos tipados." #. type: Title ## #: ../src/guide/start/databases.md #, no-wrap msgid "Actions and routes" -msgstr "" +msgstr "Acciones y rutas" #. type: Plain text #: ../src/guide/start/databases.md msgid "We need some actions to:" -msgstr "" +msgstr "Necesitamos algunas acciones para:" #. type: Bullet: '1. ' #: ../src/guide/start/databases.md msgid "List all pages." -msgstr "" +msgstr "Listar todas las páginas." #. type: Bullet: '2. ' #: ../src/guide/start/databases.md msgid "View a page." -msgstr "" +msgstr "Ver una página." #. type: Bullet: '3. ' #: ../src/guide/start/databases.md msgid "Delete a page." -msgstr "" +msgstr "Eliminar una página." #. type: Bullet: '4. ' #: ../src/guide/start/databases.md msgid "Create a page." -msgstr "" +msgstr "Crear una página." #. type: Bullet: '5. ' #: ../src/guide/start/databases.md msgid "Update a page." -msgstr "" +msgstr "Actualizar una página." #. type: Plain text #: ../src/guide/start/databases.md msgid "Then we need routing for all these." -msgstr "" +msgstr "Después necesitamos el enrutamiento para todas ellas." #. type: Plain text #: ../src/guide/start/databases.md msgid "Let's tackle these one by one." -msgstr "" +msgstr "Vamos a abordarlas una a una." #. type: Title ### #: ../src/guide/start/databases.md #, no-wrap msgid "List all pages" -msgstr "" +msgstr "Listar todas las páginas" #. type: Plain text #: ../src/guide/start/databases.md msgid "Create `src/Web/Page/ListAction.php`:" -msgstr "" +msgstr "Crea `src/Web/Page/ListAction.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -811,11 +1136,36 @@ msgid "" " }\n" "}\n" msgstr "" +"viewRenderer->render(__DIR__ . '/list', [\n" +" 'pages' => $this->pageRepository->findAll(),\n" +" ]);\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "Define list view in `src/Web/Page/list.php`:" -msgstr "" +msgstr "Define la vista de lista en `src/Web/Page/list.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -840,17 +1190,35 @@ msgid "" "\n" "generate('page/edit', ['slug' => 'new'])) ?>\n" msgstr "" +" $pages */\n" +"/** @var UrlGeneratorInterface $urlGenerator */\n" +"?>\n" +"\n" +"\n" +"\n" +"generate('page/edit', ['slug' => 'new'])) ?>\n" #. type: Title ### #: ../src/guide/start/databases.md #, no-wrap msgid "View a page" -msgstr "" +msgstr "Ver una página" #. type: Plain text #: ../src/guide/start/databases.md msgid "Create `src/Web/Page/ViewAction.php`:" -msgstr "" +msgstr "Crea `src/Web/Page/ViewAction.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -891,11 +1259,45 @@ msgid "" " }\n" "}\n" msgstr "" +"pageRepository->findOneBySlug($slug);\n" +" if ($page === null) {\n" +" return $this->responseFactory->createResponse(Status::NOT_FOUND);\n" +" }\n" +"\n" +" return $this->viewRenderer->render(__DIR__ . '/view', [\n" +" 'page' => $page,\n" +" ]);\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "Now, a template in `src/Web/Page/view.php`:" -msgstr "" +msgstr "Ahora, una plantilla en `src/Web/Page/view.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -930,22 +1332,50 @@ msgid "" " \n" "close() ?>\n" msgstr "" +"\n" +"\n" +"

generate('page/list')) ?> → title) ?>

\n" +"\n" +"

\n" +" text) ?>\n" +"

\n" +"\n" +"generate('page/edit', ['slug' => $page->slug])) ?> |\n" +"\n" +"\n" +"post($urlGenerator->generate('page/delete', ['slug' => $page->slug]))\n" +" ->csrf($csrf);\n" +"?>\n" +"open() ?>\n" +" \n" +"close() ?>\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "In this view we have a form that submits a request for page deletion. Handing it with `GET` is common as well, but it is very wrong. Since deletion changes data, it needs to be handled by one of the non-idempotent HTTP methods. We use POST and a form in our example, but it could be `DELETE` and async request made with JavaScript. The button could be later styled properly to look similar to the \"Edit\"." -msgstr "" +msgstr "En esta vista tenemos un formulario que envía una solicitud para eliminar la página. Gestionarlo con `GET` también es habitual, pero es un grave error. Como la eliminación modifica datos, debe gestionarse con uno de los métodos HTTP no idempotentes. En nuestro ejemplo usamos POST y un formulario, pero podría ser `DELETE` y una solicitud asíncrona hecha con JavaScript. Más adelante se le puede dar estilo al botón para que se parezca a \"Edit\"." #. type: Title ### #: ../src/guide/start/databases.md #, no-wrap msgid "Delete a page" -msgstr "" +msgstr "Eliminar una página" #. type: Plain text #: ../src/guide/start/databases.md msgid "Create `src/Web/Page/DeleteAction.php`:" -msgstr "" +msgstr "Crea `src/Web/Page/DeleteAction.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -984,17 +1414,49 @@ msgid "" " }\n" "}\n" msgstr "" +"pageRepository->deleteBySlug($slug);\n" +"\n" +" return $this->responseFactory\n" +" ->createResponse(Status::SEE_OTHER)\n" +" ->withHeader('Location', $this->urlGenerator->generate('page/list'));\n" +" }\n" +"}\n" #. type: Title ### #: ../src/guide/start/databases.md #, no-wrap msgid "Create or update a page" -msgstr "" +msgstr "Crear o actualizar una página" #. type: Plain text #: ../src/guide/start/databases.md msgid "First of all, we need a form at `src/Web/Page/Form.php`:" -msgstr "" +msgstr "En primer lugar, necesitamos un formulario en `src/Web/Page/Form.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -1021,11 +1483,31 @@ msgid "" " public string $text = '';\n" "}\n" msgstr "" +"findOneBySlug($slug);\n" +" if ($page === null) {\n" +" return $this->responseFactory->createResponse(Status::NOT_FOUND);\n" +" }\n" +"\n" +" $form->title = $page->title;\n" +" $form->text = $page->text;\n" +" }\n" +"\n" +" $this->formHydrator->populateFromPostAndValidate($form, $request);\n" +"\n" +" if ($form->isValid()) {\n" +" $id = $isNew ? Uuid::uuid7()->toString() : $page->id;\n" +"\n" +" $page = Page::create(\n" +" id: $id,\n" +" title: $form->title,\n" +" text: $form->text,\n" +" );\n" +"\n" +" $pageRepository->save($page);\n" +"\n" +" return $this->responseFactory\n" +" ->createResponse(Status::SEE_OTHER)\n" +" ->withHeader(\n" +" 'Location',\n" +" $this->urlGenerator->generate('page/view', ['slug' => $page->slug]),\n" +" );\n" +" }\n" +"\n" +" return $this->viewRenderer->render(__DIR__ . '/edit', [\n" +" 'form' => $form,\n" +" 'isNew' => $isNew,\n" +" 'slug' => $slug,\n" +" ]);\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/databases.md #, no-wrap msgid "Note that `Uuid::uuid7()->toString()` won't work for MySQL and you'll need bytes instead, `Uuid::uuid7()->getBytes()`.\n" -msgstr "" +msgstr "Ten en cuenta que `Uuid::uuid7()->toString()` no funcionará con MySQL; en ese caso necesitarás los bytes, `Uuid::uuid7()->getBytes()`.\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "In the above we use a special slug in the URL for new pages so the URL looks like `http://localhost/pages/new`. If the page isn't new, we pre-fill the form with the data from the database. Similar to how we did in [Working with forms](forms.md), we handle the form submission. After successful save we redirect to the page view." -msgstr "" +msgstr "En el código anterior usamos un slug especial en la URL para las páginas nuevas, de modo que la URL queda como `http://localhost/pages/new`. Si la página no es nueva, rellenamos previamente el formulario con los datos de la base de datos. Igual que hicimos en [Trabajar con formularios](forms.md), gestionamos el envío del formulario. Tras guardar correctamente, redirigimos a la vista de la página." #. type: Plain text #: ../src/guide/start/databases.md msgid "Now, a template in `src/Web/Page/edit.php`:" -msgstr "" +msgstr "Ahora, una plantilla en `src/Web/Page/edit.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -1156,11 +1714,37 @@ msgid "" " \n" "close() ?>\n" msgstr "" +"post($urlGenerator->generate('page/edit', ['slug' => $slug]))\n" +" ->csrf($csrf);\n" +"?>\n" +"\n" +"open() ?>\n" +" required() ?>\n" +" required() ?>\n" +" \n" +"close() ?>\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "Adjust `config/common/routes.php`:" -msgstr "" +msgstr "Ajusta `config/common/routes.php`:" #. type: Fenced code block (php) #: ../src/guide/start/databases.md @@ -1202,19 +1786,54 @@ msgid "" " ),\n" "];\n" msgstr "" +"routes(\n" +" Route::get('/')\n" +" ->action(Web\\HomePage\\Action::class)\n" +" ->name('home'),\n" +" Route::methods([Method::GET, Method::POST], '/say')\n" +" ->action(Web\\Echo\\Action::class)\n" +" ->name('echo/say'),\n" +"\n" +" Group::create('/pages')->routes(\n" +" Route::get('')\n" +" ->action(Web\\Page\\ListAction::class)\n" +" ->name('page/list'),\n" +" Route::get('/{slug}')\n" +" ->action(Web\\Page\\ViewAction::class)\n" +" ->name('page/view'),\n" +" Route::methods([Method::GET, Method::POST], '/{slug}/edit')\n" +" ->action(Web\\Page\\EditAction::class)\n" +" ->name('page/edit'),\n" +" Route::post('/{slug}/delete')\n" +" ->action(Web\\Page\\DeleteAction::class)\n" +" ->name('page/delete'),\n" +" ),\n" +" ),\n" +"];\n" #. type: Plain text #: ../src/guide/start/databases.md msgid "Note that we've grouped all page-related routes with a group under `/pages` prefix. That is a convenient way to both not to repeat yourself and add some extra middleware, such as authentication, to the whole group." -msgstr "" +msgstr "Ten en cuenta que hemos agrupado todas las rutas relacionadas con las páginas en un grupo con el prefijo `/pages`. Es una forma práctica tanto de no repetirse como de añadir middlewares adicionales, como la autenticación, a todo el grupo." #. type: Title ## #: ../src/guide/start/databases.md ../src/guide/start/hello.md #, no-wrap msgid "Trying it out" -msgstr "" +msgstr "Probarlo" #. type: Plain text #: ../src/guide/start/databases.md msgid "Now try it out by opening `http://localhost/pages` in your browser." -msgstr "" +msgstr "Ahora pruébalo abriendo `http://localhost/pages` en tu navegador." diff --git a/_translations/po/es/guide_start_demo-apps.md.po b/_translations/po/es/guide_start_demo-apps.md.po index 3516976c..9adf871b 100644 --- a/_translations/po/es/guide_start_demo-apps.md.po +++ b/_translations/po/es/guide_start_demo-apps.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-05 10:18+0000\n" -"PO-Revision-Date: 2026-03-01 17:44+0000\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,42 +20,42 @@ msgstr "" #: ../src/guide/start/demo-apps.md #, no-wrap msgid "Demo Applications" -msgstr "" +msgstr "Aplicaciones de demostración" #. type: Plain text #: ../src/guide/start/demo-apps.md msgid "There are several demo applications that showcase different architectural approaches and framework capabilities." -msgstr "" +msgstr "Hay varias aplicaciones de demostración que muestran distintos enfoques arquitectónicos y capacidades del framework." #. type: Plain text #: ../src/guide/start/demo-apps.md #, no-wrap msgid "**[Demo Blog](https://github.com/yiisoft/demo-blog) — Layered DDD architecture**\n" -msgstr "" +msgstr "**[Demo Blog](https://github.com/yiisoft/demo-blog) — Arquitectura DDD por capas**\n" #. type: Plain text #: ../src/guide/start/demo-apps.md msgid "A blog application demonstrating a layered architecture following Domain-Driven Design (DDD) principles. This demo is a good starting point if you want to learn how to structure a Yii3 application with a clear separation of concerns between domain, application, and infrastructure layers." -msgstr "" +msgstr "Una aplicación de blog que muestra una arquitectura por capas basada en los principios del diseño guiado por el dominio (DDD, Domain-Driven Design). Esta demo es un buen punto de partida si quieres aprender a estructurar una aplicación Yii3 con una separación clara de responsabilidades entre las capas de dominio, aplicación e infraestructura." #. type: Plain text #: ../src/guide/start/demo-apps.md #, no-wrap msgid "**[Demo Diary](https://github.com/yiisoft/demo-diary) — Vertical slices architecture**\n" -msgstr "" +msgstr "**[Demo Diary](https://github.com/yiisoft/demo-diary) — Arquitectura de porciones verticales**\n" #. type: Plain text #: ../src/guide/start/demo-apps.md msgid "A diary application built using the vertical slices architecture pattern. In this approach, each feature is implemented end-to-end rather than being split across horizontal layers, making it easier to add or modify features independently." -msgstr "" +msgstr "Una aplicación de diario creada con el patrón de arquitectura de porciones verticales (vertical slices). En este enfoque, cada funcionalidad se implementa de extremo a extremo en lugar de repartirse entre capas horizontales, lo que facilita añadir o modificar funcionalidades de forma independiente." #. type: Plain text #: ../src/guide/start/demo-apps.md #, no-wrap msgid "**[Demo Summarizer](https://github.com/yiisoft/demo-summarizer) — Large language model (LLM) document summarizer**\n" -msgstr "" +msgstr "**[Demo Summarizer](https://github.com/yiisoft/demo-summarizer) — Resumidor de documentos con un modelo de lenguaje de gran tamaño (LLM)**\n" #. type: Plain text #: ../src/guide/start/demo-apps.md msgid "A runnable Yii3 demo for uploading documents, extracting readable Markdown, summarizing content, and tracking processing progress." -msgstr "" +msgstr "Una demo de Yii3 lista para ejecutar que permite subir documentos, extraer de ellos Markdown legible, resumir su contenido y seguir el progreso del procesamiento." diff --git a/_translations/po/es/guide_start_forms.md.po b/_translations/po/es/guide_start_forms.md.po index b1580557..cfe48356 100644 --- a/_translations/po/es/guide_start_forms.md.po +++ b/_translations/po/es/guide_start_forms.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-30 09:05+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -22,78 +22,77 @@ msgstr "" #: ../src/guide/start/forms.md ../src/guide/start/hello.md #, no-wrap msgid "Summary" -msgstr "" +msgstr "Resumen" #. type: Title # #: ../src/guide/start/forms.md #, no-wrap msgid "Working with forms" -msgstr "" +msgstr "Trabajar con formularios" #. type: Plain text #: ../src/guide/start/forms.md msgid "This section continues to improve on \"Saying Hello.\" Instead of using URL, you will now ask a user for a message via form." -msgstr "" +msgstr "Esta sección sigue mejorando el ejemplo de \"Decir hola\". En lugar de usar la URL, ahora pedirás al usuario un mensaje mediante un formulario." #. type: Plain text #: ../src/guide/start/forms.md msgid "Through this tutorial, you will learn how to:" -msgstr "" +msgstr "Con este tutorial aprenderás a:" #. type: Bullet: '* ' #: ../src/guide/start/forms.md msgid "Create a form model to represent the data entered by a user through a form." -msgstr "" +msgstr "Crear un modelo de formulario que represente los datos que introduce un usuario a través de un formulario." #. type: Bullet: '* ' #: ../src/guide/start/forms.md msgid "Declare rules to validate the data entered." -msgstr "" +msgstr "Declarar reglas para validar los datos introducidos." #. type: Bullet: '* ' #: ../src/guide/start/forms.md msgid "Build an HTML form in a view." -msgstr "" +msgstr "Construir un formulario HTML en una vista." #. type: Title ## #: ../src/guide/start/forms.md #, no-wrap msgid "Installing form package" -msgstr "" +msgstr "Instalar el paquete de formularios" #. type: Plain text #: ../src/guide/start/forms.md msgid "To install form package, issue the following command in your application directory:" -msgstr "" +msgstr "Para instalar el paquete de formularios, ejecuta el siguiente comando en el directorio de tu aplicación:" #. type: Fenced code block #: ../src/guide/start/forms.md #, no-wrap msgid "composer require yiisoft/form-model\n" -msgstr "" +msgstr "composer require yiisoft/form-model\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "For Docker that would be:" -msgstr "" +msgstr "Con Docker sería:" #. type: Fenced code block #: ../src/guide/start/forms.md #, no-wrap msgid "make composer require yiisoft/form-model\n" -msgstr "" +msgstr "make composer require yiisoft/form-model\n" #. type: Title ## #: ../src/guide/start/forms.md -#, fuzzy, no-wrap -#| msgid "Generating API documentation" +#, no-wrap msgid "Creating a form" -msgstr "Generación de Documentación de API" +msgstr "Crear un formulario" #. type: Plain text #: ../src/guide/start/forms.md msgid "The data to be requested from the user will be represented by a `Form` class as shown below and saved in the file `/src/Web/Echo/Form.php`:" -msgstr "" +msgstr "Los datos que se pedirán al usuario se representarán mediante una clase `Form`, como la que se muestra a continuación, guardada en el archivo `/src/Web/Echo/Form.php`:" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -116,11 +115,27 @@ msgid "" " public string $message = '';\n" "}\n" msgstr "" +" option because PHP attributes can't contain closures. For example, validate UUID syntax with `Uuid`, then add\n" "> `#[Callback(method: 'validateUuidV7', skipOnError: true)]` only when your domain specifically requires UUID version 7.\n" msgstr "" +"> Nota: los atributos de validación son reglas de Yii Validator. Para las comprobaciones habituales, busca primero una regla existente. Si un campo\n" +"> necesita además una validación específica de la aplicación, usa `Callback` para esa lógica de dominio. Con atributos de PHP, usa la opción `method`,\n" +"> porque los atributos de PHP no pueden contener closures. Por ejemplo, valida la sintaxis del UUID con `Uuid` y añade\n" +"> `#[Callback(method: 'validateUuidV7', skipOnError: true)]` solo cuando tu dominio requiera específicamente la versión 7 de UUID.\n" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -151,27 +170,41 @@ msgid "" " : (new Result())->addError('ID must be a UUID version 7.');\n" "}\n" msgstr "" +"use Yiisoft\\Validator\\Result;\n" +"use Yiisoft\\Validator\\Rule\\Callback;\n" +"use Yiisoft\\Validator\\Rule\\Uuid;\n" +"\n" +"#[Uuid(skipOnError: true)]\n" +"#[Callback(method: 'validateUuidV7', skipOnError: true)]\n" +"public string $id = '';\n" +"\n" +"private function validateUuidV7(mixed $value): Result\n" +"{\n" +" return \\App\\Support\\Uuid::isVersion7($value)\n" +" ? new Result()\n" +" : (new Result())->addError('ID must be a UUID version 7.');\n" +"}\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "The callback method returns a `Result`: return an empty result when the value is valid or add an error when it isn't. The method body can call any validation code your application already uses, such as `App\\Support\\Uuid::isValid($value, 'v7')`. See [Callback rule details](https://github.com/yiisoft/validator/blob/master/docs/guide/en/built-in-rules-callback.md) for full examples and available method signatures." -msgstr "" +msgstr "El método callback devuelve un `Result`: devuelve un resultado vacío cuando el valor es válido o añade un error cuando no lo es. El cuerpo del método puede llamar a cualquier código de validación que tu aplicación ya use, como `App\\Support\\Uuid::isValid($value, 'v7')`. Consulta los [detalles de la regla Callback](https://github.com/yiisoft/validator/blob/master/docs/guide/en/built-in-rules-callback.md) para ver ejemplos completos y las firmas de método disponibles." #. type: Plain text #: ../src/guide/start/forms.md msgid "For validation logic reused in several forms, create a custom Yii Validator rule and handler instead of copying callback methods. See the [custom rule guide](https://github.com/yiisoft/validator/blob/master/docs/guide/en/creating-custom-rules.md) for the rule/handler structure." -msgstr "" +msgstr "Para la lógica de validación que se reutiliza en varios formularios, crea una regla y un manejador personalizados de Yii Validator en lugar de copiar métodos callback. Consulta la [guía de reglas personalizadas](https://github.com/yiisoft/validator/blob/master/docs/guide/en/creating-custom-rules.md) para ver la estructura de regla y manejador." #. type: Title ## #: ../src/guide/start/forms.md -#, fuzzy, no-wrap +#, no-wrap msgid "Custom validation" -msgstr "Introducción" +msgstr "Validación personalizada" #. type: Plain text #: ../src/guide/start/forms.md msgid "Validation attributes are Yii Validator rules. For common checks, first look for an existing rule. For example, to validate a UUID string, use `Uuid`:" -msgstr "" +msgstr "Los atributos de validación son reglas de Yii Validator. Para las comprobaciones habituales, busca primero una regla existente. Por ejemplo, para validar una cadena UUID, usa `Uuid`:" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -186,11 +219,19 @@ msgid "" " public string $id = '';\n" "}\n" msgstr "" +"use Yiisoft\\FormModel\\FormModel;\n" +"use Yiisoft\\Validator\\Rule\\Uuid;\n" +"\n" +"final class Form extends FormModel\n" +"{\n" +" #[Uuid]\n" +" public string $id = '';\n" +"}\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "When a field needs application-specific validation that isn't covered by a built-in rule, use `Callback`. This is useful for one-off checks or for delegating to a domain/library method. With PHP attributes, use the `method` option because PHP attributes can't contain closures. For example, the following form validates a card number checksum:" -msgstr "" +msgstr "Cuando un campo necesita una validación específica de la aplicación que no cubre ninguna regla integrada, usa `Callback`. Es útil para comprobaciones puntuales o para delegar en un método del dominio o de una biblioteca. Con atributos de PHP, usa la opción `method`, porque los atributos de PHP no pueden contener closures. Por ejemplo, el siguiente formulario valida la suma de verificación de un número de tarjeta:" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -253,28 +294,83 @@ msgid "" " }\n" "}\n" msgstr "" +"addError('Card number must be a string.');\n" +" }\n" +"\n" +" $digits = str_replace([' ', '-'], '', $value);\n" +"\n" +" if ($digits === '' || !ctype_digit($digits)) {\n" +" return (new Result())->addError('Card number must contain digits only.');\n" +" }\n" +"\n" +" $sum = 0;\n" +" $double = false;\n" +"\n" +" foreach (array_reverse(str_split($digits)) as $digit) {\n" +" $number = (int) $digit;\n" +"\n" +" if ($double) {\n" +" $number *= 2;\n" +" if ($number > 9) {\n" +" $number -= 9;\n" +" }\n" +" }\n" +"\n" +" $sum += $number;\n" +" $double = !$double;\n" +" }\n" +"\n" +" if ($sum % 10 !== 0) {\n" +" return (new Result())->addError('Card number checksum is invalid.');\n" +" }\n" +"\n" +" return new Result();\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "The callback method returns a `Result`: return an empty result when the value is valid or add an error when it isn't. The method body can call any validation code your application already uses, such as `App\\Payment\\CardNumber::hasValidChecksum($value)`." -msgstr "" +msgstr "El método callback devuelve un `Result`: devuelve un resultado vacío cuando el valor es válido o añade un error cuando no lo es. El cuerpo del método puede llamar a cualquier código de validación que tu aplicación ya use, como `App\\Payment\\CardNumber::hasValidChecksum($value)`." #. type: Title ## #: ../src/guide/start/forms.md -#, fuzzy, no-wrap -#| msgid "Raising events " +#, no-wrap msgid "Validating several fields together" -msgstr "Lanzamiento de Eventos " +msgstr "Validar varios campos a la vez" #. type: Plain text #: ../src/guide/start/forms.md msgid "Property attributes are enough when each field can be validated independently. When a rule depends on several fields, put a `Callback` rule on the form model class and attach an error to the field that should display it." -msgstr "" +msgstr "Los atributos de propiedad bastan cuando cada campo puede validarse de forma independiente. Cuando una regla depende de varios campos, pon una regla `Callback` en la clase del modelo de formulario y asocia el error al campo que debe mostrarlo." #. type: Plain text #: ../src/guide/start/forms.md msgid "For example, a report filter may require the start date to be earlier than or equal to the end date:" -msgstr "" +msgstr "Por ejemplo, un filtro de informes puede exigir que la fecha de inicio sea anterior o igual a la fecha de fin:" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -340,27 +436,86 @@ msgid "" " }\n" "}\n" msgstr "" +"dateFrom === '' || $this->dateTo === '') {\n" +" return $result;\n" +" }\n" +"\n" +" $dateFrom = $this->parseDate($this->dateFrom);\n" +" $dateTo = $this->parseDate($this->dateTo);\n" +"\n" +" if ($dateFrom === null || $dateTo === null) {\n" +" return $result;\n" +" }\n" +"\n" +" if ($dateFrom > $dateTo) {\n" +" $result->addError('The start date must be earlier than or equal to the end date.', [], ['dateFrom']);\n" +" }\n" +"\n" +" return $result;\n" +" }\n" +"\n" +" private function parseDate(string $value): ?DateTimeImmutable\n" +" {\n" +" $date = DateTimeImmutable::createFromFormat('!Y-m-d', $value);\n" +" $errors = DateTimeImmutable::getLastErrors();\n" +"\n" +" if ($date === false || ($errors !== false && ($errors['warning_count'] > 0 || $errors['error_count'] > 0))) {\n" +" return null;\n" +" }\n" +"\n" +" return $date;\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "The class-level `Callback` receives the whole object as `$value`, but using `$this` is usually clearer in a form model method. Returning an empty `Result` means the cross-field rule passed. The third argument of `addError()` is the value path; `['dateFrom']` makes the error appear on the `dateFrom` field when rendering the form." -msgstr "" +msgstr "El `Callback` a nivel de clase recibe el objeto completo como `$value`, pero en un método del modelo de formulario suele ser más claro usar `$this`. Devolver un `Result` vacío significa que la regla entre campos se ha cumplido. El tercer argumento de `addError()` es la ruta del valor: `['dateFrom']` hace que el error aparezca en el campo `dateFrom` al renderizar el formulario." #. type: Title ## #: ../src/guide/start/forms.md #, no-wrap msgid "Using the form " -msgstr "" +msgstr "Usar el formulario" #. type: Plain text #: ../src/guide/start/forms.md msgid "Now that you have a form, use it in your action from \"[Saying Hello](hello.md)\"." -msgstr "" +msgstr "Ahora que tienes un formulario, úsalo en tu acción de \"[Decir hola](hello.md)\"." #. type: Plain text #: ../src/guide/start/forms.md msgid "Here's what you end up with in `/src/Web/Echo/Action.php`:" -msgstr "" +msgstr "Este es el resultado final en `/src/Web/Echo/Action.php`:" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -396,16 +551,45 @@ msgid "" " }\n" "}\n" msgstr "" +"formHydrator->populateFromPostAndValidate($form, $request);\n" +"\n" +" return $this->viewRenderer->render(__DIR__ . '/template', [\n" +" 'form' => $form,\n" +" ]);\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "Instead of reading from route, you fill your form from request's POST data and validate it with the help of `FormHydrator`. Next you pass the form to the view." -msgstr "" +msgstr "En lugar de leer de la ruta, rellenas el formulario con los datos POST de la solicitud y lo validas con la ayuda de `FormHydrator`. Después pasas el formulario a la vista." #. type: Plain text #: ../src/guide/start/forms.md msgid "For the form to function we need to allow both GET to render the form and POST to send the data. Adjust your route in `config/common/routes.php`:" -msgstr "" +msgstr "Para que el formulario funcione, hay que permitir tanto GET, para mostrar el formulario, como POST, para enviar los datos. Ajusta tu ruta en `config/common/routes.php`:" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -432,17 +616,37 @@ msgid "" " ),\n" "];\n" msgstr "" +"routes(\n" +" Route::get('/')\n" +" ->action(Web\\HomePage\\Action::class)\n" +" ->name('home'),\n" +" Route::methods([Method::GET, Method::POST], '/say')\n" +" ->action(Web\\Echo\\Action::class)\n" +" ->name('echo/say'),\n" +" ),\n" +"];\n" #. type: Title ## #: ../src/guide/start/forms.md #, no-wrap msgid "Adjusting view" -msgstr "" +msgstr "Ajustar la vista" #. type: Plain text #: ../src/guide/start/forms.md msgid "To render a form, you need to change your view, `src/Web/Echo/template.php`:" -msgstr "" +msgstr "Para renderizar un formulario, tienes que cambiar la vista, `src/Web/Echo/template.php`:" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -476,16 +680,43 @@ msgid "" " Echo said: message) ?>\n" "\n" msgstr "" +"post($urlGenerator->generate('echo/say'))\n" +" ->csrf($csrf);\n" +"?>\n" +"\n" +"open() ?>\n" +" required() ?>\n" +" \n" +"close() ?>\n" +"\n" +"isValid()): ?>\n" +" Echo said: message) ?>\n" +"\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "If the form is valid, you display a message. The rest initializes and renders the form." -msgstr "" +msgstr "Si el formulario es válido, muestras un mensaje. El resto inicializa y renderiza el formulario." #. type: Plain text #: ../src/guide/start/forms.md msgid "First, you initialize `$htmlForm` with the POST type and the action URL generated with the help from the URL generator. You can access it as `$urlGenerator` in all views. You also need to pass the CSRF token to the form, which is also available in every view as `$csrf` thanks to the view injections listed in `config/common/params.php`:" -msgstr "" +msgstr "Primero, inicializas `$htmlForm` con el tipo POST y la URL de acción generada con la ayuda del generador de URL, al que puedes acceder como `$urlGenerator` en todas las vistas. También tienes que pasar el token CSRF al formulario; está disponible en todas las vistas como `$csrf` gracias a las inyecciones de vista indicadas en `config/common/params.php`:" #. type: Fenced code block (php) #: ../src/guide/start/forms.md @@ -497,70 +728,75 @@ msgid "" " ],\n" "],\n" msgstr "" +"'yiisoft/yii-view-renderer' => [\n" +" 'injections' => [\n" +" Reference::to(CsrfViewInjection::class),\n" +" ],\n" +"],\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "The template renders the CSRF token value as a hidden input to ensure that the request originates from the form page and not from another website. It will be submitted along with POST form data. Omitting it would result in [HTTP response code 422](https://tools.ietf.org/html/rfc4918#section-11.2)." -msgstr "" +msgstr "La plantilla renderiza el valor del token CSRF como un campo oculto para garantizar que la solicitud procede de la página del formulario y no de otro sitio web. Se enviará junto con los datos POST del formulario. Si se omite, se obtiene un [código de respuesta HTTP 422](https://tools.ietf.org/html/rfc4918#section-11.2)." #. type: Plain text #: ../src/guide/start/forms.md msgid "You use `Field::text()` to output \"message\" field, so it takes care about filling the value, escaping it, rendering field label and validation errors." -msgstr "" +msgstr "Usas `Field::text()` para mostrar el campo \"message\", que se encarga de rellenar el valor, escaparlo y renderizar la etiqueta del campo y los errores de validación." #. type: Plain text #: ../src/guide/start/forms.md msgid "Now, in case you submit an empty message, you will get a validation error: \"The message to be echoed must contain at least 2 characters.\"" -msgstr "" +msgstr "Ahora, si envías un mensaje vacío, obtendrás un error de validación: \"The message to be echoed must contain at least 2 characters.\"" #. type: Title ## #: ../src/guide/start/forms.md #, no-wrap msgid "Trying it Out" -msgstr "" +msgstr "Probarlo" #. type: Plain text #: ../src/guide/start/forms.md msgid "To see how it works, use your browser to access the following URL:" -msgstr "" +msgstr "Para ver cómo funciona, accede con tu navegador a la siguiente URL:" #. type: Fenced code block #: ../src/guide/start/forms.md #, no-wrap msgid "http://localhost:8080/say\n" -msgstr "" +msgstr "http://localhost:8080/say\n" #. type: Plain text #: ../src/guide/start/forms.md msgid "You will see a page with a form input field and a label that indicates what data to enter. Also, the form has a \"submit\" button labeled \"Say\". If you click the \"submit\" button without entering anything, you will see that the field is required. If you enter a single character, the form displays an error message next to the problematic input field." -msgstr "" +msgstr "Verás una página con un campo de formulario y una etiqueta que indica qué datos introducir. Además, el formulario tiene un botón de envío con el texto \"Say\". Si pulsas el botón de envío sin introducir nada, verás que el campo es obligatorio. Si introduces un solo carácter, el formulario mostrará un mensaje de error junto al campo problemático." #. type: Plain text #: ../src/guide/start/forms.md msgid "![Form with a validation error](/images/guide/start/form-error.png)" -msgstr "" +msgstr "![Formulario con un error de validación](/images/guide/start/form-error.png)" #. type: Plain text #: ../src/guide/start/forms.md msgid "After you enter a valid message and click the \"submit\" button, the page echoes the data that you entered." -msgstr "" +msgstr "Después de introducir un mensaje válido y pulsar el botón de envío, la página repite los datos que has introducido." #. type: Plain text #: ../src/guide/start/forms.md msgid "![Form with a success message](/images/guide/start/form-success.png)" -msgstr "" +msgstr "![Formulario con un mensaje de éxito](/images/guide/start/form-success.png)" #. type: Plain text #: ../src/guide/start/forms.md msgid "In this section of the guide, you've learned how to create a form model class to represent the user data and validate said data." -msgstr "" +msgstr "En esta sección de la guía has aprendido a crear una clase de modelo de formulario para representar los datos del usuario y validarlos." #. type: Plain text #: ../src/guide/start/forms.md msgid "You've also learned how to get data from users and how to display data back in the browser. This is a task that could take you a lot of time when developing an application, but Yii provides powerful widgets to make this task easy." -msgstr "" +msgstr "También has aprendido a obtener datos de los usuarios y a mostrarlos de nuevo en el navegador. Es una tarea que podría llevarte mucho tiempo al desarrollar una aplicación, pero Yii proporciona widgets potentes que la facilitan." #. type: Plain text #: ../src/guide/start/forms.md msgid "In the next section, you will learn how to work with databases, which are needed in nearly every application." -msgstr "" +msgstr "En la siguiente sección aprenderás a trabajar con bases de datos, que se necesitan en casi todas las aplicaciones." diff --git a/_translations/po/es/guide_start_gii.md.po b/_translations/po/es/guide_start_gii.md.po index 9dcb6fb0..e5d5b3fc 100644 --- a/_translations/po/es/guide_start_gii.md.po +++ b/_translations/po/es/guide_start_gii.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-03-06 12:40+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,7 +20,7 @@ msgstr "" #: ../src/guide/start/gii.md #, no-wrap msgid "Generating code with Gii" -msgstr "" +msgstr "Generar código con Gii" #. type: Plain text #: ../src/guide/start/gii.md @@ -29,3 +29,5 @@ msgid "" "> [!NOTE]\n" "> Gii is under development and will be available later.\n" msgstr "" +"> [!NOTE]\n" +"> Gii está en desarrollo y estará disponible más adelante.\n" diff --git a/_translations/po/es/guide_start_hello.md.po b/_translations/po/es/guide_start_hello.md.po index 80e76490..e4fe92b8 100644 --- a/_translations/po/es/guide_start_hello.md.po +++ b/_translations/po/es/guide_start_hello.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-05 20:33+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,66 +20,65 @@ msgstr "" #: ../src/cookbook/deployment/docker-swarm-caddy.md ../src/cookbook/deployment/docker-swarm-traefik.md ../src/guide/start/forms.md ../src/guide/start/hello.md #, no-wrap msgid "Summary" -msgstr "" +msgstr "Resumen" #. type: Title ## #: ../src/guide/start/databases.md ../src/guide/start/hello.md #, no-wrap msgid "Trying it out" -msgstr "" +msgstr "Probarlo" #. type: Title # #: ../src/guide/start/hello.md #, no-wrap msgid "Saying hello" -msgstr "" +msgstr "Decir hola" #. type: Plain text #: ../src/guide/start/hello.md msgid "This section describes how to create a new \"Hello\" page in your application. It's a simple page that will echo back whatever you pass to it or, if nothing passed, will just say \"Hello!\"." -msgstr "" +msgstr "Esta sección describe cómo crear una nueva página \"Hello\" en tu aplicación. Es una página sencilla que devuelve lo que le pases o, si no le pasas nada, simplemente dice \"Hello!\"." #. type: Plain text #: ../src/guide/start/hello.md msgid "To achieve this goal, you will define a route and create [a handler](../structure/action.md) that does the job and forms the response. Then you will improve it to use [view](../views/view.md) for building the response." -msgstr "" +msgstr "Para conseguirlo, definirás una ruta y crearás [un manejador](../structure/action.md) que haga el trabajo y construya la respuesta. Después lo mejorarás para que use una [vista](../views/view.md) al construir la respuesta." #. type: Plain text #: ../src/guide/start/hello.md msgid "Through this tutorial, you will learn three things:" -msgstr "" +msgstr "Con este tutorial aprenderás tres cosas:" #. type: Bullet: '1. ' #: ../src/guide/start/hello.md msgid "How to create a handler to respond to a request." -msgstr "" +msgstr "Cómo crear un manejador que responda a una solicitud." #. type: Bullet: '2. ' #: ../src/guide/start/hello.md msgid "How to map URL to the handler." -msgstr "" +msgstr "Cómo asociar una URL al manejador." #. type: Bullet: '3. ' #: ../src/guide/start/hello.md msgid "How to use [view](../views/view.md) to compose the response's content." -msgstr "" +msgstr "Cómo usar una [vista](../views/view.md) para componer el contenido de la respuesta." #. type: Title ## #: ../src/guide/start/hello.md -#, fuzzy, no-wrap -#| msgid "Generating API documentation" +#, no-wrap msgid "Creating a handler" -msgstr "Generación de Documentación de API" +msgstr "Crear un manejador" #. type: Plain text #: ../src/guide/start/hello.md msgid "For the \"Hello\" task, you will create a handler class that reads a `message` parameter from the request and displays that message back to the user. If the request doesn't provide a `message` parameter, the action will display the default \"Hello\" message." -msgstr "" +msgstr "Para la tarea \"Hello\", crearás una clase manejadora que lee un parámetro `message` de la solicitud y muestra ese mensaje al usuario. Si la solicitud no proporciona un parámetro `message`, la acción mostrará el mensaje predeterminado \"Hello\"." #. type: Plain text #: ../src/guide/start/hello.md msgid "Create `src/Web/Echo/Action.php`:" -msgstr "" +msgstr "Crea `src/Web/Echo/Action.php`:" #. type: Fenced code block (php) #: ../src/guide/start/hello.md @@ -113,27 +112,54 @@ msgid "" " }\n" "}\n" msgstr "" +"responseFactory->createResponse();\n" +" $response->getBody()->write('The message is: ' . Html::encode($message));\n" +" return $response;\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/hello.md msgid "In your example, the `__invoke` method receives the `$message` parameter that with the help of `RouteArgument` attribute gets the message from URL. The value defaults to `\"Hello!\"`. If the request is made to `/say/Goodbye`, the action assigns the value \"Goodbye\" to the `$message` variable." -msgstr "" +msgstr "En este ejemplo, el método `__invoke` recibe el parámetro `$message`, que obtiene el mensaje de la URL gracias al atributo `RouteArgument`. Su valor predeterminado es `\"Hello!\"`. Si la solicitud se hace a `/say/Goodbye`, la acción asigna el valor \"Goodbye\" a la variable `$message`." #. type: Plain text #: ../src/guide/start/hello.md msgid "The application passes the response through the [middleware stack](../structure/middleware.md) to the emitter that outputs the response to the end user." -msgstr "" +msgstr "La aplicación pasa la respuesta por la [pila de middlewares](../structure/middleware.md) hasta el emisor, que envía la respuesta al usuario final." #. type: Title ## #: ../src/guide/start/hello.md #, no-wrap msgid "Configuring router" -msgstr "" +msgstr "Configurar el router" #. type: Plain text #: ../src/guide/start/hello.md msgid "Now, to map your handler to URL, you need to add a route in `config/common/routes.php`:" -msgstr "" +msgstr "Ahora, para asociar tu manejador a una URL, tienes que añadir una ruta en `config/common/routes.php`:" #. type: Fenced code block (php) #: ../src/guide/start/hello.md @@ -159,48 +185,66 @@ msgid "" " ),\n" "];\n" msgstr "" +"routes(\n" +" Route::get('/')\n" +" ->action(Web\\HomePage\\Action::class)\n" +" ->name('home'),\n" +" Route::get('/say[/{message}]')\n" +" ->action(Web\\Echo\\Action::class)\n" +" ->name('echo/say'),\n" +" ),\n" +"];\n" #. type: Plain text #: ../src/guide/start/hello.md msgid "In the above, you map the `/say[/{message}]` pattern to `\\App\\Web\\Echo\\Action`. For a request, the router creates an instance and calls the `__invoke()` method. The `{message}` part of the pattern writes anything specified in this place to the `message` route argument. `[]` marks this part of the pattern as optional." -msgstr "" +msgstr "En el código anterior, asocias el patrón `/say[/{message}]` a `\\App\\Web\\Echo\\Action`. Para cada solicitud, el router crea una instancia y llama al método `__invoke()`. La parte `{message}` del patrón guarda en el argumento de ruta `message` lo que se indique en esa posición. `[]` marca esa parte del patrón como opcional." #. type: Plain text #: ../src/guide/start/hello.md msgid "You also give a `echo/say` name to this route to be able to generate URLs pointing to it." -msgstr "" +msgstr "También le das el nombre `echo/say` a esta ruta para poder generar URL que apunten a ella." #. type: Plain text #: ../src/guide/start/hello.md msgid "After creating the action and the view open `http://localhost/say/Hello+World` in your browser." -msgstr "" +msgstr "Después de crear la acción y la vista, abre `http://localhost/say/Hello+World` en tu navegador." #. type: Plain text #: ../src/guide/start/hello.md msgid "This URL displays a page with \"The message is: Hello World\"." -msgstr "" +msgstr "Esta URL muestra una página con el texto \"The message is: Hello World\"." #. type: Plain text #: ../src/guide/start/hello.md msgid "If you omit the `message` parameter in the URL, the page displays \"The message is: Hello!\"." -msgstr "" +msgstr "Si omites el parámetro `message` en la URL, la página muestra \"The message is: Hello!\"." #. type: Title ## #: ../src/guide/start/hello.md -#, fuzzy, no-wrap -#| msgid "Generating API documentation" +#, no-wrap msgid "Creating a View Template" -msgstr "Generación de Documentación de API" +msgstr "Crear una plantilla de vista" #. type: Plain text #: ../src/guide/start/hello.md msgid "Usually, the task is more complicated than printing out \"hello world\" and involves rendering some complex HTML. For this task, it's handy to use view templates. They're scripts you write to generate a response's body." -msgstr "" +msgstr "Normalmente, la tarea es más complicada que imprimir \"hello world\" e implica renderizar un HTML complejo. Para eso resulta práctico usar plantillas de vista: son scripts que escribes para generar el cuerpo de una respuesta." #. type: Plain text #: ../src/guide/start/hello.md msgid "For the \"Hello\" task, create a `src/Web/Echo/template.php` template that prints the `message` parameter received from the action method:" -msgstr "" +msgstr "Para la tarea \"Hello\", crea una plantilla `src/Web/Echo/template.php` que imprima el parámetro `message` recibido del método de acción:" #. type: Fenced code block (php) #: ../src/guide/start/hello.md ../src/guide/views/view.md @@ -213,21 +257,27 @@ msgid "" "\n" "

The message is:

\n" msgstr "" +"\n" +"\n" +"

The message is:

\n" #. type: Plain text #: ../src/guide/start/hello.md msgid "In the above code, the `message` parameter uses HTML encoding before you print it. You need that because the parameter comes from an end user and is vulnerable to [cross-site scripting (XSS) attacks](https://en.wikipedia.org/wiki/Cross-site_scripting) by embedding malicious JavaScript in the parameter." -msgstr "" +msgstr "En el código anterior, el parámetro `message` se codifica en HTML antes de imprimirlo. Es necesario porque el parámetro procede del usuario final y es vulnerable a [ataques de cross-site scripting (XSS)](https://en.wikipedia.org/wiki/Cross-site_scripting), que insertan JavaScript malicioso en el parámetro." #. type: Plain text #: ../src/guide/start/hello.md msgid "Naturally, you may put more content in the `say` view. The content can consist of HTML tags, plain text, and even PHP statements. In fact, the view service executes the `say` view as a PHP script." -msgstr "" +msgstr "Naturalmente, puedes poner más contenido en la vista `say`. El contenido puede incluir etiquetas HTML, texto plano e incluso sentencias PHP. De hecho, el servicio de vistas ejecuta la vista `say` como un script PHP." #. type: Plain text #: ../src/guide/start/hello.md msgid "To use the view, you need to change `src/Web/Echo/Action.php`:" -msgstr "" +msgstr "Para usar la vista, tienes que cambiar `src/Web/Echo/Action.php`:" #. type: Fenced code block (php) #: ../src/guide/start/hello.md ../src/guide/views/view.md @@ -260,28 +310,54 @@ msgid "" " }\n" "}\n" msgstr "" +"viewRenderer->render(__DIR__ . '/template', [\n" +" 'message' => $message,\n" +" ]);\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/start/hello.md msgid "Now open your browser and check it again. You should see the similar text but with a layout applied." -msgstr "" +msgstr "Ahora abre el navegador y compruébalo de nuevo. Deberías ver un texto parecido, pero con un layout aplicado." #. type: Plain text #: ../src/guide/start/hello.md msgid "Also, you've separated the part about how it works and part of how it's presented. In the larger applications, it helps a lot to deal with complexity." -msgstr "" +msgstr "Además, has separado la parte que define cómo funciona de la parte que define cómo se presenta. En aplicaciones más grandes, esto ayuda mucho a gestionar la complejidad." #. type: Plain text #: ../src/guide/start/hello.md msgid "In this section, you've touched the handler and template parts of the typical web application. You created a handler as part of a class to handle a specific request. You also created a view to compose the response's content. In this simple example, no data source was involved as the only data used was the `message` parameter." -msgstr "" +msgstr "En esta sección has trabajado con las partes de manejador y de plantilla de una aplicación web típica. Has creado un manejador como parte de una clase para gestionar una solicitud concreta. También has creado una vista para componer el contenido de la respuesta. En este ejemplo sencillo no ha intervenido ninguna fuente de datos, ya que el único dato usado era el parámetro `message`." #. type: Plain text #: ../src/guide/start/hello.md msgid "You've also learned about routing in Yii, which acts as the bridge between user requests and handlers." -msgstr "" +msgstr "También has aprendido cómo funciona el enrutamiento en Yii, que actúa como puente entre las solicitudes de los usuarios y los manejadores." #. type: Plain text #: ../src/guide/start/hello.md msgid "In the next section, you will learn how to fetch data and add a new page containing an HTML form." -msgstr "" +msgstr "En la siguiente sección aprenderás a obtener datos y a añadir una página nueva que contiene un formulario HTML." diff --git a/_translations/po/es/guide_start_looking-ahead.md.po b/_translations/po/es/guide_start_looking-ahead.md.po index ac2cc51b..6ca6b59f 100644 --- a/_translations/po/es/guide_start_looking-ahead.md.po +++ b/_translations/po/es/guide_start_looking-ahead.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2025-12-24 13:00+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,9 +20,9 @@ msgstr "" #: ../src/guide/start/looking-ahead.md #, no-wrap msgid "Looking ahead" -msgstr "" +msgstr "Próximos pasos" #. type: Plain text #: ../src/guide/start/looking-ahead.md msgid "If you've read through the entire \"Getting Started\" chapter, you have now created a complete Yii application. In the process, you've learned how to implement some commonly necessary features, such as getting data from users via an HTML form, fetching data from a database, and displaying data in a paginated fashion. You've also learned how to use [Gii](gii.md) to generate code automatically. Using Gii for code generation turns the bulk of your Web development process into a task as simple as just filling out some forms." -msgstr "" +msgstr "Si has leído todo el capítulo \"Primeros pasos\", ya has creado una aplicación Yii completa. Por el camino has aprendido a implementar algunas funcionalidades que se necesitan con frecuencia, como obtener datos de los usuarios mediante un formulario HTML, obtener datos de una base de datos y mostrarlos paginados. También has aprendido a usar [Gii](gii.md) para generar código automáticamente. Usar Gii para generar código convierte buena parte de tu proceso de desarrollo web en una tarea tan sencilla como rellenar unos cuantos formularios." diff --git a/_translations/po/es/guide_start_prerequisites.md.po b/_translations/po/es/guide_start_prerequisites.md.po index ced8ed10..de2b3b85 100644 --- a/_translations/po/es/guide_start_prerequisites.md.po +++ b/_translations/po/es/guide_start_prerequisites.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-05-28 20:46+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,79 +20,79 @@ msgstr "" #: ../src/guide/start/prerequisites.md #, no-wrap msgid "What do you need to know?" -msgstr "" +msgstr "¿Qué necesitas saber?" #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "The Yii learning curve isn't as steep as other PHP frameworks, but still, there are some things you should learn before starting with Yii." -msgstr "" +msgstr "La curva de aprendizaje de Yii no es tan pronunciada como la de otros frameworks PHP, pero aun así hay algunas cosas que deberías aprender antes de empezar con Yii." #. type: Title ## #: ../src/guide/start/prerequisites.md #, no-wrap msgid "PHP" -msgstr "" +msgstr "PHP" #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "Yii is a PHP framework, so make sure you [read and understand language reference](https://www.php.net/manual/en/langref.php)." -msgstr "" +msgstr "Yii es un framework PHP, así que asegúrate de [leer y entender la referencia del lenguaje](https://www.php.net/manual/en/langref.php)." #. type: Title ## #: ../src/guide/start/prerequisites.md #, no-wrap msgid "Object-oriented programming" -msgstr "" +msgstr "Programación orientada a objetos" #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "You need a basic understanding of object-oriented programming. If you're not familiar with it, check one of the many tutorials available such as [the one from tuts+](https://code.tutsplus.com/tutorials/object-oriented-php-for-beginners--net-12762)." -msgstr "" +msgstr "Necesitas conocimientos básicos de programación orientada a objetos. Si no estás familiarizado con ella, consulta alguno de los muchos tutoriales disponibles, como [el de tuts+](https://code.tutsplus.com/tutorials/object-oriented-php-for-beginners--net-12762)." #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "When you develop with Yii, you write code in an object-oriented fashion, so make sure you're familiar with [PHP OOP support](https://www.php.net/manual/en/language.oop5.php)." -msgstr "" +msgstr "Cuando desarrollas con Yii, escribes código orientado a objetos, así que asegúrate de conocer bien [el soporte de PHP para la programación orientada a objetos](https://www.php.net/manual/en/language.oop5.php)." #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "Note that the more complicated your application is, the more advanced OOP concepts you should learn to successfully manage that complexity." -msgstr "" +msgstr "Ten en cuenta que, cuanto más compleja sea tu aplicación, más conceptos avanzados de programación orientada a objetos tendrás que aprender para gestionar esa complejidad con éxito." #. type: Title ## #: ../src/guide/start/prerequisites.md #, no-wrap msgid "Command line and Composer" -msgstr "" +msgstr "Línea de comandos y Composer" #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "Yii extensively uses the de-facto standard PHP package manager, [Composer](https://getcomposer.org) so make sure you read and understand its [guide](https://getcomposer.org/doc/01-basic-usage.md). If you aren't familiar with using the command line, it's time to start trying. Once you learn the basics, you'll never want to work without it." -msgstr "" +msgstr "Yii usa ampliamente el gestor de paquetes estándar de facto de PHP, [Composer](https://getcomposer.org), así que asegúrate de leer y entender su [guía](https://getcomposer.org/doc/01-basic-usage.md). Si no estás familiarizado con la línea de comandos, es hora de empezar a probarla. Una vez que aprendas lo básico, no querrás volver a trabajar sin ella." #. type: Title ## #: ../src/guide/start/prerequisites.md #, no-wrap msgid "HTTP" -msgstr "" +msgstr "HTTP" #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "Since Yii is a web framework and the web largely uses HTTP, it's a good idea to [learn more about it](https://developer.mozilla.org/en-US/docs/Web/HTTP)." -msgstr "" +msgstr "Como Yii es un framework web y la web usa HTTP en gran medida, es buena idea [aprender más sobre él](https://developer.mozilla.org/en-US/docs/Web/HTTP)." #. type: Title ## #: ../src/guide/start/prerequisites.md #, no-wrap msgid "Docker" -msgstr "" +msgstr "Docker" #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "The default application template leverages Docker, so we recommend that you [read and understand the concepts](https://docs.docker.com/get-started/)." -msgstr "" +msgstr "La plantilla de aplicación predeterminada utiliza Docker, así que te recomendamos [leer y entender sus conceptos](https://docs.docker.com/get-started/)." #. type: Plain text #: ../src/guide/start/prerequisites.md msgid "Also, you will benefit from familiarizing yourself with [twelve-factor app](https://12factor.net/) principles." -msgstr "" +msgstr "Además, te resultará útil familiarizarte con los principios de las [aplicaciones de doce factores (twelve-factor app)](https://12factor.net/)." diff --git a/_translations/po/es/guide_start_workflow.md.po b/_translations/po/es/guide_start_workflow.md.po index 5957c104..8082b8f7 100644 --- a/_translations/po/es/guide_start_workflow.md.po +++ b/_translations/po/es/guide_start_workflow.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-05 20:33+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,34 +20,34 @@ msgstr "" #: ../src/guide/index.md ../src/guide/start/workflow.md #, no-wrap msgid "Application structure" -msgstr "" +msgstr "Estructura de la aplicación" #. type: Title # #: ../src/guide/start/workflow.md #, no-wrap msgid "Application Workflow" -msgstr "" +msgstr "Flujo de trabajo de la aplicación" #. type: Plain text #: ../src/guide/start/workflow.md msgid "After installing Yii, you have a working Yii application. This section introduces the application's built-in functionality, how the code is organized, and how the application handles requests in general." -msgstr "" +msgstr "Tras instalar Yii, tienes una aplicación Yii funcionando. Esta sección presenta la funcionalidad integrada de la aplicación, cómo está organizado el código y cómo gestiona la aplicación las solicitudes en general." #. type: Plain text #: ../src/guide/start/workflow.md msgid "Note that unlike the framework itself, after you install a project template, it's all yours. You're free to add or delete code and overall change it as you need." -msgstr "" +msgstr "Ten en cuenta que, a diferencia del propio framework, una vez que instalas una plantilla de proyecto, es toda tuya. Puedes añadir o eliminar código y, en general, modificarla como necesites." #. type: Title ## #: ../src/guide/start/workflow.md #, no-wrap msgid "Functionality" -msgstr "" +msgstr "Funcionalidad" #. type: Plain text #: ../src/guide/start/workflow.md msgid "The installed application contains only one page, accessible at `http://localhost/`. It shares a common layout that you can reuse on further pages." -msgstr "" +msgstr "La aplicación instalada contiene una sola página, accesible en `http://localhost/`. Usa un layout común que puedes reutilizar en otras páginas." #. type: Plain text #: ../src/guide/start/workflow.md @@ -59,49 +59,54 @@ msgid "" "debugging information, such as log messages, response statuses, the database queries run, and so on.\n" "-->\n" msgstr "" +"\n" #. type: Plain text #: ../src/guide/start/workflow.md msgid "In addition to the web application, you can access a console script via `./yii` or, in case of Docker, `make yii`. Use this script to run background and maintenance tasks for the application, which the [Console Application Section](../tutorial/console-applications.md) describes." -msgstr "" +msgstr "Además de la aplicación web, puedes acceder a un script de consola mediante `./yii` o, si usas Docker, `make yii`. Usa este script para ejecutar tareas en segundo plano y de mantenimiento de la aplicación, que se describen en la sección [Aplicaciones de consola](../tutorial/console-applications.md)." #. type: Title ## #: ../src/guide/start/workflow.md #, no-wrap msgid "Experimental debugger" -msgstr "" +msgstr "Depurador experimental" #. type: Plain text #: ../src/guide/start/workflow.md msgid "Yii has a debugger that can collect debug data for web requests and expose it through the [Yii Dev Panel](https://yiisoft.github.io/yii-dev-panel/). The debugger is a work in progress. It isn't released as a stable package, and its API, routes, and setup may change or be deprecated." -msgstr "" +msgstr "Yii tiene un depurador que puede recopilar datos de depuración de las solicitudes web y exponerlos a través de [Yii Dev Panel](https://yiisoft.github.io/yii-dev-panel/). El depurador está en desarrollo: no se publica como paquete estable, y su API, sus rutas y su configuración pueden cambiar o quedar obsoletas." #. type: Plain text #: ../src/guide/start/workflow.md msgid "To try the current development version, install the debug API package:" -msgstr "" +msgstr "Para probar la versión de desarrollo actual, instala el paquete de la API de depuración:" #. type: Fenced code block (shell) #: ../src/guide/start/workflow.md #, no-wrap msgid "composer require yiisoft/yii-debug-api:^3.0@dev\n" -msgstr "" +msgstr "composer require yiisoft/yii-debug-api:^3.0@dev\n" #. type: Plain text #: ../src/guide/start/workflow.md msgid "Enable debug mode in `.env`:" -msgstr "" +msgstr "Activa el modo de depuración en `.env`:" #. type: Fenced code block (dotenv) #: ../src/guide/start/workflow.md #, no-wrap msgid "APP_DEBUG=true\n" -msgstr "" +msgstr "APP_DEBUG=true\n" #. type: Plain text #: ../src/guide/start/workflow.md msgid "The package registers its routes automatically. Start the application and open `/debug` to check that the debug API is available. Then open [Yii Dev Panel](https://yiisoft.github.io/yii-dev-panel/) and set your application URL there." -msgstr "" +msgstr "El paquete registra sus rutas automáticamente. Inicia la aplicación y abre `/debug` para comprobar que la API de depuración está disponible. Después, abre [Yii Dev Panel](https://yiisoft.github.io/yii-dev-panel/) y configura allí la URL de tu aplicación." #. type: Plain text #: ../src/guide/start/workflow.md @@ -110,11 +115,13 @@ msgid "" "> [!CAUTION]\n" "> Use debug mode for local development. In production, keep `APP_DEBUG=false` and don't expose debug routes publicly.\n" msgstr "" +"> [!CAUTION]\n" +"> Usa el modo de depuración solo para el desarrollo local. En producción, mantén `APP_DEBUG=false` y no expongas públicamente las rutas de depuración.\n" #. type: Plain text #: ../src/guide/start/workflow.md msgid "The most important directories and files in your application are (assuming the application's root directory is `app`):" -msgstr "" +msgstr "Los directorios y archivos más importantes de tu aplicación son estos (suponiendo que el directorio raíz de la aplicación es `app`):" #. type: Fenced code block #: ../src/guide/start/workflow.md @@ -147,37 +154,63 @@ msgid "" "Makefile Config for make command.\n" "yii Console application entry point.\n" msgstr "" +"assets/ Asset bundle source files.\n" +"config/ Configuration files.\n" +" common/ Common configuration and DI definitions.\n" +" console/ Console-specific configuration.\n" +" environments/ Environment-specific configuration (dev/test/prod).\n" +" web/ Web-specific configuration.\n" +"docker/ Docker-specific files.\n" +"public/ Files publically accessible from the Internet.\n" +" assets/ Published/compiled assets.\n" +" index.php Entry script.\n" +"runtime/ Files generated during runtime.\n" +"src/ Application source code.\n" +" Console/ Console commands.\n" +" Shared/ Code shared between web and console applications.\n" +" Web/ Web-specific code (actions, handlers, layout).\n" +" Shared/ Shared web components.\n" +" Layout/ Layout components and templates.\n" +" Environment.php Environment configuration class.\n" +"tests/ A set of Codeception tests for the application.\n" +" Console/ Console command tests.\n" +" Functional/ Functional tests.\n" +" Unit/ Unit tests.\n" +" Web/ Web actions tests.\n" +"vendor/ Installed Composer packages.\n" +"Makefile Config for make command.\n" +"yii Console application entry point.\n" #. type: Plain text #: ../src/guide/start/workflow.md msgid "In general, the files in the application fall into two groups: those under `app/public` and those under other directories. You can access the former directly via HTTP (i.e., in a browser), while you shouldn't expose the latter." -msgstr "" +msgstr "En general, los archivos de la aplicación se dividen en dos grupos: los que están en `app/public` y los que están en otros directorios. A los primeros puedes acceder directamente por HTTP (es decir, desde un navegador), mientras que los segundos no deberías exponerlos." #. type: Plain text #: ../src/guide/start/workflow.md msgid "Each application has an entry script `public/index.php`, the only web-accessible PHP script in the application. The entry script uses an [application runner](https://github.com/yiisoft/yii-runner) to create an instance of an incoming request with the help of one of PSR-7 packages and passes it to an [application](../structure/application.md) instance. The application executes a set of middleware sequentially to process the request. It then passes the result to the emitter, which sends the response to the browser." -msgstr "" +msgstr "Cada aplicación tiene un script de entrada, `public/index.php`, que es el único script PHP de la aplicación accesible desde la web. El script de entrada usa un [ejecutor (runner) de la aplicación](https://github.com/yiisoft/yii-runner) para crear una instancia de la solicitud entrante con la ayuda de uno de los paquetes PSR-7 y la pasa a una instancia de la [aplicación](../structure/application.md). La aplicación ejecuta secuencialmente un conjunto de middlewares para procesar la solicitud. Después pasa el resultado al emisor, que envía la respuesta al navegador." #. type: Plain text #: ../src/guide/start/workflow.md msgid "Depending on the middleware you use, the application may behave differently. By default, a router uses the requested URL and configuration to choose a handler and execute it to produce a response." -msgstr "" +msgstr "Según los middlewares que uses, la aplicación puede comportarse de forma diferente. Por defecto, un router usa la URL solicitada y la configuración para elegir un manejador y ejecutarlo para producir una respuesta." #. type: Plain text #: ../src/guide/start/workflow.md msgid "You can learn more about the application template from the [yiisoft/app package documentation](https://github.com/yiisoft/app/blob/master/README.md)." -msgstr "" +msgstr "Puedes obtener más información sobre la plantilla de aplicación en la [documentación del paquete yiisoft/app](https://github.com/yiisoft/app/blob/master/README.md)." #. type: Title ## #: ../src/guide/start/workflow.md #, no-wrap msgid "Request Lifecycle" -msgstr "" +msgstr "Ciclo de vida de la solicitud" #. type: Plain text #: ../src/guide/start/workflow.md msgid "The following diagram shows how an application handles a request." -msgstr "" +msgstr "El siguiente diagrama muestra cómo gestiona una aplicación una solicitud." #. type: Fenced code block (mermaid) #: ../src/guide/start/workflow.md @@ -198,43 +231,57 @@ msgid "" " app -->|Response| emitter\n" " emitter --> user\n" msgstr "" +"flowchart LR\n" +" user[User's client] --> index\n" +" index[index.php] --> DI[Initialize Dependency Container]\n" +" config[configs] -.-> DI\n" +" DI --> RequestFactory[RequestFactory]\n" +" RequestFactory -->|Request| app[Application]\n" +" app -->|Request| middleware[Middleware]\n" +" middleware -->|Request| router[Router]\n" +" router -->|Request| action[Action Handler]\n" +" action -->|Response| emitter[SapiEmitter]\n" +" router -->|Response| emitter\n" +" middleware -->|Response| emitter\n" +" app -->|Response| emitter\n" +" emitter --> user\n" #. type: Bullet: '1. ' #: ../src/guide/start/workflow.md msgid "A user makes a request to the [entry script](../structure/entry-script.md) `public/index.php`." -msgstr "" +msgstr "Un usuario hace una solicitud al [script de entrada](../structure/entry-script.md) `public/index.php`." #. type: Bullet: '2. ' #: ../src/guide/start/workflow.md msgid "The entry script with the help of the application runner loads the container [configuration](../concept/configuration.md) and creates an [application](../structure/application.md) instance and services necessary to handle the request." -msgstr "" +msgstr "El script de entrada, con la ayuda del ejecutor de la aplicación, carga la [configuración](../concept/configuration.md) del contenedor y crea una instancia de la [aplicación](../structure/application.md) y los servicios necesarios para gestionar la solicitud." #. type: Bullet: '3. ' #: ../src/guide/start/workflow.md msgid "Request factory creates a request object based on a raw request that came from a user." -msgstr "" +msgstr "La factoría de solicitudes crea un objeto de solicitud a partir de la solicitud en bruto que ha llegado del usuario." #. type: Bullet: '4. ' #: ../src/guide/start/workflow.md msgid "Application passes a request object through a middleware array configured. One of these is typically a router." -msgstr "" +msgstr "La aplicación pasa el objeto de solicitud por el array de middlewares configurado. Uno de ellos suele ser un router." #. type: Bullet: '5. ' #: ../src/guide/start/workflow.md msgid "The Router finds out what handler to execute based on request and configuration." -msgstr "" +msgstr "El router determina qué manejador ejecutar en función de la solicitud y la configuración." #. type: Bullet: '6. ' #: ../src/guide/start/workflow.md msgid "The handler may load some data, possibly from a database." -msgstr "" +msgstr "El manejador puede cargar algunos datos, posiblemente de una base de datos." #. type: Bullet: '7. ' #: ../src/guide/start/workflow.md msgid "The handler forms a response by using data. Either directly or with the help of the view package." -msgstr "" +msgstr "El manejador construye una respuesta con esos datos, ya sea directamente o con la ayuda del paquete de vistas." #. type: Bullet: '8. ' #: ../src/guide/start/workflow.md msgid "Emitter receives the response and takes care of sending the response to the user's browser." -msgstr "" +msgstr "El emisor recibe la respuesta y se encarga de enviarla al navegador del usuario." diff --git a/_translations/po/es/guide_structure_action.md.po b/_translations/po/es/guide_structure_action.md.po index 155d3e0d..552a3c9a 100644 --- a/_translations/po/es/guide_structure_action.md.po +++ b/_translations/po/es/guide_structure_action.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-05-05 21:53+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,17 +20,17 @@ msgstr "" #: ../src/guide/intro/upgrade-from-v2.md ../src/guide/structure/action.md #, no-wrap msgid "Actions" -msgstr "" +msgstr "Acciones" #. type: Plain text #: ../src/guide/structure/action.md msgid "In a web application, the request URL determines what's executed. Matching is made by a router configured with multiple routes. Each route can be attached to a middleware that, given request, produces a response. Since middleware overall could be chained and can pass actual handling to the next middleware, we call the middleware actually doing the job an action." -msgstr "" +msgstr "En una aplicación web, la URL de la solicitud determina qué se ejecuta. La coincidencia la realiza un router configurado con varias rutas. Cada ruta puede asociarse a un middleware que, dada una solicitud, produce una respuesta. Como los middlewares pueden encadenarse y pasar la gestión real al siguiente middleware, llamamos acción al middleware que realmente hace el trabajo." #. type: Plain text #: ../src/guide/structure/action.md msgid "There are multiple ways to describe an action. The simplest one is using a closure:" -msgstr "" +msgstr "Hay varias formas de describir una acción. La más sencilla es usar una closure:" #. type: Fenced code block (php) #: ../src/guide/structure/action.md @@ -46,11 +46,20 @@ msgid "" " return $response;\n" "});\n" msgstr "" +"use \\Psr\\Http\\Message\\ServerRequestInterface;\n" +"use \\Psr\\Http\\Message\\ResponseInterface;\n" +"use Yiisoft\\Router\\Route;\n" +"\n" +"Route::get('/')->action(function (ServerRequestInterface $request) use ($responseFactory): ResponseInterface {\n" +" $response = $responseFactory->createResponse();\n" +" $response->getBody()->write('You are at homepage.');\n" +" return $response;\n" +"});\n" #. type: Plain text #: ../src/guide/structure/action.md msgid "It's fine for simple handling since any more complicated one would require getting dependencies, so a good idea would be moving the handling to a class method. Callback middleware could be used for the purpose:" -msgstr "" +msgstr "Esto sirve para una gestión sencilla, ya que cualquier otra más complicada requeriría obtener dependencias, así que es buena idea trasladar la gestión a un método de clase. Para ello se puede usar un middleware de callback:" #. type: Fenced code block (php) #: ../src/guide/structure/action.md @@ -60,11 +69,14 @@ msgid "" "\n" "Route::get('/')->action(FrontPageAction::class),\n" msgstr "" +"use Yiisoft\\Router\\Route;\n" +"\n" +"Route::get('/')->action(FrontPageAction::class),\n" #. type: Plain text #: ../src/guide/structure/action.md msgid "The class itself would be like:" -msgstr "" +msgstr "La clase en sí sería así:" #. type: Fenced code block (php) #: ../src/guide/structure/action.md @@ -81,11 +93,21 @@ msgid "" " }\n" "}\n" msgstr "" +"use \\Psr\\Http\\Message\\ServerRequestInterface;\n" +"use \\Psr\\Http\\Message\\ResponseInterface;\n" +"\n" +"final readonly class FrontPageAction\n" +"{\n" +" public function __invoke(ServerRequestInterface $request): ResponseInterface\n" +" {\n" +" // construir la respuesta para la portada \n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/structure/action.md msgid "For many cases, it makes sense to group handling for many routes into a single class:" -msgstr "" +msgstr "En muchos casos tiene sentido agrupar en una sola clase la gestión de muchas rutas:" #. type: Fenced code block (php) #: ../src/guide/structure/action.md @@ -96,11 +118,15 @@ msgid "" "Route::get('/post/index')->action([PostController::class, 'actionIndex']),\n" "Route::get('/post/view/{id:\\d+}')->action([PostController::class, 'actionView']),\n" msgstr "" +"use Yiisoft\\Router\\Route;\n" +"\n" +"Route::get('/post/index')->action([PostController::class, 'actionIndex']),\n" +"Route::get('/post/view/{id:\\d+}')->action([PostController::class, 'actionView']),\n" #. type: Plain text #: ../src/guide/structure/action.md msgid "The class itself would look like the following:" -msgstr "" +msgstr "La clase en sí tendría este aspecto:" #. type: Fenced code block (php) #: ../src/guide/structure/action.md @@ -128,22 +154,43 @@ msgid "" " }\n" "}\n" msgstr "" +"use \\Psr\\Http\\Message\\ServerRequestInterface;\n" +"use \\Psr\\Http\\Message\\ResponseInterface;\n" +"use Yiisoft\\Router\\HydratorAttribute\\RouteArgument;\n" +"\n" +"final readonly class PostController\n" +"{\n" +" public function actionIndex(ServerRequestInterface $request): ResponseInterface\n" +" {\n" +" // renderizar la lista de posts\n" +" }\n" +" \n" +" \n" +" public function actionView(\n" +" ServerRequestInterface $request,\n" +" #[RouteArgument('id')]\n" +" int $id,\n" +" ): ResponseInterface\n" +" {\n" +" // renderizar un único post por su $id\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/structure/action.md msgid "We usually call such a class \"controller.\"" -msgstr "" +msgstr "Normalmente llamamos a este tipo de clase \"controlador\"." #. type: Plain text #: ../src/guide/structure/action.md msgid "The `{id}` part of the `/post/view/{id:\\d+}` route is a named route parameter. Route parameters are available from `Yiisoft\\Router\\CurrentRoute`. To receive one as an action argument, add the `RouteArgument` attribute to the corresponding parameter. The attribute name should match the route parameter name." -msgstr "" +msgstr "La parte `{id}` de la ruta `/post/view/{id:\\d+}` es un parámetro de ruta con nombre. Los parámetros de ruta están disponibles en `Yiisoft\\Router\\CurrentRoute`. Para recibir uno como argumento de la acción, añade el atributo `RouteArgument` al parámetro correspondiente. El nombre del atributo debe coincidir con el nombre del parámetro de ruta." #. type: Title ## #: ../src/guide/structure/action.md #, no-wrap msgid "Autowiring" -msgstr "" +msgstr "Autowiring" #. type: Plain text #: ../src/guide/structure/action.md @@ -152,6 +199,8 @@ msgid "" "Both constructors of action-classes and action-methods are automatically getting services from\n" " the dependency injection container:\n" msgstr "" +"Tanto los constructores de las clases de acción como los métodos de acción obtienen automáticamente los servicios\n" +" del contenedor de inyección de dependencias:\n" #. type: Fenced code block (php) #: ../src/guide/structure/action.md @@ -182,8 +231,32 @@ msgid "" " }\n" "}\n" msgstr "" +"use \\Psr\\Http\\Message\\ServerRequestInterface;\n" +"use \\Psr\\Http\\Message\\ResponseInterface;\n" +"use Psr\\Log\\LoggerInterface;\n" +"\n" +"final readonly class PostController\n" +"{\n" +" public function __construct(\n" +" private PostRepository $postRepository\n" +" )\n" +" {\n" +" }\n" +"\n" +" public function actionIndex(ServerRequestInterface $request, LoggerInterface $logger): ResponseInterface\n" +" {\n" +" $logger->debug('Rendering posts list');\n" +" // renderizar la lista de posts\n" +" }\n" +" \n" +" \n" +" public function actionView(ServerRequestInterface $request): ResponseInterface\n" +" {\n" +" // renderizar un único post \n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/structure/action.md msgid "In the above example `PostRepository` is injected automatically via constructor. That means it is available in every action. Logger is injected into `index` action only." -msgstr "" +msgstr "En el ejemplo anterior, `PostRepository` se inyecta automáticamente mediante el constructor. Eso significa que está disponible en todas las acciones. El logger solo se inyecta en la acción `index`." diff --git a/_translations/po/es/guide_structure_application.md.po b/_translations/po/es/guide_structure_application.md.po index 45793161..099b6a29 100644 --- a/_translations/po/es/guide_structure_application.md.po +++ b/_translations/po/es/guide_structure_application.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2025-12-27 03:24+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,29 +20,29 @@ msgstr "" #: ../src/guide/structure/application.md #, no-wrap msgid "Application" -msgstr "" +msgstr "Aplicación" #. type: Plain text #: ../src/guide/structure/application.md msgid "The primary purpose of the web application and its runner in Yii3 is to process requests to get responses." -msgstr "" +msgstr "El propósito principal de la aplicación web y de su runner en Yii3 es procesar solicitudes para obtener respuestas." #. type: Plain text #: ../src/guide/structure/application.md msgid "Typically, the runtime consists of:" -msgstr "" +msgstr "Normalmente, la ejecución consta de:" #. type: Bullet: '1. ' #: ../src/guide/structure/application.md msgid "Startup. Get config, create an instance of container and do additional environment initialization such as registering error handler, so it can handle errors occurring. Fire `ApplicationStartup` event." -msgstr "" +msgstr "Arranque. Obtener la configuración, crear una instancia del contenedor y realizar inicializaciones adicionales del entorno, como registrar el manejador de errores para que pueda gestionar los errores que se produzcan. Lanzar el evento `ApplicationStartup`." #. type: Bullet: '2. ' #: ../src/guide/structure/application.md msgid "Handle requests via passing request objects to middleware dispatcher to execute [middleware stack](middleware.md) and get a response object. In usual PHP applications, it's done once. In [environments such as RoadRunner](../tutorial/using-with-event-loop.md), it could be done multiple times with the same application instance. Response object is converted into an actual HTTP response by using emitter. Fire `AfterEmit` event." -msgstr "" +msgstr "Gestionar las solicitudes pasando los objetos de solicitud al despachador de middlewares para que ejecute la [pila de middlewares](middleware.md) y obtener un objeto de respuesta. En las aplicaciones PHP habituales, esto se hace una sola vez. En [entornos como RoadRunner](../tutorial/using-with-event-loop.md), puede hacerse varias veces con la misma instancia de la aplicación. El objeto de respuesta se convierte en una respuesta HTTP real mediante un emisor. Lanzar el evento `AfterEmit`." #. type: Bullet: '3. ' #: ../src/guide/structure/application.md msgid "Shutdown. Fire `ApplicationShutdown` event." -msgstr "" +msgstr "Cierre. Lanzar el evento `ApplicationShutdown`." diff --git a/_translations/po/es/guide_structure_designing-packages.md.po b/_translations/po/es/guide_structure_designing-packages.md.po index dcc1f8fb..c3eee587 100644 --- a/_translations/po/es/guide_structure_designing-packages.md.po +++ b/_translations/po/es/guide_structure_designing-packages.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-02 22:29+0000\n" -"PO-Revision-Date: 2026-05-29 19:04+0000\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -21,9 +21,9 @@ msgstr "" #: ../src/guide/structure/designing-packages.md #: ../src/guide/structure/module.md ../src/guide/structure/package.md #: ../src/guide/tutorial/i18n.md -#, fuzzy, no-wrap +#, no-wrap msgid "composer yii-config-rebuild\n" -msgstr "Introducción" +msgstr "composer yii-config-rebuild\n" #. type: Title ## #: ../src/guide/concept/configuration.md @@ -31,7 +31,7 @@ msgstr "Introducción" #: ../src/guide/structure/module.md #, no-wrap msgid "Routes" -msgstr "" +msgstr "Rutas" #. type: Title ## #: ../src/guide/concept/configuration.md ../src/guide/concept/events.md @@ -47,54 +47,53 @@ msgstr "Eventos" #: ../src/internals/022-config-groups.md #, no-wrap msgid "Parameters" -msgstr "" +msgstr "Parámetros" #. type: Title ## #: ../src/guide/databases/db-migrations.md #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Migrations" -msgstr "" +msgstr "Migraciones" #. type: Title ## #: ../src/guide/intro/upgrade-from-v2.md #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Console commands" -msgstr "" +msgstr "Comandos de consola" #. type: Title # #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Designing packages for Yii applications" -msgstr "" +msgstr "Diseñar paquetes para aplicaciones Yii" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "This page describes how to design a Composer package that adds behavior to a Yii application through configuration. Use it when your package needs to register services, routes, events, commands, assets, migrations, translations, or a theme." -msgstr "" +msgstr "Esta página describe cómo diseñar un paquete de Composer que añade comportamiento a una aplicación Yii mediante configuración. Úsala cuando tu paquete necesite registrar servicios, rutas, eventos, comandos, assets, migraciones, traducciones o un tema." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "For installing and updating packages in an application, see [Using packages](package.md)." -msgstr "" +msgstr "Para instalar y actualizar paquetes en una aplicación, consulta [Usar paquetes](package.md)." #. type: Title ## #: ../src/guide/structure/designing-packages.md -#, fuzzy, no-wrap -#| msgid "Class autoloading" +#, no-wrap msgid "Composer metadata" -msgstr "Autocarga de Clases (Autoloading)" +msgstr "Metadatos de Composer" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Each package must have a `composer.json` file in its root directory. At minimum, define a package name, dependencies, autoloading, and Yii config metadata when the package integrates with a Yii application." -msgstr "" +msgstr "Cada paquete debe tener un archivo `composer.json` en su directorio raíz. Como mínimo, define un nombre de paquete, las dependencias, la autocarga y, si el paquete se integra con una aplicación Yii, los metadatos de configuración de Yii." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use a package name in the `vendor-name/project-name` format:" -msgstr "" +msgstr "Usa un nombre de paquete con el formato `vendor-name/project-name`:" #. type: Fenced code block (json) #: ../src/guide/structure/designing-packages.md @@ -115,28 +114,41 @@ msgid "" " }\n" "}\n" msgstr "" +"{\n" +" \"name\": \"vendor/blog\",\n" +" \"type\": \"library\",\n" +" \"description\": \"Blog integration for Yii applications\",\n" +" \"require\": {\n" +" \"php\": \">=8.2\",\n" +" \"yiisoft/router\": \"^4.0\"\n" +" },\n" +" \"autoload\": {\n" +" \"psr-4\": {\n" +" \"Vendor\\\\Blog\\\\\": \"src/\"\n" +" }\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use stable dependency constraints for stable releases. Avoid using `yiisoft` as your vendor name because it is reserved for Yii packages." -msgstr "" +msgstr "Usa restricciones de dependencias estables para las versiones estables. Evita usar `yiisoft` como nombre de vendor, porque está reservado para los paquetes de Yii." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "If your package requires a Yii application, prefixing the project name with `yii-` can make that clear on Packagist." -msgstr "" +msgstr "Si tu paquete requiere una aplicación Yii, añadir el prefijo `yii-` al nombre del proyecto puede dejarlo claro en Packagist." #. type: Title ## #: ../src/guide/structure/designing-packages.md -#, fuzzy, no-wrap -#| msgid "Generating API documentation" +#, no-wrap msgid "Package layout" -msgstr "Generación de Documentación de API" +msgstr "Estructura del paquete" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "A Yii-aware package is a regular Composer package with PHP classes, optional resource files, and optional config files. Keep the configuration in a predictable directory and make the public API explicit:" -msgstr "" +msgstr "Un paquete preparado para Yii es un paquete de Composer normal con clases PHP, archivos de recursos opcionales y archivos de configuración opcionales. Mantén la configuración en un directorio predecible y haz explícita la API pública:" #. type: Fenced code block #: ../src/guide/structure/designing-packages.md @@ -163,22 +175,42 @@ msgid "" "views/\n" " ...\n" msgstr "" +"composer.json\n" +"config/\n" +" params.php\n" +" di.php\n" +" di-providers.php\n" +" routes.php\n" +" events.php\n" +" params-web.php\n" +" params-console.php\n" +" di-console.php\n" +"src/\n" +" ...\n" +"assets/\n" +" ...\n" +"migrations/\n" +" ...\n" +"messages/\n" +" ...\n" +"views/\n" +" ...\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use only the files your package needs. For example, a package with console commands but no web routes does not need `routes.php`." -msgstr "" +msgstr "Usa solo los archivos que necesite tu paquete. Por ejemplo, un paquete con comandos de consola pero sin rutas web no necesita `routes.php`." #. type: Title ## #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Config plugin metadata" -msgstr "" +msgstr "Metadatos del plugin de configuración" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Yii applications use [yiisoft/config](https://github.com/yiisoft/config) to discover package configuration. Declare package config files in the `extra.config-plugin` section of `composer.json`:" -msgstr "" +msgstr "Las aplicaciones Yii usan [yiisoft/config](https://github.com/yiisoft/config) para descubrir la configuración de los paquetes. Declara los archivos de configuración del paquete en la sección `extra.config-plugin` de `composer.json`:" #. type: Fenced code block (json) #: ../src/guide/structure/designing-packages.md @@ -206,46 +238,67 @@ msgid "" " }\n" "}\n" msgstr "" +"{\n" +" \"name\": \"vendor/blog\",\n" +" \"type\": \"library\",\n" +" \"autoload\": {\n" +" \"psr-4\": {\n" +" \"Vendor\\\\Blog\\\\\": \"src/\"\n" +" }\n" +" },\n" +" \"extra\": {\n" +" \"config-plugin\": {\n" +" \"params\": \"config/params.php\",\n" +" \"di\": \"config/di.php\",\n" +" \"di-providers\": \"config/di-providers.php\",\n" +" \"routes\": \"config/routes.php\",\n" +" \"events\": \"config/events.php\",\n" +" \"params-web\": \"config/params-web.php\",\n" +" \"params-console\": \"config/params-console.php\",\n" +" \"di-console\": \"config/di-console.php\"\n" +" }\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Each `config-plugin` key is a config group name and each value is a path relative to the package root." -msgstr "" +msgstr "Cada clave de `config-plugin` es un nombre de grupo de configuración y cada valor es una ruta relativa a la raíz del paquete." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use the common, web, and console groups consistently:" -msgstr "" +msgstr "Usa los grupos comunes, web y de consola de forma coherente:" #. type: Bullet: '- ' #: ../src/guide/structure/designing-packages.md msgid "`params`, `di`, `di-providers`, `di-delegates`, `events`, and `bootstrap` apply to both web and console entry points." -msgstr "" +msgstr "`params`, `di`, `di-providers`, `di-delegates`, `events` y `bootstrap` se aplican tanto a los puntos de entrada web como a los de consola." #. type: Bullet: '- ' #: ../src/guide/structure/designing-packages.md msgid "`params-web`, `di-web`, `di-providers-web`, `events-web`, `bootstrap-web`, and `routes` apply to web entry points." -msgstr "" +msgstr "`params-web`, `di-web`, `di-providers-web`, `events-web`, `bootstrap-web` y `routes` se aplican a los puntos de entrada web." #. type: Bullet: '- ' #: ../src/guide/structure/designing-packages.md msgid "`params-console`, `di-console`, `di-providers-console`, `events-console`, and `bootstrap-console` apply to console entry points." -msgstr "" +msgstr "`params-console`, `di-console`, `di-providers-console`, `events-console` y `bootstrap-console` se aplican a los puntos de entrada de consola." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "If your package defines a new config group, document how an application should load that group. Prefer the standard groups when you integrate with Yii services because application templates and Yii packages already use these names." -msgstr "" +msgstr "Si tu paquete define un nuevo grupo de configuración, documenta cómo debe cargarlo una aplicación. Cuando te integres con servicios de Yii, es preferible usar los grupos estándar, porque las plantillas de aplicación y los paquetes de Yii ya usan esos nombres." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "After users install, update, remove, or dump Composer autoload files, the config plugin rebuilds the merge plan that Yii reads at runtime. If users edit their root package configuration manually, ask them to run:" -msgstr "" +msgstr "Cuando los usuarios instalan, actualizan o eliminan paquetes, o regeneran los archivos de autocarga de Composer, el plugin de configuración vuelve a generar el plan de fusión que Yii lee en tiempo de ejecución. Si los usuarios editan manualmente la configuración de su paquete raíz, pídeles que ejecuten:" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Put default options in `config/params.php`. Group package parameters under the Composer package name to avoid collisions:" -msgstr "" +msgstr "Pon las opciones predeterminadas en `config/params.php`. Agrupa los parámetros del paquete bajo el nombre del paquete de Composer para evitar colisiones:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -262,27 +315,37 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" 'postsPerPage' => 20,\n" +" 'cacheTtl' => 3600,\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Application developers can override these values in their own `config/common/params.php`, `config/web/params.php`, `config/console/params.php`, or environment-specific parameter files." -msgstr "" +msgstr "Los desarrolladores de aplicaciones pueden sobrescribir estos valores en sus propios `config/common/params.php`, `config/web/params.php`, `config/console/params.php` o en los archivos de parámetros específicos de cada entorno." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Do not read environment variables or global state from package code when a parameter can express the choice. Use parameters to configure services through DI definitions or service providers." -msgstr "" +msgstr "No leas variables de entorno ni estado global desde el código del paquete cuando un parámetro pueda expresar esa elección. Usa parámetros para configurar servicios mediante definiciones DI o proveedores de servicios." #. type: Title ## #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "DI definitions" -msgstr "" +msgstr "Definiciones DI" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use `config/di.php`, `config/di-web.php`, or `config/di-console.php` for direct container definitions:" -msgstr "" +msgstr "Usa `config/di.php`, `config/di-web.php` o `config/di-console.php` para las definiciones directas del contenedor:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -306,29 +369,44 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" 'class' => PostRepository::class,\n" +" '__construct()' => [\n" +" 'cacheTtl' => $params['vendor/blog']['cacheTtl'],\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Prefer direct DI definitions when the configuration describes one service clearly." -msgstr "" +msgstr "Es preferible usar definiciones DI directas cuando la configuración describe claramente un único servicio." #. type: Title ## #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "DI service providers" -msgstr "" +msgstr "Proveedores de servicios DI" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use a DI provider when registration belongs together as a reusable unit: several related services, aliases, factory definitions, or extensions." -msgstr "" +msgstr "Usa un proveedor DI cuando el registro forme una unidad reutilizable: varios servicios relacionados, alias, definiciones de factorías o extensiones." #. type: Plain text #: ../src/guide/structure/designing-packages.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "Register providers in `config/di-providers.php`:" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "Registra los proveedores en `config/di-providers.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -344,11 +422,20 @@ msgid "" " 'vendor/blog/post-repository' => BlogProvider::class,\n" "];\n" msgstr "" +" BlogProvider::class,\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Declare the group in `composer.json`:" -msgstr "" +msgstr "Declara el grupo en `composer.json`:" #. type: Fenced code block (json) #: ../src/guide/structure/designing-packages.md @@ -360,11 +447,16 @@ msgid "" " }\n" "}\n" msgstr "" +"\"extra\": {\n" +" \"config-plugin\": {\n" +" \"di-providers\": \"config/di-providers.php\"\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "A provider can return several service definitions and extensions. Place the provider class in `src/Provider/BlogProvider.php`:" -msgstr "" +msgstr "Un proveedor puede devolver varias definiciones de servicios y extensiones. Coloca la clase del proveedor en `src/Provider/BlogProvider.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -404,11 +496,44 @@ msgid "" " }\n" "}\n" msgstr "" +" PostRepository::class,\n" +" PostRepositoryInterface::class => static fn (\n" +" ContainerInterface $container\n" +" ): CachedPostRepository => new CachedPostRepository(\n" +" $container->get(PostRepository::class),\n" +" $container->get(LoggerInterface::class),\n" +" ),\n" +" ];\n" +" }\n" +"\n" +" public function getExtensions(): array\n" +" {\n" +" return [];\n" +" }\n" +"}\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Web packages can add routes through `config/routes.php`, declared as the `routes` group:" -msgstr "" +msgstr "Los paquetes web pueden añadir rutas mediante `config/routes.php`, declarado como el grupo `routes`:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -430,21 +555,36 @@ msgid "" " ),\n" "];\n" msgstr "" +"routes(\n" +" Route::get('')\n" +" ->action(IndexAction::class)\n" +" ->name('vendor/blog/index'),\n" +" ),\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Route names should be package-prefixed. This avoids collisions with application routes and with routes from other packages." -msgstr "" +msgstr "Los nombres de las rutas deben llevar como prefijo el del paquete. Así se evitan colisiones con las rutas de la aplicación y con las de otros paquetes." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Keep package routes small and overridable. If an application needs full control over URLs, document the actions and let the application define its own routes." -msgstr "" +msgstr "Mantén las rutas del paquete pequeñas y fáciles de sobrescribir. Si una aplicación necesita control total sobre las URL, documenta las acciones y deja que la aplicación defina sus propias rutas." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use `config/events.php`, `config/events-web.php`, or `config/events-console.php` to attach package handlers to events:" -msgstr "" +msgstr "Usa `config/events.php`, `config/events-web.php` o `config/events-console.php` para asociar los manejadores del paquete a eventos:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -463,22 +603,34 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" ClearPostListCache::class,\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Handlers can be closures, callables, invokable objects, invokable class names, or DI aliases supported by the event dispatcher configuration. Prefer class names for package handlers because applications can override their dependencies through the container." -msgstr "" +msgstr "Los manejadores pueden ser closures, callables, objetos invocables, nombres de clases invocables o alias DI admitidos por la configuración del despachador de eventos. Para los manejadores de paquetes, es preferible usar nombres de clase, porque las aplicaciones pueden sobrescribir sus dependencias a través del contenedor." #. type: Title # #: ../src/guide/structure/designing-packages.md ../src/guide/views/asset.md #, no-wrap msgid "Assets" -msgstr "" +msgstr "Assets" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "If your package ships CSS, JavaScript, images, or fonts, define asset bundles as PHP classes. For example, place this class in `src/Asset/BlogAsset.php`:" -msgstr "" +msgstr "Si tu paquete incluye CSS, JavaScript, imágenes o fuentes, define paquetes de assets como clases PHP. Por ejemplo, coloca esta clase en `src/Asset/BlogAsset.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -507,34 +659,54 @@ msgid "" " ];\n" "}\n" msgstr "" +"register(BlogAsset::class);\n" -msgstr "" +msgstr "$assetManager->register(BlogAsset::class);\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use `$sourcePath` for files shipped inside the package. Use `$basePath` and `$baseUrl` as the public target where the asset manager publishes them." -msgstr "" +msgstr "Usa `$sourcePath` para los archivos incluidos en el paquete. Usa `$basePath` y `$baseUrl` como el destino público en el que el gestor de assets los publica." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Packages that need database schema changes should ship migrations and add their namespace or path to `yiisoft/db-migration` parameters." -msgstr "" +msgstr "Los paquetes que necesiten cambios en el esquema de la base de datos deben incluir migraciones y añadir su espacio de nombres o su ruta a los parámetros de `yiisoft/db-migration`." #. type: Plain text #: ../src/guide/structure/designing-packages.md -#, fuzzy -#| msgid "Introduction +" msgid "For namespaced migrations:" -msgstr "Introducción" +msgstr "Para migraciones con espacio de nombres:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -552,13 +724,22 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" 'sourceNamespaces' => [\n" +" 'Vendor\\\\Blog\\\\Migration',\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md -#, fuzzy -#| msgid "Generating API documentation" msgid "For path-based migrations:" -msgstr "Generación de Documentación de API" +msgstr "Para migraciones basadas en rutas:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -576,33 +757,43 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" 'sourcePaths' => [\n" +" __DIR__ . '/../migrations',\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Put this in `config/params-console.php` and declare it as `params-console` in `composer.json`." -msgstr "" +msgstr "Pon esto en `config/params-console.php` y decláralo como `params-console` en `composer.json`." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "This only contributes package migration locations. The application still needs `yiisoft/db-migration` installed and a database connection configured before migration commands can run." -msgstr "" +msgstr "Esto solo aporta las ubicaciones de las migraciones del paquete. Para poder ejecutar los comandos de migración, la aplicación sigue necesitando tener instalado `yiisoft/db-migration` y una conexión a la base de datos configurada." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Package migrations must be stable after release. Do not edit a migration that users may already have applied. Add a new migration instead." -msgstr "" +msgstr "Las migraciones de un paquete deben permanecer estables una vez publicado. No edites una migración que los usuarios ya puedan haber aplicado. En su lugar, añade una migración nueva." #. type: Title ## #: ../src/guide/structure/designing-packages.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Translations" -msgstr "Introducción" +msgstr "Traducciones" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "If the package has user-facing messages, give it a dedicated translation category and register a category source in `config/di.php`:" -msgstr "" +msgstr "Si el paquete tiene mensajes dirigidos al usuario, asígnale una categoría de traducción propia y registra una fuente de categoría en `config/di.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -632,11 +823,34 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" 'definition' => static function (): CategorySource {\n" +" $messageSource = new MessageSource(__DIR__ . '/../messages');\n" +"\n" +" return new CategorySource(\n" +" 'vendor-blog',\n" +" $messageSource,\n" +" new IntlMessageFormatter(),\n" +" $messageSource,\n" +" );\n" +" },\n" +" 'tags' => ['translation.categorySource'],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Store messages by locale and category:" -msgstr "" +msgstr "Guarda los mensajes por idioma (locale) y categoría:" #. type: Fenced code block #: ../src/guide/structure/designing-packages.md @@ -648,28 +862,33 @@ msgid "" " de/\n" " vendor-blog.php\n" msgstr "" +"messages/\n" +" en-US/\n" +" vendor-blog.php\n" +" de/\n" +" vendor-blog.php\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use the explicit category when translating:" -msgstr "" +msgstr "Usa la categoría explícita al traducir:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "$translator->translate('post.created', category: 'vendor-blog');\n" -msgstr "" +msgstr "$translator->translate('post.created', category: 'vendor-blog');\n" #. type: Title ## #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Themes" -msgstr "" +msgstr "Temas" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "A package can ship view files and assets for a theme. Do not activate it from vendor package configuration. Instead, document the root application configuration needed to enable it. For the application template, this belongs in `config/web/params.php`:" -msgstr "" +msgstr "Un paquete puede incluir archivos de vista y assets para un tema. No lo actives desde la configuración del paquete de terceros. En su lugar, documenta la configuración de la aplicación raíz necesaria para activarlo. En la plantilla de aplicación, esto va en `config/web/params.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -691,26 +910,41 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" 'theme' => [\n" +" 'pathMap' => [\n" +" '@views' => '@vendor/vendor/blog/views',\n" +" ],\n" +" 'basePath' => '@vendor/vendor/blog/assets',\n" +" 'baseUrl' => '@assetsUrl/vendor-blog',\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Themes replace view paths according to a path map. Document which application view paths your theme replaces and which asset URL must be published or exposed by the application." -msgstr "" +msgstr "Los temas sustituyen las rutas de las vistas según un mapa de rutas. Documenta qué rutas de vistas de la aplicación sustituye tu tema y qué URL de assets debe publicar o exponer la aplicación." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Do not set `yiisoft/view.theme` directly in vendor package configuration. `yiisoft/view` already defines that key, and duplicate keys in the same configuration layer are not allowed." -msgstr "" +msgstr "No establezcas `yiisoft/view.theme` directamente en la configuración del paquete de terceros. `yiisoft/view` ya define esa clave, y no se permiten claves duplicadas en la misma capa de configuración." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "If your package only provides optional theme files, do not make the theme active by default. Provide the view files, asset bundle, and a documented parameter snippet so the application can opt in." -msgstr "" +msgstr "Si tu paquete solo proporciona archivos de tema opcionales, no actives el tema por defecto. Proporciona los archivos de vista, el paquete de assets y un fragmento de parámetros documentado para que la aplicación pueda activarlo si lo desea." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Console packages can add Symfony Console commands through `config/params-console.php`:" -msgstr "" +msgstr "Los paquetes de consola pueden añadir comandos de Symfony Console mediante `config/params-console.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/designing-packages.md @@ -730,70 +964,83 @@ msgid "" " ],\n" "];\n" msgstr "" +" [\n" +" 'commands' => [\n" +" 'blog/reindex' => ReindexCommand::class,\n" +" ],\n" +" ],\n" +"];\n" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Command names should be package-prefixed. Keep command dependencies constructor-injected and registered through DI." -msgstr "" +msgstr "Los nombres de los comandos deben llevar como prefijo el del paquete. Inyecta las dependencias de los comandos por constructor y regístralas mediante DI." #. type: Title ## #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Application overrides" -msgstr "" +msgstr "Sobrescrituras de la aplicación" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Package configuration is the default layer. The application can override it in its root package configuration. Design for that:" -msgstr "" +msgstr "La configuración del paquete es la capa predeterminada. La aplicación puede sobrescribirla en la configuración de su paquete raíz. Diseña teniéndolo en cuenta:" #. type: Bullet: '- ' #: ../src/guide/structure/designing-packages.md msgid "Use package-prefixed parameter keys, route names, event handler IDs, and DI aliases." -msgstr "" +msgstr "Usa claves de parámetros, nombres de rutas, identificadores de manejadores de eventos y alias DI con el prefijo del paquete." #. type: Bullet: '- ' #: ../src/guide/structure/designing-packages.md msgid "Keep default configuration small and documented." -msgstr "" +msgstr "Mantén la configuración predeterminada pequeña y documentada." #. type: Bullet: '- ' #: ../src/guide/structure/designing-packages.md msgid "Avoid doing irreversible work during service registration." -msgstr "" +msgstr "Evita hacer trabajo irreversible durante el registro de servicios." #. type: Bullet: '- ' #: ../src/guide/structure/designing-packages.md msgid "Put optional integrations in separate config files or providers when they require optional Composer packages." -msgstr "" +msgstr "Pon las integraciones opcionales en archivos de configuración o proveedores separados cuando requieran paquetes de Composer opcionales." #. type: Bullet: '- ' #: ../src/guide/structure/designing-packages.md msgid "Test the package inside a minimal Yii application so the config plugin, DI container, routes, console commands, migrations, translations, and assets are exercised together." -msgstr "" +msgstr "Prueba el paquete dentro de una aplicación Yii mínima para que el plugin de configuración, el contenedor DI, las rutas, los comandos de consola, las migraciones, las traducciones y los assets se pongan a prueba en conjunto." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "When a user needs to customize package configuration, they usually do not need to copy the package config file. They can partially redefine the needed keys in the application configuration." -msgstr "" +msgstr "Cuando un usuario necesita personalizar la configuración de un paquete, normalmente no necesita copiar el archivo de configuración del paquete. Puede redefinir parcialmente las claves necesarias en la configuración de la aplicación." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "After changing config group mappings, they should rebuild the merge plan with:" -msgstr "" +msgstr "Después de cambiar las asignaciones de los grupos de configuración, debe volver a generar el plan de fusión con:" #. type: Title ## #: ../src/guide/structure/designing-packages.md #, no-wrap msgid "Releasing packages" -msgstr "" +msgstr "Publicar paquetes" #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Before tagging a release, test the package by itself and inside a minimal Yii application. Include a `README.md`, `CHANGELOG.md`, and `UPGRADE.md` when behavior or configuration changes require explanation." -msgstr "" +msgstr "Antes de etiquetar una versión, prueba el paquete por sí solo y dentro de una aplicación Yii mínima. Incluye un `README.md`, un `CHANGELOG.md` y un `UPGRADE.md` cuando los cambios de comportamiento o de configuración requieran explicación." #. type: Plain text #: ../src/guide/structure/designing-packages.md msgid "Use [semantic versioning](https://semver.org) for public releases. After the first release, do not edit migrations that users may already have applied; add new migrations instead." -msgstr "" +msgstr "Usa el [versionado semántico](https://semver.org) para las versiones públicas. Tras la primera versión, no edites migraciones que los usuarios ya puedan haber aplicado; en su lugar, añade migraciones nuevas." diff --git a/_translations/po/es/guide_structure_entry-script.md.po b/_translations/po/es/guide_structure_entry-script.md.po index 07ad62ac..d33c2e26 100644 --- a/_translations/po/es/guide_structure_entry-script.md.po +++ b/_translations/po/es/guide_structure_entry-script.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-10-07 15:22+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,69 +20,68 @@ msgstr "" #: ../src/guide/structure/entry-script.md #, no-wrap msgid "Entry scripts" -msgstr "" +msgstr "Scripts de entrada" #. type: Plain text #: ../src/guide/structure/entry-script.md msgid "Entry scripts are the first step in the application bootstrapping process. An application (either Web application or console application) has a single entry script. End users make requests to entry scripts which instantiate application instances and forward the requests to them." -msgstr "" +msgstr "Los scripts de entrada son el primer paso del proceso de arranque de la aplicación. Una aplicación (ya sea web o de consola) tiene un único script de entrada. Los usuarios finales hacen solicitudes a los scripts de entrada, que crean instancias de la aplicación y les reenvían las solicitudes." #. type: Plain text #: ../src/guide/structure/entry-script.md msgid "Entry scripts for Web applications must be stored under Web-accessible directories so that they can be accessed by end users. They're often named as `index.php`, but can also use any other names, provided Web servers can locate them." -msgstr "" +msgstr "Los scripts de entrada de las aplicaciones web deben guardarse en directorios accesibles desde la web para que los usuarios finales puedan acceder a ellos. Suelen llamarse `index.php`, pero pueden tener cualquier otro nombre, siempre que los servidores web puedan encontrarlos." #. type: Plain text #: ../src/guide/structure/entry-script.md msgid "Entry script for console application is `./yii`." -msgstr "" +msgstr "El script de entrada de la aplicación de consola es `./yii`." #. type: Plain text #: ../src/guide/structure/entry-script.md msgid "Entry scripts mainly perform the following work with the help of `ApplicationRunner`:" -msgstr "" +msgstr "Los scripts de entrada realizan principalmente las siguientes tareas con la ayuda de `ApplicationRunner`:" #. type: Bullet: '* ' #: ../src/guide/structure/entry-script.md msgid "Register [Composer autoloader](https://getcomposer.org/doc/01-basic-usage.md#autoloading);" -msgstr "" +msgstr "Registrar el [cargador automático de Composer](https://getcomposer.org/doc/01-basic-usage.md#autoloading);" #. type: Bullet: '* ' #: ../src/guide/structure/entry-script.md msgid "Obtain configuration;" -msgstr "" +msgstr "Obtener la configuración;" #. type: Bullet: '* ' #: ../src/guide/structure/entry-script.md msgid "Use configuration to initialize a dependency injection container;" -msgstr "" +msgstr "Usar la configuración para inicializar un contenedor de inyección de dependencias;" #. type: Bullet: '* ' #: ../src/guide/structure/entry-script.md msgid "Get an instance of the request." -msgstr "" +msgstr "Obtener una instancia de la solicitud." #. type: Bullet: '* ' #: ../src/guide/structure/entry-script.md msgid "Pass it to `Application` to handle and get a response from it." -msgstr "" +msgstr "Pasarla a `Application` para que la gestione y obtener de ella una respuesta." #. type: Bullet: '* ' #: ../src/guide/structure/entry-script.md msgid "With the help of an emitter that transforms a response object into an actual HTTP response that's sent to the client browser." -msgstr "" +msgstr "Con la ayuda de un emisor, transformar el objeto de respuesta en una respuesta HTTP real que se envía al navegador del cliente." #. type: Title ## #: ../src/guide/structure/entry-script.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Web Applications" -msgstr "Introducción" +msgstr "Aplicaciones web" #. type: Plain text #: ../src/guide/structure/entry-script.md msgid "The following is the code in the entry script for the application template:" -msgstr "" +msgstr "El siguiente es el código del script de entrada de la plantilla de aplicación:" #. type: Fenced code block (php) #: ../src/guide/structure/entry-script.md @@ -113,18 +112,41 @@ msgid "" "// Run application:\n" "$runner->run();\n" msgstr "" +"debug();\n" +"// Ejecutar la aplicación:\n" +"$runner->run();\n" #. type: Title ## #: ../src/guide/structure/entry-script.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Console Applications" -msgstr "Introducción" +msgstr "Aplicaciones de consola" #. type: Plain text #: ../src/guide/structure/entry-script.md msgid "Similarly, the following is the code for the entry script of a console application:" -msgstr "" +msgstr "Del mismo modo, este es el código del script de entrada de una aplicación de consola:" #. type: Fenced code block (php) #: ../src/guide/structure/entry-script.md @@ -172,34 +194,75 @@ msgid "" " exit($exitCode);\n" "}\n" msgstr "" +"#!/usr/bin/env php\n" +"withDefinitions($config->get('console'))\n" +" ->withProviders($config->get('providers-console'));\n" +"$container = new Container($containerConfig);\n" +"\n" +"/** @var ContainerInterface $container */\n" +"$container = $container->get(ContainerInterface::class);\n" +"\n" +"$application = $container->get(Application::class);\n" +"$exitCode = 1;\n" +"\n" +"try {\n" +" $application->start();\n" +" $exitCode = $application->run(null, new ConsoleBufferedOutput());\n" +"} catch (\\Error $error) {\n" +" $application->renderThrowable($error, new ConsoleBufferedOutput());\n" +"} finally {\n" +" $application->shutdown($exitCode);\n" +" exit($exitCode);\n" +"}\n" #. type: Title ## #: ../src/guide/structure/entry-script.md #, no-wrap msgid "Alternative runtimes" -msgstr "" +msgstr "Entornos de ejecución alternativos" #. type: Plain text #: ../src/guide/structure/entry-script.md msgid "For alternative runtimes such as FrankenPHP, Rapira, RoadRunner, or Swoole, special entry scripts should be used. See:" -msgstr "" +msgstr "Con entornos de ejecución alternativos como FrankenPHP, Rapira, RoadRunner o Swoole, hay que usar scripts de entrada especiales. Consulta:" #. type: Bullet: '- ' #: ../src/guide/structure/entry-script.md msgid "[Using Yii with FrankenPHP](../tutorial/using-yii-with-frankenphp.md)" -msgstr "" +msgstr "[Usar Yii con FrankenPHP](../tutorial/using-yii-with-frankenphp.md)" #. type: Bullet: '- ' #: ../src/guide/structure/entry-script.md msgid "[Using Yii with Rapira](../tutorial/using-yii-with-rapira.md)" -msgstr "" +msgstr "[Usar Yii con Rapira](../tutorial/using-yii-with-rapira.md)" #. type: Bullet: '- ' #: ../src/guide/structure/entry-script.md msgid "[Using Yii with RoadRunner](../tutorial/using-yii-with-roadrunner.md)" -msgstr "" +msgstr "[Usar Yii con RoadRunner](../tutorial/using-yii-with-roadrunner.md)" #. type: Bullet: '- ' #: ../src/guide/structure/entry-script.md msgid "[Using Yii with Swoole](../tutorial/using-yii-with-swoole.md)" -msgstr "" +msgstr "[Usar Yii con Swoole](../tutorial/using-yii-with-swoole.md)" diff --git a/_translations/po/es/guide_structure_middleware.md.po b/_translations/po/es/guide_structure_middleware.md.po index 5f2fae03..48b162ff 100644 --- a/_translations/po/es/guide_structure_middleware.md.po +++ b/_translations/po/es/guide_structure_middleware.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-29 17:10+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,68 +20,68 @@ msgstr "" #: ../src/guide/structure/middleware.md #, no-wrap msgid "Middleware" -msgstr "" +msgstr "Middleware" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "Yii works with HTTP using the abstraction layer built around [PSR-7 HTTP message interfaces](https://www.php-fig.org/psr/psr-7/) and [PSR-15 request handler/middleware interfaces](https://www.php-fig.org/psr/psr-15/)." -msgstr "" +msgstr "Yii trabaja con HTTP mediante una capa de abstracción construida sobre las [interfaces de mensajes HTTP de PSR-7](https://www.php-fig.org/psr/psr-7/) y las [interfaces de manejadores de solicitudes y middlewares de PSR-15](https://www.php-fig.org/psr/psr-15/)." #. type: Plain text #: ../src/guide/structure/middleware.md msgid "The application is composed of one or several middleware. Middleware runs between request and response. When the URL is requested, the request object is passed to the middleware dispatcher that starts executing middleware one after another. Each middleware, given the request, can:" -msgstr "" +msgstr "La aplicación se compone de uno o varios middlewares. Los middlewares se ejecutan entre la solicitud y la respuesta. Cuando se solicita una URL, el objeto de solicitud se pasa al despachador de middlewares, que empieza a ejecutar los middlewares uno tras otro. Cada middleware, dada la solicitud, puede:" #. type: Bullet: '- ' #: ../src/guide/structure/middleware.md msgid "Pass the request to the next middleware performing some work before / after it." -msgstr "" +msgstr "Pasar la solicitud al siguiente middleware y realizar algún trabajo antes o después." #. type: Bullet: '- ' #: ../src/guide/structure/middleware.md msgid "Form the response and return it." -msgstr "" +msgstr "Formar la respuesta y devolverla." #. type: Plain text #: ../src/guide/structure/middleware.md msgid "Depending on middleware used, application behavior may vary significantly." -msgstr "" +msgstr "Según los middlewares que se usen, el comportamiento de la aplicación puede variar mucho." #. type: Plain text #: ../src/guide/structure/middleware.md msgid "![Middleware](/images/guide/middleware.svg)" -msgstr "" +msgstr "![Middleware](/images/guide/middleware.svg)" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "In the above each next middleware wraps the previous middleware. Alternatively, it could be presented as follows:" -msgstr "" +msgstr "En la imagen anterior, cada middleware envuelve al anterior. También se puede representar así:" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "![Middleware](/images/guide/middleware_alternative.svg)" -msgstr "" +msgstr "![Middleware](/images/guide/middleware_alternative.svg)" #. type: Title ## #: ../src/guide/structure/middleware.md #, no-wrap msgid "Using middleware" -msgstr "" +msgstr "Usar middlewares" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "Any [PSR-15](https://www.php-fig.org/psr/psr-15/) compatible middleware could be used with Yii, and there are many. Say, you need to add basic authentication to one of the application URLs. URL-dependent middleware is configured using router, so you need to change the router factory." -msgstr "" +msgstr "Con Yii se puede usar cualquier middleware compatible con [PSR-15](https://www.php-fig.org/psr/psr-15/), y hay muchos. Supongamos que necesitas añadir autenticación básica a una de las URL de la aplicación. Los middlewares que dependen de la URL se configuran con el router, así que tienes que cambiar la factoría del router." #. type: Plain text #: ../src/guide/structure/middleware.md msgid "Authentication middleware is implemented by `middlewares/http-authentication` package so execute `composer require middlewares/http-authentication` in the application root directory." -msgstr "" +msgstr "El middleware de autenticación lo implementa el paquete `middlewares/http-authentication`, así que ejecuta `composer require middlewares/http-authentication` en el directorio raíz de la aplicación." #. type: Plain text #: ../src/guide/structure/middleware.md msgid "Now register the middleware in DI container configuration `config/web.php`:" -msgstr "" +msgstr "Ahora registra el middleware en la configuración del contenedor DI, `config/web.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md @@ -99,11 +99,22 @@ msgid "" " 'attribute()' => ['username'],\n" "],\n" msgstr "" +" [\n" +" 'class' => \\Middlewares\\BasicAuthentication::class,\n" +" '__construct()' => [\n" +" 'users' => [\n" +" 'foo' => 'bar',\n" +" ],\n" +" ],\n" +" 'realm()' => ['Access to the staging site via basic auth'],\n" +" 'attribute()' => ['username'],\n" +"],\n" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "In the `config/routes.php`, add new route:" -msgstr "" +msgstr "En `config/routes.php`, añade una nueva ruta:" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md @@ -126,18 +137,32 @@ msgid "" " ->prependMiddleware(BasicAuthentication::class)\n" "];\n" msgstr "" +"action([SiteController::class, 'auth'])\n" +" ->name('site/auth')\n" +" ->prependMiddleware(BasicAuthentication::class)\n" +"];\n" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "When configuring routing, you're binding `/basic-auth` URL to a chain of middleware consisting of basic authentication, and the action itself. A chain is a special middleware that executes all the middleware it's configured with." -msgstr "" +msgstr "Al configurar el enrutamiento, asocias la URL `/basic-auth` a una cadena de middlewares formada por la autenticación básica y la propia acción. Una cadena es un middleware especial que ejecuta todos los middlewares con los que se ha configurado." #. type: Plain text #: ../src/guide/structure/middleware.md -#, fuzzy -#| msgid "The event class itself may look like the following:" msgid "The action itself could be the following:" -msgstr "La clase del evento en sí se podría ver como esto:" +msgstr "La acción en sí podría ser la siguiente:" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md @@ -150,16 +175,22 @@ msgid "" " return $response;\n" "}\n" msgstr "" +"public function auth(ServerRequestInterface $request): ResponseInterface\n" +"{\n" +" $response = $this->responseFactory->createResponse();\n" +" $response->getBody()->write('Hi ' . $request->getAttribute('username'));\n" +" return $response;\n" +"}\n" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "Basic authentication middleware wrote to request `username` attribute, so you can access the data if needed." -msgstr "" +msgstr "El middleware de autenticación básica escribió el atributo `username` en la solicitud, así que puedes acceder a ese dato si lo necesitas." #. type: Plain text #: ../src/guide/structure/middleware.md msgid "To apply middleware to application overall regardless of URL, adjust `config/application.php`:" -msgstr "" +msgstr "Para aplicar un middleware a toda la aplicación, independientemente de la URL, ajusta `config/application.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md @@ -185,39 +216,58 @@ msgid "" " ],\n" "];\n" msgstr "" +"return [\n" +" Yiisoft\\Yii\\Http\\Application::class => [\n" +" '__construct()' => [\n" +" 'dispatcher' => DynamicReference::to(static function (Injector $injector) {\n" +" return ($injector->make(MiddlewareDispatcher::class))\n" +" ->withMiddlewares(\n" +" [\n" +" ErrorCatcher::class,\n" +" BasicAuthentication::class,\n" +" SessionMiddleware::class,\n" +" CsrfTokenMiddleware::class,\n" +" Router::class,\n" +" ]\n" +" );\n" +" }),\n" +" 'fallbackHandler' => Reference::to(NotFoundHandler::class),\n" +" ],\n" +" ],\n" +"];\n" #. type: Title ## #: ../src/guide/structure/middleware.md #, no-wrap msgid "Creating your own middleware" -msgstr "" +msgstr "Crear tu propio middleware" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "To create middleware, you need to implement a single `process` method of `Psr\\Http\\Server\\MiddlewareInterface`:" -msgstr "" +msgstr "Para crear un middleware, tienes que implementar el único método `process` de `Psr\\Http\\Server\\MiddlewareInterface`:" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md #, no-wrap msgid "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface;\n" -msgstr "" +msgstr "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface;\n" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "There are multiple ways to handle a request, and choosing one depends on what the middleware should achieve." -msgstr "" +msgstr "Hay varias formas de gestionar una solicitud, y la elección depende de lo que deba conseguir el middleware." #. type: Title ### #: ../src/guide/structure/middleware.md #, no-wrap msgid "Forming a response directly" -msgstr "" +msgstr "Formar una respuesta directamente" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "To respond directly, one needs a response factory passed via constructor:" -msgstr "" +msgstr "Para responder directamente, hace falta una factoría de respuestas que se pasa mediante el constructor:" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md @@ -248,12 +298,36 @@ msgid "" " }\n" "}\n" msgstr "" +"responseFactory->createResponse();\n" +" $response->getBody()->write('Hello!');\n" +" return $response;\n" +" }\n" +"}\n" #. type: Title ### #: ../src/guide/structure/middleware.md #, no-wrap msgid "Delegating handling to the next middleware" -msgstr "" +msgstr "Delegar la gestión en el siguiente middleware" #. type: Plain text #: ../src/guide/structure/middleware.md @@ -262,6 +336,8 @@ msgid "" "If middleware either isn't intended to form a response or change the request or can't do anything this time,\n" "handling could be left to the next middleware in the stack: \n" msgstr "" +"Si el middleware no está pensado para formar una respuesta ni para cambiar la solicitud, o si esta vez no puede hacer nada,\n" +"la gestión puede dejarse al siguiente middleware de la pila: \n" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md @@ -272,11 +348,15 @@ msgid "" " return $handler->handle($request); \n" "}\n" msgstr "" +"public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n" +"{\n" +" return $handler->handle($request); \n" +"}\n" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "In case you need to pass data to the next middleware, you can use request attributes:" -msgstr "" +msgstr "Si necesitas pasar datos al siguiente middleware, puedes usar los atributos de la solicitud:" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md @@ -285,28 +365,30 @@ msgid "" "$request = $request->withAttribute('answer', 42);\n" "return $handler->handle($request);\n" msgstr "" +"$request = $request->withAttribute('answer', 42);\n" +"return $handler->handle($request);\n" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "To get it in the next middleware:" -msgstr "" +msgstr "Para obtenerlos en el siguiente middleware:" #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md #, no-wrap msgid "$answer = $request->getAttribute('answer');\n" -msgstr "" +msgstr "$answer = $request->getAttribute('answer');\n" #. type: Title ### #: ../src/guide/structure/middleware.md #, no-wrap msgid "Capturing response to manipulate it" -msgstr "" +msgstr "Capturar la respuesta para manipularla" #. type: Plain text #: ../src/guide/structure/middleware.md msgid "You may want to capture the response to manipulate it. It could be useful for adding CORS headers, gzipping content, etc." -msgstr "" +msgstr "Puede que quieras capturar la respuesta para manipularla. Puede ser útil para añadir cabeceras CORS, comprimir el contenido con gzip, etc." #. type: Fenced code block (php) #: ../src/guide/structure/middleware.md @@ -316,3 +398,6 @@ msgid "" "// extra handing\n" "return $response;\n" msgstr "" +"$response = $handler->handle($request);\n" +"// gestión adicional\n" +"return $response;\n" diff --git a/_translations/po/es/guide_structure_module.md.po b/_translations/po/es/guide_structure_module.md.po index fab82b92..81e7a500 100644 --- a/_translations/po/es/guide_structure_module.md.po +++ b/_translations/po/es/guide_structure_module.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-02 22:29+0000\n" -"PO-Revision-Date: 2026-05-30 08:13+0000\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -21,9 +21,9 @@ msgstr "" #: ../src/guide/structure/designing-packages.md #: ../src/guide/structure/module.md ../src/guide/structure/package.md #: ../src/guide/tutorial/i18n.md -#, fuzzy, no-wrap +#, no-wrap msgid "composer yii-config-rebuild\n" -msgstr "Introducción" +msgstr "composer yii-config-rebuild\n" #. type: Title ## #: ../src/guide/concept/configuration.md @@ -31,43 +31,43 @@ msgstr "Introducción" #: ../src/guide/structure/module.md #, no-wrap msgid "Routes" -msgstr "" +msgstr "Rutas" #. type: Title # #: ../src/guide/structure/module.md #, no-wrap msgid "Modules" -msgstr "" +msgstr "Módulos" #. type: Plain text #: ../src/guide/structure/module.md msgid "A module is an application part grouped around a business context or a reusable feature. In Yii, this is a design boundary, not a required base class. A module can be:" -msgstr "" +msgstr "Un módulo es una parte de la aplicación agrupada en torno a un contexto de negocio o a una funcionalidad reutilizable. En Yii es una frontera de diseño, no una clase base obligatoria. Un módulo puede ser:" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "application code under the `App\\` namespace;" -msgstr "" +msgstr "código de la aplicación dentro del espacio de nombres `App\\`;" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "a [Composer package](package.md) installed into `vendor/`;" -msgstr "" +msgstr "un [paquete de Composer](package.md) instalado en `vendor/`;" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "code that starts in the application and is later extracted into a package." -msgstr "" +msgstr "código que empieza en la aplicación y más adelante se extrae a un paquete." #. type: Plain text #: ../src/guide/structure/module.md msgid "Use a module when a group of actions, domain services, repositories, event handlers, views, assets, commands, and related configuration changes together and has a name that makes sense to the business." -msgstr "" +msgstr "Usa un módulo cuando un grupo de acciones, servicios de dominio, repositorios, manejadores de eventos, vistas, assets, comandos y configuración relacionada cambia a la vez y tiene un nombre con sentido para el negocio." #. type: Plain text #: ../src/guide/structure/module.md msgid "For example, a blog module can live in an application as:" -msgstr "" +msgstr "Por ejemplo, un módulo de blog puede vivir en una aplicación así:" #. type: Fenced code block #: ../src/guide/structure/module.md @@ -83,83 +83,92 @@ msgid "" " IndexAction.php\n" " index.php\n" msgstr "" +"src/\n" +" Blog/\n" +" Post/\n" +" Post.php\n" +" PostRepositoryInterface.php\n" +" InMemoryPostRepository.php\n" +" Web/\n" +" IndexAction.php\n" +" index.php\n" #. type: Plain text #: ../src/guide/structure/module.md msgid "The same structure can later become a Composer package by changing the namespace and adding package metadata and configuration files. See [Designing packages](designing-packages.md) for package-specific details." -msgstr "" +msgstr "Más adelante, la misma estructura puede convertirse en un paquete de Composer cambiando el espacio de nombres y añadiendo los metadatos y los archivos de configuración del paquete. Consulta [Diseñar paquetes para aplicaciones Yii](designing-packages.md) para los detalles específicos de los paquetes." #. type: Title ## #: ../src/guide/structure/module.md #, no-wrap msgid "Module boundaries" -msgstr "" +msgstr "Fronteras de los módulos" #. type: Plain text #: ../src/guide/structure/module.md msgid "Keep module code together by context first and by technical type second. This is close to the [vertical slices](../../cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md) approach, but at a larger application-structure boundary. Prefer `App\\Blog\\Post\\PostRepositoryInterface` over a global `App\\Repository\\PostRepositoryInterface` when the repository belongs to blog posts only." -msgstr "" +msgstr "Agrupa el código de un módulo primero por contexto y después por tipo técnico. Esto se parece al enfoque de [porciones verticales](../../cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md), pero a la escala más amplia de la estructura de la aplicación. Es preferible `App\\Blog\\Post\\PostRepositoryInterface` a un `App\\Repository\\PostRepositoryInterface` global cuando el repositorio solo pertenece a las publicaciones del blog." #. type: Plain text #: ../src/guide/structure/module.md msgid "Treat module classes as a public API only when another module is expected to use them. Good public API classes are usually:" -msgstr "" +msgstr "Trata las clases de un módulo como API pública solo cuando se espere que otro módulo las use. Las buenas clases de API pública suelen ser:" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "commands or queries that express a use case;" -msgstr "" +msgstr "comandos o consultas que expresan un caso de uso;" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "DTOs or value objects passed between modules;" -msgstr "" +msgstr "DTO u objetos de valor que se pasan entre módulos;" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "interfaces for services another module may call;" -msgstr "" +msgstr "interfaces para servicios a los que otro módulo puede llamar;" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "events emitted by the module." -msgstr "" +msgstr "eventos emitidos por el módulo." #. type: Plain text #: ../src/guide/structure/module.md msgid "Keep implementation classes private to the module namespace. Other modules should not depend on `App\\Blog\\Post\\InMemoryPostRepository` or a controller action directly. They should depend on an interface, a use case class, or an event." -msgstr "" +msgstr "Mantén las clases de implementación privadas dentro del espacio de nombres del módulo. Otros módulos no deben depender directamente de `App\\Blog\\Post\\InMemoryPostRepository` ni de una acción de controlador. Deben depender de una interfaz, de una clase de caso de uso o de un evento." #. type: Title ## #: ../src/guide/structure/module.md #, no-wrap msgid "Interfaces between modules" -msgstr "" +msgstr "Interfaces entre módulos" #. type: Plain text #: ../src/guide/structure/module.md msgid "Put an interface where the contract belongs:" -msgstr "" +msgstr "Pon cada interfaz donde corresponda el contrato:" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "If the interface describes a capability provided by a module, place it in that module. For example, `App\\Blog\\Post\\PostRepositoryInterface` belongs to the blog module because it describes how blog posts are read." -msgstr "" +msgstr "Si la interfaz describe una capacidad que proporciona un módulo, colócala en ese módulo. Por ejemplo, `App\\Blog\\Post\\PostRepositoryInterface` pertenece al módulo de blog porque describe cómo se leen las publicaciones del blog." #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "If the interface describes what a module needs from the outside world, place it in the consuming module. For example, `App\\Order\\Customer\\CustomerVerifierInterface` belongs to the order module if orders only need a yes-or-no customer check. The customer module, an application adapter, or a package can provide the implementation." -msgstr "" +msgstr "Si la interfaz describe lo que un módulo necesita del mundo exterior, colócala en el módulo que la consume. Por ejemplo, `App\\Order\\Customer\\CustomerVerifierInterface` pertenece al módulo de pedidos si los pedidos solo necesitan una comprobación de sí o no sobre el cliente. El módulo de clientes, un adaptador de la aplicación o un paquete pueden proporcionar la implementación." #. type: Plain text #: ../src/guide/structure/module.md msgid "This keeps dependencies explicit. A module can depend on another module's public contract, but it should not reach into another module's internal implementation classes." -msgstr "" +msgstr "Así las dependencias quedan explícitas. Un módulo puede depender del contrato público de otro módulo, pero no debe acceder a las clases de implementación internas de otro módulo." #. type: Plain text #: ../src/guide/structure/module.md msgid "First, define the interface in the module:" -msgstr "" +msgstr "Primero, define la interfaz en el módulo:" #. type: Fenced code block (php) #: ../src/guide/structure/module.md @@ -179,11 +188,24 @@ msgid "" " public function findLatest(): array;\n" "}\n" msgstr "" +"\n" +" */\n" +" public function findLatest(): array;\n" +"}\n" #. type: Plain text #: ../src/guide/structure/module.md msgid "Put the implementation in the same module and bind the interface to it:" -msgstr "" +msgstr "Pon la implementación en el mismo módulo y asocia la interfaz a ella:" #. type: Fenced code block (php) #: ../src/guide/structure/module.md @@ -200,46 +222,36 @@ msgid "" " PostRepositoryInterface::class => InMemoryPostRepository::class,\n" "];\n" msgstr "" +" InMemoryPostRepository::class,\n" +"];\n" #. type: Plain text #: ../src/guide/structure/module.md msgid "In the default application template, put this file under `config/common/di/`, for example `config/common/di/blog.php`. The template loads `config/common/di/*.php` into the shared `di` configuration group, so the binding is available to web and console entry points." -msgstr "" +msgstr "En la plantilla de aplicación predeterminada, pon este archivo en `config/common/di/`, por ejemplo `config/common/di/blog.php`. La plantilla carga `config/common/di/*.php` en el grupo de configuración compartido `di`, así que la asociación está disponible para los puntos de entrada web y de consola." #. type: Title ## #: ../src/guide/structure/module.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Web actions" -msgstr "Introducción" +msgstr "Acciones web" #. type: Plain text #: ../src/guide/structure/module.md msgid "Actions belong to the module when they are the web entry point for module behavior:" -msgstr "" +msgstr "Las acciones pertenecen al módulo cuando son el punto de entrada web del comportamiento del módulo:" #. type: Fenced code block (php) #: ../src/guide/structure/module.md -#, fuzzy, no-wrap -#| msgid "" -#| "use Psr\\EventDispatcher\\EventDispatcherInterface;\n" -#| "\n" -#| "final readonly class SignupService\n" -#| "{\n" -#| " public function __construct(\n" -#| " private EventDispatcherInterface $eventDispatcher\n" -#| " )\n" -#| " {\n" -#| " }\n" -#| "\n" -#| " public function signup(SignupForm $form)\n" -#| " {\n" -#| " // handle signup\n" -#| "\n" -#| " $event = new UserSignedUp($form);\n" -#| " $this->eventDispatcher->dispatch($event);\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "eventDispatcher->dispatch($event);\n" +" return $this->viewRenderer->render(__DIR__ . '/index', [\n" +" 'posts' => $this->posts->findLatest(),\n" +" ]);\n" " }\n" "}\n" #. type: Plain text #: ../src/guide/structure/module.md msgid "Keep request parsing and response creation in the action. Keep business decisions in the module's domain classes or use case services." -msgstr "" +msgstr "Mantén en la acción el análisis de la solicitud y la creación de la respuesta. Mantén las decisiones de negocio en las clases de dominio del módulo o en los servicios de casos de uso." #. type: Plain text #: ../src/guide/structure/module.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "For a small application, add module routes directly to `config/common/routes.php`:" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "En una aplicación pequeña, añade las rutas del módulo directamente a `config/common/routes.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/module.md @@ -327,16 +344,40 @@ msgid "" " ),\n" "];\n" msgstr "" +"routes(\n" +" Route::get('/')\n" +" ->action(Web\\HomePage\\Action::class)\n" +" ->name('home'),\n" +" ),\n" +"\n" +" Group::create('/blog')\n" +" ->routes(\n" +" Route::get('')\n" +" ->action(IndexAction::class)\n" +" ->name('blog/index'),\n" +" ),\n" +"];\n" #. type: Plain text #: ../src/guide/structure/module.md msgid "Use module-prefixed route names, such as `blog/index`, to avoid collisions." -msgstr "" +msgstr "Usa nombres de rutas con el prefijo del módulo, como `blog/index`, para evitar colisiones." #. type: Plain text #: ../src/guide/structure/module.md msgid "If the application has many modules, you can give each module its own route config file. Change the `routes` group in `config/configuration.php`:" -msgstr "" +msgstr "Si la aplicación tiene muchos módulos, puedes dar a cada módulo su propio archivo de configuración de rutas. Cambia el grupo `routes` en `config/configuration.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/module.md @@ -347,13 +388,15 @@ msgid "" " 'common/routes/*.php',\n" "],\n" msgstr "" +"'routes' => [\n" +" 'common/routes.php',\n" +" 'common/routes/*.php',\n" +"],\n" #. type: Plain text #: ../src/guide/structure/module.md -#, fuzzy -#| msgid "You can define an alias via application's `config/params.php`:" msgid "Then create `config/common/routes/blog.php`:" -msgstr "Puedes definir un alias mediante la aplicación en `config/params.php`:" +msgstr "Después, crea `config/common/routes/blog.php`:" #. type: Fenced code block (php) #: ../src/guide/structure/module.md @@ -376,38 +419,53 @@ msgid "" " ),\n" "];\n" msgstr "" +"routes(\n" +" Route::get('')\n" +" ->action(IndexAction::class)\n" +" ->name('blog/index'),\n" +" ),\n" +"];\n" #. type: Plain text #: ../src/guide/structure/module.md msgid "After changing `config/configuration.php` or adding files matched by a config wildcard, rebuild the merge plan:" -msgstr "" +msgstr "Después de cambiar `config/configuration.php` o de añadir archivos que coincidan con un comodín de configuración, vuelve a generar el plan de fusión:" #. type: Title ## #: ../src/guide/structure/module.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Module configuration" -msgstr "Introducción" +msgstr "Configuración de los módulos" #. type: Plain text #: ../src/guide/structure/module.md msgid "Application modules use the same configuration groups as packages. The difference is where the configuration lives:" -msgstr "" +msgstr "Los módulos de la aplicación usan los mismos grupos de configuración que los paquetes. La diferencia está en dónde reside la configuración:" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "application module configuration lives in the root application under `config/`;" -msgstr "" +msgstr "la configuración de los módulos de la aplicación reside en la aplicación raíz, dentro de `config/`;" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "package module configuration lives in the package and is declared in `extra.config-plugin`." -msgstr "" +msgstr "la configuración de los módulos distribuidos como paquetes reside en el paquete y se declara en `extra.config-plugin`." #. type: Plain text #: ../src/guide/structure/module.md msgid "Common locations for application module configuration are:" -msgstr "" +msgstr "Las ubicaciones habituales de la configuración de los módulos de la aplicación son:" #. type: Fenced code block #: ../src/guide/structure/module.md @@ -425,28 +483,31 @@ msgid "" " web/\n" " params.php\n" msgstr "" +"config/\n" +" common/\n" +" di/\n" +" blog.php\n" +" routes/\n" +" blog.php\n" +" params.php\n" +" console/\n" +" params.php\n" +" web/\n" +" params.php\n" #. type: Plain text #: ../src/guide/structure/module.md msgid "Put shared service definitions in `common/di/`. Put web-only definitions in `web/di/`. Put console-only parameters or command registrations in `console/params.php`." -msgstr "" +msgstr "Pon las definiciones de servicios compartidas en `common/di/`. Pon las definiciones exclusivas de la web en `web/di/`. Pon los parámetros o registros de comandos exclusivos de la consola en `console/params.php`." #. type: Plain text #: ../src/guide/structure/module.md msgid "When a module grows enough to become reusable, move its PHP classes to a Composer package, move its configuration files to the package `config/` directory, and declare them in the package `composer.json`:" -msgstr "" +msgstr "Cuando un módulo crezca lo suficiente como para ser reutilizable, traslada sus clases PHP a un paquete de Composer, mueve sus archivos de configuración al directorio `config/` del paquete y decláralos en el `composer.json` del paquete:" #. type: Fenced code block (json) #: ../src/guide/structure/module.md -#, fuzzy, no-wrap -#| msgid "" -#| "{\n" -#| " \"autoload\": {\n" -#| " \"psr-4\": {\n" -#| " \"App\\\\\": \"src/\"\n" -#| " }\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "{\n" " \"extra\": {\n" @@ -458,9 +519,10 @@ msgid "" "}\n" msgstr "" "{\n" -" \"autoload\": {\n" -" \"psr-4\": {\n" -" \"App\\\\\": \"src/\"\n" +" \"extra\": {\n" +" \"config-plugin\": {\n" +" \"di\": \"config/di.php\",\n" +" \"routes\": \"config/routes.php\"\n" " }\n" " }\n" "}\n" @@ -468,41 +530,40 @@ msgstr "" #. type: Plain text #: ../src/guide/structure/module.md msgid "The application can then override package defaults in its own config files." -msgstr "" +msgstr "Así, la aplicación puede sobrescribir los valores predeterminados del paquete en sus propios archivos de configuración." #. type: Title ## #: ../src/guide/structure/module.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Cross-module communication" -msgstr "Introducción" +msgstr "Comunicación entre módulos" #. type: Plain text #: ../src/guide/structure/module.md msgid "Choose the smallest coupling that supports the behavior:" -msgstr "" +msgstr "Elige el acoplamiento más pequeño que permita el comportamiento:" #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "Use constructor injection with an interface for a direct synchronous call." -msgstr "" +msgstr "Usa la inyección por constructor con una interfaz para una llamada síncrona directa." #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "Use an event when the producer should not know who reacts to something that happened." -msgstr "" +msgstr "Usa un evento cuando el productor no deba saber quién reacciona a algo que ha ocurrido." #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "Use an application service or use case class when orchestration belongs outside both modules." -msgstr "" +msgstr "Usa un servicio de la aplicación o una clase de caso de uso cuando la orquestación no pertenezca a ninguno de los dos módulos." #. type: Bullet: '- ' #: ../src/guide/structure/module.md msgid "Use a package when the module must be reused by more than one application." -msgstr "" +msgstr "Usa un paquete cuando el módulo deba reutilizarse en más de una aplicación." #. type: Plain text #: ../src/guide/structure/module.md msgid "Avoid service locator calls and global state inside module classes. Let actions, commands, and services receive their dependencies through constructors so module boundaries stay visible in code and testable in isolation." -msgstr "" +msgstr "Evita las llamadas al localizador de servicios y el estado global dentro de las clases de los módulos. Deja que las acciones, los comandos y los servicios reciban sus dependencias a través de los constructores, para que las fronteras de los módulos sigan siendo visibles en el código y se puedan probar de forma aislada." diff --git a/_translations/po/es/guide_structure_overview.md.po b/_translations/po/es/guide_structure_overview.md.po index 46ad1ec0..06fba0fc 100644 --- a/_translations/po/es/guide_structure_overview.md.po +++ b/_translations/po/es/guide_structure_overview.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2025-12-24 08:02+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,92 +20,92 @@ msgstr "" #: ../src/en/guide/structure/overview.md ../src/en/guide/views/script-style-meta.md #, no-wrap msgid "Overview" -msgstr "" +msgstr "Resumen" #. type: Plain text #: ../src/en/guide/structure/overview.md msgid "Yii applications code is typically grouped into modules by context. In each module there could be grouping by type." -msgstr "" +msgstr "El código de las aplicaciones Yii suele agruparse en módulos según el contexto. Dentro de cada módulo puede haber una agrupación por tipo." #. type: Plain text #: ../src/en/guide/structure/overview.md msgid "For example, if the application is an online store, the context could be:" -msgstr "" +msgstr "Por ejemplo, si la aplicación es una tienda en línea, los contextos podrían ser:" #. type: Bullet: '- ' #: ../src/en/guide/structure/overview.md msgid "Customer" -msgstr "" +msgstr "Cliente" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Profile" -msgstr "" +msgstr "Perfil" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Products list" -msgstr "" +msgstr "Lista de productos" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Checkout" -msgstr "" +msgstr "Pago" #. type: Bullet: '- ' #: ../src/en/guide/structure/overview.md msgid "Logistics" -msgstr "" +msgstr "Logística" #. type: Bullet: '- ' #: ../src/en/guide/structure/overview.md msgid "Delivery" -msgstr "" +msgstr "Entrega" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Addresses" -msgstr "" +msgstr "Direcciones" #. type: Bullet: '- ' #: ../src/en/guide/structure/overview.md msgid "Helpdesk" -msgstr "" +msgstr "Soporte técnico" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Support" -msgstr "" +msgstr "Asistencia" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Claims" -msgstr "" +msgstr "Reclamaciones" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Returns" -msgstr "" +msgstr "Devoluciones" #. type: Bullet: '- ' #: ../src/en/guide/structure/overview.md msgid "Accounting" -msgstr "" +msgstr "Contabilidad" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Transactions" -msgstr "" +msgstr "Transacciones" #. type: Bullet: ' - ' #: ../src/en/guide/structure/overview.md msgid "Taxes" -msgstr "" +msgstr "Impuestos" #. type: Plain text #: ../src/en/guide/structure/overview.md msgid "For a \"Customer\" context, residing under `App\\Customer` namespace, structure would be:" -msgstr "" +msgstr "Para el contexto \"Cliente\", que se encuentra en el espacio de nombres `App\\Customer`, la estructura sería:" #. type: Fenced code block #: ../src/en/guide/structure/overview.md @@ -128,33 +128,49 @@ msgid "" " Checkout/ <-- module namespace\n" " CheckoutController.php\n" msgstr "" +"App/\n" +" Customer/ <-- espacio de nombres del módulo\n" +" Entity/\n" +" Customer.php <-- entidad compartida por \"Profile\" y \"Checkout\"\n" +" Profile/\n" +" Widget/\n" +" Gravatar.php\n" +" ProfileRepository.php <-- el repositorio suele ser propio del contexto\n" +" ProfileController.php <-- punto de entrada de \"Customer\\Profile\"\n" +" ProductList/ <-- espacio de nombres del módulo \n" +" Entity/ <-- entidades propias de \"Customer\\ProductList\"\n" +" Category.php\n" +" Product.php\n" +" ProductsListController.php <-- punto de entrada de \"Customer\\ProductList\"\n" +" Checkout/ <-- espacio de nombres del módulo\n" +" CheckoutController.php\n" #. type: Plain text #: ../src/en/guide/structure/overview.md msgid "A context may include sub-contexts. If a class is shared by multiple contexts, it's moved to the ancestor of both contexts." -msgstr "" +msgstr "Un contexto puede incluir subcontextos. Si varios contextos comparten una clase, esta se mueve al ancestro común de esos contextos." #. type: Plain text #: ../src/en/guide/structure/overview.md msgid "A context may have [an entry point known as \"action\" or \"controller\"](action.md). Its job is to take [a request instance](../runtime/request.md), pass it to [domain layer](../../cookbook/organizing-code/domain.md) in a suitable format, and create [a response](../runtime/response.md) based on domain layer return." -msgstr "" +msgstr "Un contexto puede tener [un punto de entrada conocido como \"acción\" o \"controlador\"](action.md). Su trabajo es tomar [una instancia de la solicitud](../runtime/request.md), pasarla a la [capa de dominio](../../cookbook/organizing-code/domain.md) en un formato adecuado y crear [una respuesta](../runtime/response.md) a partir de lo que devuelve la capa de dominio." #. type: Plain text #: ../src/en/guide/structure/overview.md msgid "Besides, Yii applications also have the following:" -msgstr "" +msgstr "Además, las aplicaciones Yii también tienen lo siguiente:" #. type: Bullet: '* ' #: ../src/en/guide/structure/overview.md msgid "[entry scripts](entry-script.md): they're PHP scripts that are directly accessible by end users. They're responsible for starting a request handling cycle. Typically, a single entry script is handling the whole application." -msgstr "" +msgstr "[scripts de entrada](entry-script.md): son scripts PHP a los que acceden directamente los usuarios finales. Se encargan de iniciar el ciclo de gestión de la solicitud. Normalmente, un único script de entrada gestiona toda la aplicación." #. type: Bullet: '* ' #: ../src/en/guide/structure/overview.md msgid "[services](../../cookbook/organizing-code/service.md): they're typically stateless objects registered within dependency container and provide various action methods." -msgstr "" +msgstr "[servicios](../../cookbook/organizing-code/service.md): suelen ser objetos sin estado registrados en el contenedor de dependencias que ofrecen diversos métodos de acción." #. type: Bullet: '* ' #: ../src/en/guide/structure/overview.md msgid "[middleware](middleware.md): they represent a code that needs to be invoked before and after the actual handling of each request by action handlers." -msgstr "" +msgstr "[middlewares](middleware.md): representan código que debe invocarse antes y después de que los manejadores de acción gestionen realmente cada solicitud." diff --git a/_translations/po/es/guide_structure_package.md.po b/_translations/po/es/guide_structure_package.md.po index f433c1f6..ec13f475 100644 --- a/_translations/po/es/guide_structure_package.md.po +++ b/_translations/po/es/guide_structure_package.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-05 20:33+0000\n" -"PO-Revision-Date: 2025-09-04 11:19+0500\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -21,72 +21,72 @@ msgstr "" #: ../src/guide/structure/designing-packages.md #: ../src/guide/structure/module.md ../src/guide/structure/package.md #: ../src/guide/tutorial/i18n.md -#, fuzzy, no-wrap +#, no-wrap msgid "composer yii-config-rebuild\n" -msgstr "Introducción" +msgstr "composer yii-config-rebuild\n" #. type: Title # #: ../src/guide/structure/package.md #, no-wrap msgid "Using packages" -msgstr "" +msgstr "Usar paquetes" #. type: Plain text #: ../src/guide/structure/package.md msgid "Reusable code is distributed as [Composer packages](https://getcomposer.org/doc/05-repositories.md#package). A package can be an infrastructure library, a Yii integration, a reusable feature, or a module representing an application context." -msgstr "" +msgstr "El código reutilizable se distribuye como [paquetes de Composer](https://getcomposer.org/doc/05-repositories.md#package). Un paquete puede ser una biblioteca de infraestructura, una integración con Yii, una funcionalidad reutilizable o un módulo que representa un contexto de la aplicación." #. type: Plain text #: ../src/guide/structure/package.md msgid "This page explains how to use packages in an application. To create a Yii-aware package, see [Designing packages for Yii applications](designing-packages.md)." -msgstr "" +msgstr "Esta página explica cómo usar paquetes en una aplicación. Para crear un paquete preparado para Yii, consulta [Diseñar paquetes para aplicaciones Yii](designing-packages.md)." #. type: Title ## #: ../src/guide/structure/package.md #, no-wrap msgid "Installing packages" -msgstr "" +msgstr "Instalar paquetes" #. type: Plain text #: ../src/guide/structure/package.md msgid "By default, Composer installs packages registered on [Packagist](https://packagist.org/), the main repository for open source PHP packages." -msgstr "" +msgstr "Por defecto, Composer instala los paquetes registrados en [Packagist](https://packagist.org/), el repositorio principal de paquetes PHP de código abierto." #. type: Plain text #: ../src/guide/structure/package.md msgid "Install a package with:" -msgstr "" +msgstr "Instala un paquete con:" #. type: Fenced code block (sh) #: ../src/guide/structure/package.md #, no-wrap msgid "composer require vendor-name/package-name\n" -msgstr "" +msgstr "composer require vendor-name/package-name\n" #. type: Plain text #: ../src/guide/structure/package.md msgid "Composer updates two files:" -msgstr "" +msgstr "Composer actualiza dos archivos:" #. type: Bullet: '- ' #: ../src/guide/structure/package.md msgid "`composer.json` stores the package name and version constraint." -msgstr "" +msgstr "`composer.json` guarda el nombre del paquete y la restricción de versión." #. type: Bullet: '- ' #: ../src/guide/structure/package.md msgid "`composer.lock` stores the exact versions installed." -msgstr "" +msgstr "`composer.lock` guarda las versiones exactas instaladas." #. type: Plain text #: ../src/guide/structure/package.md msgid "Commit both files so other environments install the same dependency versions." -msgstr "" +msgstr "Incluye ambos archivos en el control de versiones para que los demás entornos instalen las mismas versiones de las dependencias." #. type: Plain text #: ../src/guide/structure/package.md msgid "Installed packages are stored in the application `vendor/` directory." -msgstr "" +msgstr "Los paquetes instalados se guardan en el directorio `vendor/` de la aplicación." #. type: Plain text #: ../src/guide/structure/package.md @@ -96,109 +96,104 @@ msgid "" "> Never edit files in `vendor/` directly. Change application configuration, extend classes, decorate services, or\n" "> contribute fixes to the package instead.\n" msgstr "" +"> [!WARNING]\n" +"> Nunca edites directamente los archivos de `vendor/`. En su lugar, cambia la configuración de la aplicación, extiende clases, decora servicios o\n" +"> contribuye con correcciones al paquete.\n" #. type: Plain text #: ../src/guide/structure/package.md msgid "Package classes are available through Composer autoloading after installation. See [Autoloading](../concept/autoloading.md) for details." -msgstr "" +msgstr "Las clases de los paquetes están disponibles mediante la autocarga de Composer tras la instalación. Consulta [Autocarga de clases](../concept/autoloading.md) para más detalles." #. type: Title ## #: ../src/guide/structure/package.md #, no-wrap msgid "Updating packages" -msgstr "" +msgstr "Actualizar paquetes" #. type: Plain text #: ../src/guide/structure/package.md msgid "Update a package within the version constraint recorded in `composer.json`:" -msgstr "" +msgstr "Actualiza un paquete dentro de la restricción de versión registrada en `composer.json`:" #. type: Fenced code block (sh) #: ../src/guide/structure/package.md #, no-wrap msgid "composer update vendor-name/package-name\n" -msgstr "" +msgstr "composer update vendor-name/package-name\n" #. type: Plain text #: ../src/guide/structure/package.md msgid "Change the accepted version constraint with `composer require`:" -msgstr "" +msgstr "Cambia la restricción de versión aceptada con `composer require`:" #. type: Fenced code block (sh) #: ../src/guide/structure/package.md #, no-wrap msgid "composer require vendor-name/package-name:^2.0\n" -msgstr "" +msgstr "composer require vendor-name/package-name:^2.0\n" #. type: Plain text #: ../src/guide/structure/package.md msgid "After updating a Yii-aware package, Composer rebuilds Yii's configuration merge plan. If you changed configuration group mappings manually, rebuild it explicitly:" -msgstr "" +msgstr "Tras actualizar un paquete preparado para Yii, Composer vuelve a generar el plan de fusión de la configuración de Yii. Si has cambiado manualmente las asignaciones de los grupos de configuración, vuelve a generarlo explícitamente:" #. type: Title ## #: ../src/guide/structure/package.md #, no-wrap msgid "Removing packages" -msgstr "" +msgstr "Eliminar paquetes" #. type: Plain text #: ../src/guide/structure/package.md msgid "Remove a package with:" -msgstr "" +msgstr "Elimina un paquete con:" #. type: Fenced code block (sh) #: ../src/guide/structure/package.md #, no-wrap msgid "composer remove vendor-name/package-name\n" -msgstr "" +msgstr "composer remove vendor-name/package-name\n" #. type: Plain text #: ../src/guide/structure/package.md msgid "Then remove application code and configuration that referenced classes, services, routes, commands, assets, migrations, or translations from that package." -msgstr "" +msgstr "Después, elimina el código y la configuración de la aplicación que hacían referencia a clases, servicios, rutas, comandos, assets, migraciones o traducciones de ese paquete." #. type: Title ## #: ../src/guide/structure/package.md #, no-wrap msgid "Private packages" -msgstr "" +msgstr "Paquetes privados" #. type: Plain text #: ../src/guide/structure/package.md msgid "For private code, configure Composer repositories in the application `composer.json`. Common options are:" -msgstr "" +msgstr "Para el código privado, configura repositorios de Composer en el `composer.json` de la aplicación. Las opciones habituales son:" #. type: Bullet: '- ' #: ../src/guide/structure/package.md msgid "`vcs` for a Git repository." -msgstr "" +msgstr "`vcs` para un repositorio Git." #. type: Bullet: '- ' #: ../src/guide/structure/package.md msgid "`path` for a local package during development." -msgstr "" +msgstr "`path` para un paquete local durante el desarrollo." #. type: Bullet: '- ' #: ../src/guide/structure/package.md msgid "`composer` for a private Composer repository." -msgstr "" +msgstr "`composer` para un repositorio privado de Composer." #. type: Plain text #: ../src/guide/structure/package.md msgid "For example, to work with a package located next to the application:" -msgstr "" +msgstr "Por ejemplo, para trabajar con un paquete situado junto a la aplicación:" #. type: Fenced code block (json) #: ../src/guide/structure/package.md -#, fuzzy, no-wrap -#| msgid "" -#| "{\n" -#| " \"autoload\": {\n" -#| " \"psr-4\": {\n" -#| " \"App\\\\\": \"src/\"\n" -#| " }\n" -#| " }\n" -#| "}\n" +#, no-wrap msgid "" "{\n" " \"repositories\": [\n" @@ -210,49 +205,47 @@ msgid "" "}\n" msgstr "" "{\n" -" \"autoload\": {\n" -" \"psr-4\": {\n" -" \"App\\\\\": \"src/\"\n" +" \"repositories\": [\n" +" {\n" +" \"type\": \"path\",\n" +" \"url\": \"../packages/blog\"\n" " }\n" -" }\n" +" ]\n" "}\n" #. type: Plain text #: ../src/guide/structure/package.md msgid "Then install it normally:" -msgstr "" +msgstr "Después, instálalo de la forma habitual:" #. type: Fenced code block (sh) #: ../src/guide/structure/package.md #, no-wrap msgid "composer require vendor/blog\n" -msgstr "" +msgstr "composer require vendor/blog\n" #. type: Plain text #: ../src/guide/structure/package.md -#, fuzzy -#| msgid "[Composer guide on autoloading](https://getcomposer.org/doc/01-basic-usage.md#autoloading)." msgid "Read more in the [Composer repository documentation](https://getcomposer.org/doc/05-repositories.md)." -msgstr "[Guía de Composer sobre autocarga](https://getcomposer.org/doc/01-basic-usage.md#autoloading)." +msgstr "Más información en la [documentación de repositorios de Composer](https://getcomposer.org/doc/05-repositories.md)." #. type: Title ## #: ../src/guide/structure/package.md -#, fuzzy, no-wrap -#| msgid "Introduction +" +#, no-wrap msgid "Package configuration" -msgstr "Introducción" +msgstr "Configuración de paquetes" #. type: Plain text #: ../src/guide/structure/package.md msgid "Some Yii packages provide default configuration through [yiisoft/config](https://github.com/yiisoft/config). After installation, the package configuration becomes part of the vendor layer and the application can override it in the root package configuration." -msgstr "" +msgstr "Algunos paquetes de Yii proporcionan configuración predeterminada mediante [yiisoft/config](https://github.com/yiisoft/config). Tras la instalación, la configuración del paquete pasa a formar parte de la capa de terceros (vendor) y la aplicación puede sobrescribirla en la configuración del paquete raíz." #. type: Plain text #: ../src/guide/structure/package.md msgid "Prefer partial overrides in application config files over copying whole package config files. For example, override only the parameter or service definition you need." -msgstr "" +msgstr "En lugar de copiar archivos de configuración completos de un paquete, es preferible sobrescribir solo una parte en los archivos de configuración de la aplicación. Por ejemplo, sobrescribe únicamente el parámetro o la definición de servicio que necesites." #. type: Plain text #: ../src/guide/structure/package.md msgid "For more details, see [Configuration](../concept/configuration.md) and [Designing packages for Yii applications](designing-packages.md)." -msgstr "" +msgstr "Para más detalles, consulta [Configuración](../concept/configuration.md) y [Diseñar paquetes para aplicaciones Yii](designing-packages.md)." diff --git a/_translations/po/es/index.md.po b/_translations/po/es/index.md.po index f968979a..96cd3fc0 100644 --- a/_translations/po/es/index.md.po +++ b/_translations/po/es/index.md.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-01-13 11:06+0000\n" -"PO-Revision-Date: 2025-12-24 08:23+0000\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-11-19 09:00+0000\n" +"Last-Translator: Pedro Flores\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -20,79 +20,79 @@ msgstr "" #: ../src/index.md #, no-wrap msgid "Yii gives you the maximum functionality by adding the least possible overhead." -msgstr "" +msgstr "Yii te ofrece la máxima funcionalidad con la menor sobrecarga posible." #. type: Yaml Front Matter Hash Value: features title #: ../src/index.md #, no-wrap msgid "Fast" -msgstr "" +msgstr "Rápido" #. type: Yaml Front Matter Hash Value: features details #: ../src/index.md #, no-wrap msgid "Sane defaults and built-in tools helps you write solid and secure code." -msgstr "" +msgstr "Unos valores predeterminados sensatos y herramientas integradas te ayudan a escribir código sólido y seguro." #. type: Yaml Front Matter Hash Value: features title #: ../src/index.md #, no-wrap msgid "Secure" -msgstr "" +msgstr "Seguro" #. type: Yaml Front Matter Hash Value: features details #: ../src/index.md #, no-wrap msgid "Write more code in less time with simple, yet powerful APIs and code generation." -msgstr "" +msgstr "Escribe más código en menos tiempo con API sencillas pero potentes y generación de código." #. type: Yaml Front Matter Hash Value: features title #: ../src/index.md #, no-wrap msgid "Efficient" -msgstr "" +msgstr "Eficiente" #. type: Yaml Front Matter Hash Value: hero actions text #: ../src/index.md #, no-wrap msgid "Get Started" -msgstr "" +msgstr "Empezar" #. type: Yaml Front Matter Hash Value: hero name #: ../src/index.md #, no-wrap msgid "Yii3 Framework" -msgstr "" +msgstr "Framework Yii3" #. type: Yaml Front Matter Hash Value: hero tagline #: ../src/index.md #, no-wrap msgid "A simple, powerful and fast framework. Meet the modern, definitive guide to Yii you've always wanted." -msgstr "" +msgstr "Un framework sencillo, potente y rápido. Descubre la guía definitiva y moderna de Yii que siempre has querido." #. type: Title ## #: ../src/index.md ../src/internals/003-roadmap.md #, no-wrap msgid "Documentation" -msgstr "" +msgstr "Documentación" #. type: Plain text #: ../src/index.md #, no-wrap msgid "

\n" -msgstr "" +msgstr "

\n" #. type: Bullet: '- ' #: ../src/index.md msgid "[The Definitive Guide](guide/) — the comprehensive guide covering all aspects of the framework." -msgstr "" +msgstr "[La guía definitiva](guide/): la guía completa que cubre todos los aspectos del framework." #. type: Bullet: '- ' #: ../src/index.md msgid "[Community Cookbook](cookbook/) — a collection of community-contributed tips, tricks, and solutions for common Yii development tasks." -msgstr "" +msgstr "[Recetario de la comunidad](cookbook/): una colección de consejos, trucos y soluciones aportados por la comunidad para tareas habituales del desarrollo con Yii." #. type: Bullet: '- ' #: ../src/index.md msgid "[Internals](internals/) — documentation for developers contributing to the Yii framework itself, including guidelines, workflows, and best practices." -msgstr "" +msgstr "[Internos](internals/): documentación para los desarrolladores que contribuyen al propio framework Yii, con pautas, flujos de trabajo y buenas prácticas." diff --git a/src/.vitepress/config.js b/src/.vitepress/config.js index fcadfdf2..1a3296af 100644 --- a/src/.vitepress/config.js +++ b/src/.vitepress/config.js @@ -293,6 +293,7 @@ export default { } }, es: { + title: 'Documentación de Yii3', label: 'Español', lang: 'es', link: '/es/', @@ -309,20 +310,21 @@ export default { text: 'Introducción', items: [ {text: 'Acerca de Yii', link: '/es/guide/intro/what-is-yii'}, - {text: 'Actualización desde la versión 2', link: '/es/guide/intro/upgrade-from-v2'} + {text: 'Actualizar desde la versión 1.1', link: '/es/guide/intro/upgrade-from-v1'}, + {text: 'Actualizar desde la versión 2.0', link: '/es/guide/intro/upgrade-from-v2'} ] }, { text: 'Primeros pasos', items: [ - {text: 'Prerrequisitos', link: '/es/guide/start/prerequisites'}, - {text: 'Creando un proyecto', link: '/es/guide/start/creating-project'}, - {text: 'Diciendo Hola', link: '/es/guide/start/hello'}, - {text: 'Trabajando con formularios', link: '/es/guide/start/forms'}, - {text: 'Trabajando con bases de datos', link: '/es/guide/start/databases'}, - {text: 'Generando código con Gii', link: '/es/guide/start/gii'}, - {text: 'Mirando hacia adelante', link: '/es/guide/start/looking-ahead'}, + {text: '¿Qué necesitas saber?', link: '/es/guide/start/prerequisites'}, + {text: 'Crear un proyecto', link: '/es/guide/start/creating-project'}, {text: 'Flujo de trabajo de la aplicación', link: '/es/guide/start/workflow'}, + {text: 'Decir hola', link: '/es/guide/start/hello'}, + {text: 'Trabajar con formularios', link: '/es/guide/start/forms'}, + {text: 'Trabajar con bases de datos', link: '/es/guide/start/databases'}, + {text: 'Generar código con Gii', link: '/es/guide/start/gii'}, + {text: 'Próximos pasos', link: '/es/guide/start/looking-ahead'}, {text: 'Aplicaciones de demostración', link: '/es/guide/start/demo-apps'} ] }, @@ -343,11 +345,16 @@ export default { {text: 'Resumen', link: '/es/guide/structure/overview'}, {text: 'Script de entrada', link: '/es/guide/structure/entry-script'}, {text: 'Aplicación', link: '/es/guide/structure/application'}, + {text: 'Módulo', link: '/es/guide/structure/module'}, {text: 'Acción', link: '/es/guide/structure/action'}, - {text: 'Middleware', link: '/es/guide/structure/middleware'}, - {text: 'Dominio', link: '/es/guide/structure/domain'}, - {text: 'Servicio', link: '/es/guide/structure/service'}, - {text: 'Paquete', link: '/es/guide/structure/package'} + {text: 'Middleware', link: '/es/guide/structure/middleware'} + ] + }, + { + text: 'Paquetes', + items: [ + {text: 'Usar paquetes', link: '/es/guide/structure/package'}, + {text: 'Diseñar paquetes', link: '/es/guide/structure/designing-packages'} ] }, { @@ -362,16 +369,22 @@ export default { {text: 'Registro', link: '/es/guide/runtime/logging'} ] }, + { + text: 'API REST', + items: [ + {text: 'Inicio rápido', link: '/es/guide/rest/quick-start'} + ] + }, { text: 'Seguridad', items: [ {text: 'Resumen', link: '/es/guide/security/overview'}, {text: 'Autenticación', link: '/es/guide/security/authentication'}, {text: 'Autorización', link: '/es/guide/security/authorization'}, - {text: 'Trabajando con contraseñas', link: '/es/guide/security/passwords'}, + {text: 'Trabajar con contraseñas', link: '/es/guide/security/passwords'}, {text: 'Criptografía', link: '/es/guide/security/cryptography'}, - {text: 'Solicitud confiable', link: '/es/guide/security/trusted-request'}, - {text: 'Mejores prácticas', link: '/es/guide/security/best-practices'} + {text: 'Solicitud de confianza', link: '/es/guide/security/trusted-request'}, + {text: 'Buenas prácticas', link: '/es/guide/security/best-practices'} ] }, { @@ -382,8 +395,10 @@ export default { ] }, { - text: 'Trabajando con bases de datos', + text: 'Trabajar con bases de datos', items: [ + {text: 'Yii DB', link: 'https://github.com/yiisoft/db/blob/master/docs/guide/en/README.md'}, + {text: 'Active Record', link: 'https://github.com/yiisoft/active-record/blob/master/README.md'}, {text: 'Migraciones de base de datos', link: '/es/guide/databases/db-migrations'} ] }, @@ -392,21 +407,48 @@ export default { items: [ {text: 'Vistas', link: '/es/guide/views/view'}, {text: 'Assets', link: '/es/guide/views/asset'}, - {text: 'Scripts, estilos y meta tags', link: '/es/guide/views/script-style-meta'}, + {text: 'Scripts, estilos y metaetiquetas', link: '/es/guide/views/script-style-meta'}, {text: 'Motores de plantillas', link: '/es/guide/views/template-engines'}, {text: 'Inyecciones de vista', link: '/es/guide/views/view-injections'}, {text: 'Widgets', link: '/es/guide/views/widget'} ] }, + { + text: 'Pruebas', + items: [ + {text: 'Resumen de las pruebas', link: '/es/guide/testing/overview'}, + {text: 'Configuración del entorno de pruebas', link: '/es/guide/testing/environment-setup'}, + {text: 'Pruebas unitarias', link: '/es/guide/testing/unit'}, + {text: 'Pruebas funcionales', link: '/es/guide/testing/functional'}, + {text: 'Pruebas de extremo a extremo', link: '/es/guide/testing/end-to-end'}, + {text: 'Análisis estático y pruebas de mutación', link: '/es/guide/testing/quality-tools'} + ] + }, { text: 'Tutorial', items: [ {text: 'Aplicaciones de consola', link: '/es/guide/tutorial/console-applications'}, {text: 'Envío de correo', link: '/es/guide/tutorial/mailing'}, {text: 'Optimización del rendimiento', link: '/es/guide/tutorial/performance-tuning'}, - {text: 'Usando con bucle de eventos', link: '/es/guide/tutorial/using-with-event-loop'}, - {text: 'Usando Yii con RoadRunner', link: '/es/guide/tutorial/using-yii-with-roadrunner'}, - {text: 'Usando Yii con Swoole', link: '/es/guide/tutorial/using-yii-with-swoole'} + {text: 'Usar Yii con un bucle de eventos', link: '/es/guide/tutorial/using-with-event-loop'}, + {text: 'Usar Yii con FrankenPHP', link: '/es/guide/tutorial/using-yii-with-frankenphp'}, + {text: 'Usar Yii con Rapira', link: '/es/guide/tutorial/using-yii-with-rapira'}, + {text: 'Usar Yii con RoadRunner', link: '/es/guide/tutorial/using-yii-with-roadrunner'}, + {text: 'Usar Yii con Swoole', link: '/es/guide/tutorial/using-yii-with-swoole'}, + {text: 'Docker en las plantillas de aplicación', link: '/es/guide/tutorial/docker'}, + {text: 'Internacionalización', link: '/es/guide/tutorial/i18n'} + ] + }, + { + text: 'Helpers', + items: [ + {text: 'Arrays', link: 'https://github.com/yiisoft/arrays/'}, + {text: 'Archivos', link: 'https://github.com/yiisoft/files/'}, + {text: 'Html', link: 'https://github.com/yiisoft/html/'}, + {text: 'Json', link: 'https://github.com/yiisoft/json'}, + {text: 'Utilidades de red', link: 'https://github.com/yiisoft/network-utilities/'}, + {text: 'VarDumper', link: 'https://github.com/yiisoft/var-dumper'}, + {text: 'Cadenas', link: 'https://github.com/yiisoft/strings'} ] }, { @@ -419,13 +461,27 @@ export default { text: 'Recetario', items: [ {text: 'Prefacio', link: '/es/cookbook/preface'}, - {text: 'Haciendo solicitudes HTTP', link: '/es/cookbook/making-http-requests'}, - {text: 'Deshabilitando la protección CSRF', link: '/es/cookbook/disabling-csrf-protection'}, - {text: 'Integración con Sentry', link: '/es/cookbook/sentry-integration'} + {text: 'Hacer solicitudes HTTP', link: '/es/cookbook/making-http-requests'}, + {text: 'Usar htmx para recargas parciales de página', link: '/es/cookbook/using-htmx-for-partial-reloads'}, + {text: 'Desactivar la protección CSRF', link: '/es/cookbook/disabling-csrf-protection'}, + {text: 'Integración con Sentry', link: '/es/cookbook/sentry-integration'}, + {text: 'Usar una plantilla de migración personalizada', link: '/es/cookbook/custom-migration-template'}, + {text: 'Type casters personalizados del hidratador', link: '/es/cookbook/custom-hydrator-type-casters'}, + {text: 'Usar Yii en aplicaciones de terceros', link: '/es/cookbook/using-yii-in-third-party-apps'}, + {text: 'Integraciones de terceros', link: '/es/cookbook/third-party-integrations/'} ] }, { - text: 'Configurando servidores web', + text: 'Entorno del desarrollador', + collapsed: false, + items: [ + {text: 'Trabajar en Windows', link: '/es/cookbook/working-on-windows'}, + {text: 'Abrir archivos en PhpStorm', link: '/es/cookbook/opening-files-in-phpstorm'}, + {text: 'Configurar Xdebug', link: '/es/cookbook/configuring-xdebug'} + ] + }, + { + text: 'Configurar servidores web', collapsed: false, items: [ {text: 'General', link: '/es/cookbook/configuring-webservers/general'}, @@ -437,15 +493,20 @@ export default { ] }, { - text: 'Organizando código', + text: 'Organizar el código', items: [ - {text: 'Rebanadas verticales', link: '/es/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices'} + {text: 'Porciones verticales', link: '/es/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices'}, + {text: 'Dominio', link: '/es/cookbook/organizing-code/domain'}, + {text: 'Servicio', link: '/es/cookbook/organizing-code/service'} ] }, { text: 'Despliegue', items: [ - {text: 'Docker Swarm', link: '/es/cookbook/deployment/docker-swarm'} + {text: 'Docker Swarm', link: '/es/cookbook/deployment/docker-swarm'}, + {text: 'Angie Docker Proxy', link: '/es/cookbook/deployment/angie-docker-proxy'}, + {text: 'Autoescalado', link: '/es/cookbook/deployment/autoscaling'}, + {text: 'Migraciones con actualizaciones continuas', link: '/es/cookbook/deployment/rolling-update-migrations'} ] } ], @@ -475,7 +536,8 @@ export default { {text: 'Estilo de código de vista', link: '/es/internals/019-view-code-style'}, {text: 'Lanzamiento de paquete', link: '/es/internals/020-package-release'}, {text: 'Registro de cambios y actualización', link: '/es/internals/021-changelog-upgrade'}, - {text: 'Grupos de configuración', link: '/es/internals/022-config-groups'} + {text: 'Grupos de configuración', link: '/es/internals/022-config-groups'}, + {text: 'GitHub Actions', link: '/es/internals/023-github-actions'} ] } ] @@ -483,6 +545,35 @@ export default { footer: { message: 'Publicado bajo la Licencia BSD-3-Clause.', copyright: `Copyright © 2008-${currentYear} Yii` + }, + docFooter: { + prev: 'Página anterior', + next: 'Página siguiente', + }, + outline: { + label: 'En esta página' + }, + lastUpdated: { + text: 'Última actualización' + }, + search: { + options: { + translations: { + button: { + buttonText: 'Buscar', + buttonAriaLabel: 'Buscar' + }, + modal: { + noResultsText: 'No hay resultados para', + resetButtonTitle: 'Borrar la búsqueda', + footer: { + selectText: 'seleccionar', + navigateText: 'navegar', + closeText: 'cerrar' + } + } + } + } } } },