From f8a8a8ffccbc39e61e75802292b6351dab4b89f5 Mon Sep 17 00:00:00 2001 From: luis alday Date: Tue, 21 May 2024 17:12:14 -0400 Subject: [PATCH 1/2] updated translation --- .../locales/es/LC_MESSAGES/patterns/celery.po | 172 +++++++++++++----- 1 file changed, 131 insertions(+), 41 deletions(-) diff --git a/docs/locales/es/LC_MESSAGES/patterns/celery.po b/docs/locales/es/LC_MESSAGES/patterns/celery.po index b645483..da4712b 100644 --- a/docs/locales/es/LC_MESSAGES/patterns/celery.po +++ b/docs/locales/es/LC_MESSAGES/patterns/celery.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Flask 3.0.x\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 22:02-0400\n" -"PO-Revision-Date: 2022-07-12 19:02-0400\n" -"Last-Translator: Pedro Torcatt \n" +"PO-Revision-Date: 2024-05-21 17:11-0400\n" +"Last-Translator: Luis Alday \n" "Language-Team: ES\n" "Language: es\n" "MIME-Version: 1.0\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Generated-By: Babel 2.10.1\n" +"X-Generator: Poedit 3.4.4\n" #: ../../patterns/celery.rst:2 msgid "Background Tasks with Celery" -msgstr "" +msgstr "Tareas en segundo plano con Celery" #: ../../patterns/celery.rst:4 msgid "" @@ -30,27 +31,36 @@ msgid "" "another process that will run the task in the background while the request " "returns immediately." msgstr "" -"Si su aplicación tiene una tarea de larga duración, como el procesamiento de" -" algunos datos cargados o el envío de correo electrónico, no querrá esperar " -"a que termine durante una solicitud. En su lugar, utilice una cola de tareas" -" para enviar los datos necesarios a otro proceso que ejecutará la tarea en " -"segundo plano mientras la solicitud vuelve inmediatamente." +"Si su aplicación tiene una tarea de larga duración, como el procesamiento " +"de algunos datos cargados o el envío de correo electrónico, no querrá " +"esperar a que termine durante una solicitud. En su lugar, utilice una cola " +"de tareas para enviar los datos necesarios a otro proceso que ejecutará la " +"tarea en segundo plano mientras la solicitud vuelve inmediatamente." #: ../../patterns/celery.rst:9 msgid "" "`Celery`_ is a powerful task queue that can be used for simple background " -"tasks as well as complex multi-stage programs and schedules. This guide will" -" show you how to configure Celery using Flask. Read Celery's `First Steps " -"with Celery`_ guide to learn how to use Celery itself." +"tasks as well as complex multi-stage programs and schedules. This guide " +"will show you how to configure Celery using Flask. Read Celery's `First " +"Steps with Celery`_ guide to learn how to use Celery itself." msgstr "" +"`Celery`_ es una potente cola de tareas que se puede utilizar tanto para " +"tareas simples en segundo plano como para complejos programas y " +"planificaciones multietapa. Esta guía te mostrará cómo configurar Celery " +"utilizando Flask. Lea la guía de Celery `Primeros pasos con Celery`_ para " +"aprender a utilizar Celery." #: ../../patterns/celery.rst:17 msgid "" -"The Flask repository contains `an example " -"`_ based on the " -"information on this page, which also shows how to use JavaScript to submit " -"tasks and poll for progress and results." +"The Flask repository contains `an example `_ based on the information on this page, which " +"also shows how to use JavaScript to submit tasks and poll for progress and " +"results." msgstr "" +"El repositorio de Flask contiene `un ejemplo `_ basado en la información de esta pagina, " +"que también muestra cómo utilizar JavaScript para enviar tareas y sondear " +"el progreso y los resultados." #: ../../patterns/celery.rst:23 msgid "Install" @@ -58,11 +68,11 @@ msgstr "Instalar" #: ../../patterns/celery.rst:25 msgid "Install Celery from PyPI, for example using pip:" -msgstr "" +msgstr "Instala Celery desde PyPI, por ejemplo utilizando pip:" #: ../../patterns/celery.rst:33 msgid "Integrate Celery with Flask" -msgstr "" +msgstr "Integra Celery con Flask" #: ../../patterns/celery.rst:35 msgid "" @@ -70,6 +80,9 @@ msgid "" "to configure it through Flask's config, and to let tasks access the Flask " "application." msgstr "" +"Puedes usar Celery sin ninguna integración con Flask, pero es conveniente " +"configurarlo a través de la configuración de Flask, y dejar que las tareas " +"accedan a la aplicación de Flask." #: ../../patterns/celery.rst:38 msgid "" @@ -77,15 +90,25 @@ msgid "" "configuration and registers tasks. While creating a Flask app, use the " "following code to create and configure a Celery app as well." msgstr "" +"Celery utiliza ideas similares a Flask, con un objeto de aplicación " +"``Celery`` que tiene tareas de configuración y registro. Mientras creas una " +"app Flask, utiliza el siguiente código para crear y configurar también una " +"app Celery." #: ../../patterns/celery.rst:58 msgid "" -"This creates and returns a ``Celery`` app object. Celery `configuration`_ is" -" taken from the ``CELERY`` key in the Flask configuration. The Celery app is" -" set as the default, so that it is seen during each request. The ``Task`` " +"This creates and returns a ``Celery`` app object. Celery `configuration`_ " +"is taken from the ``CELERY`` key in the Flask configuration. The Celery app " +"is set as the default, so that it is seen during each request. The ``Task`` " "subclass automatically runs task functions with a Flask app context active, " "so that services like your database connections are available." msgstr "" +"Esto crea y devuelve un objeto de aplicación ``Celery``. Celery " +"`configuration`_ se toma de la llave ``CELERY`` en la configuración de " +"Flask. La aplicación Celery se establece por defecto, de forma que se vea " +"durante cada petición. La subclase ``Task`` ejecuta automáticamente " +"funciones de tarea con un contexto de aplicación Flask activo, para que los " +"servicios como las conexiones a bases de datos estén disponibles." #: ../../patterns/celery.rst:66 msgid "" @@ -94,68 +117,98 @@ msgid "" "This allows us to store results only for tasks where we care about the " "result." msgstr "" +"Aquí hay un ``example.py`` básico que configura Celery para usar Redis para " +"la comunicación. Habilitamos un backend de resultados, pero ignoramos los " +"resultados por defecto. Esto nos permite almacenar los resultados sólo para " +"las tareas en las que nos importa el resultado." #: ../../patterns/celery.rst:84 msgid "" "Point the ``celery worker`` command at this and it will find the " "``celery_app`` object." msgstr "" +"Apunta el comando ``celery worker`` a esto y encontrará el objeto " +"``celery_app``." #: ../../patterns/celery.rst:90 msgid "" -"You can also run the ``celery beat`` command to run tasks on a schedule. See" -" Celery's docs for more information about defining schedules." +"You can also run the ``celery beat`` command to run tasks on a schedule. " +"See Celery's docs for more information about defining schedules." msgstr "" +"También puedes ejecutar el comando ``celery beat`` para ejecutar tareas de " +"forma programada. Consulta la documentación de Celery para obtener más " +"información acerca de la definición de horarios." #: ../../patterns/celery.rst:99 msgid "Application Factory" -msgstr "" +msgstr "Fábrica de aplicaciones" #: ../../patterns/celery.rst:101 msgid "" "When using the Flask application factory pattern, call the " -"``celery_init_app`` function inside the factory. It sets " -"``app.extensions[\"celery\"]`` to the Celery app object, which can be used " -"to get the Celery app from the Flask app returned by the factory." +"``celery_init_app`` function inside the factory. It sets ``app." +"extensions[\"celery\"]`` to the Celery app object, which can be used to get " +"the Celery app from the Flask app returned by the factory." msgstr "" +"Cuando uses el patrón de fábrica de aplicaciones Flask, llama a la función " +"``celery_init_app`` dentro de la fábrica. Establece ``app." +"extensions[\"celery\"]`` al objeto de la aplicación Celery, que se puede " +"utilizar para obtener la aplicación Celery de la aplicación Flask devuelta " +"por la fábrica." #: ../../patterns/celery.rst:120 msgid "" -"To use ``celery`` commands, Celery needs an app object, but that's no longer" -" directly available. Create a ``make_celery.py`` file that calls the Flask " -"app factory and gets the Celery app from the returned Flask app." +"To use ``celery`` commands, Celery needs an app object, but that's no " +"longer directly available. Create a ``make_celery.py`` file that calls the " +"Flask app factory and gets the Celery app from the returned Flask app." msgstr "" +"Para usar los comandos ``celery``, Celery necesita un objeto app, pero eso " +"ya no está disponible directamente. Crea un archivo ``make_celery.py`` que " +"llame a la fábrica de aplicaciones Flask y obtenga la aplicación Celery de " +"la aplicación Flask devuelta." #: ../../patterns/celery.rst:131 msgid "Point the ``celery`` command to this file." -msgstr "" +msgstr "Apunta el comando ``celery`` a este archivo." #: ../../patterns/celery.rst:140 msgid "Defining Tasks" -msgstr "" +msgstr "Definición de Tareas" #: ../../patterns/celery.rst:142 msgid "" -"Using ``@celery_app.task`` to decorate task functions requires access to the" -" ``celery_app`` object, which won't be available when using the factory " +"Using ``@celery_app.task`` to decorate task functions requires access to " +"the ``celery_app`` object, which won't be available when using the factory " "pattern. It also means that the decorated tasks are tied to the specific " "Flask and Celery app instances, which could be an issue during testing if " "you change configuration for a test." msgstr "" +"El uso de ``@celery_app.task`` para decorar funciones de tareas requiere el " +"acceso al objeto ``celery_app``, que no estará disponible cuando se utiliza " +"el patrón de fábrica. También significa que las tareas decoradas están " +"vinculadas a las instancias específicas de Flask y Celery app, lo que " +"podría ser un problema durante las pruebas si se cambia la configuración " +"para una prueba." #: ../../patterns/celery.rst:147 msgid "" "Instead, use Celery's ``@shared_task`` decorator. This creates task objects " -"that will access whatever the \"current app\" is, which is a similar concept" -" to Flask's blueprints and app context. This is why we called " +"that will access whatever the \"current app\" is, which is a similar " +"concept to Flask's blueprints and app context. This is why we called " "``celery_app.set_default()`` above." msgstr "" +"En su lugar, utiliza el decorador ``@shared_task`` de Celery. Esto crea " +"objetos de tarea que accederán a cualquiera que sea la \"aplicación " +"actual\", que es un concepto similar a blueprint de Flask y el contexto de " +"la aplicación. Esta es la razón por la que llamamos ``celery_app." +"set_default()`` arriba." #: ../../patterns/celery.rst:151 msgid "" "Here's an example task that adds two numbers together and returns the " "result." msgstr "" +"Aquí hay una tarea de ejemplo que suma dos números y devuelve el resultado." #: ../../patterns/celery.rst:161 msgid "" @@ -164,10 +217,15 @@ msgid "" "On the other hand, a task that didn't need a result, such as sending an " "email, wouldn't set this." msgstr "" +"Anteriormente, hemos configurado Celery para ignorar los resultados de la " +"tarea por defecto. Como queremos conocer el valor de retorno de esta tarea, " +"configuramos ``ignore_result=False``. Por otra parte, una tarea que no " +"necesita un resultado, como el envío de un correo electrónico, no requiere " +"esto." #: ../../patterns/celery.rst:167 msgid "Calling Tasks" -msgstr "" +msgstr "Llamada a Tareas" #: ../../patterns/celery.rst:169 msgid "" @@ -175,12 +233,17 @@ msgid "" "background. The simplest way is to use the ``delay(*args, **kwargs)`` " "method. See Celery's docs for more methods." msgstr "" +"La función decorada se convierte en un objeto tarea con métodos para " +"llamarla en segundo plano. La forma más sencilla es utilizar el método " +"``delay(*args, **kwargs)``. Ve la documentación de Celery para más métodos." #: ../../patterns/celery.rst:173 msgid "" "A Celery worker must be running to run the task. Starting a worker is shown " "in the previous sections." msgstr "" +"Un Celery worker debe estar en ejecución para ejecutar la tarea. El inicio " +"de un worker se muestra en las secciones anteriores." #: ../../patterns/celery.rst:187 msgid "" @@ -188,10 +251,14 @@ msgid "" "purpose by blocking the response. Instead, we return the running task's " "result id, which we can use later to get the result." msgstr "" +"La ruta no obtiene el resultado de la tarea de inmediato. Eso iría en " +"contra del objetivo al bloquear la respuesta. En su lugar, devolvemos el id " +"de resultado de la tarea en ejecución, que podemos utilizar más tarde para " +"obtener el resultado." #: ../../patterns/celery.rst:193 msgid "Getting Results" -msgstr "" +msgstr "Obtener Resultados" #: ../../patterns/celery.rst:195 msgid "" @@ -200,6 +267,10 @@ msgid "" "finished (ready), whether it finished successfully, and what the return " "value (or error) was if it is finished." msgstr "" +"Para obtener el resultado de la tarea que iniciamos anteriormente, " +"añadiremos otra ruta que toma el identificador de resultado que devolvimos " +"antes. Devolvemos si la tarea está terminada (lista), si terminó con éxito, " +"y cuál fue el valor de retorno (o error) si está terminada." #: ../../patterns/celery.rst:212 msgid "" @@ -207,17 +278,23 @@ msgid "" "using the second route. This keeps the Flask request workers from being " "blocked waiting for tasks to finish." msgstr "" +"Ahora puede iniciar la tarea utilizando la primera ruta, y luego sondear el " +"resultado utilizando la segunda ruta. Esto evita que los request workers de " +"Flask se bloqueen esperando a que las tareas terminen." #: ../../patterns/celery.rst:216 msgid "" -"The Flask repository contains `an example " -"`_ using " -"JavaScript to submit tasks and poll for progress and results." +"The Flask repository contains `an example `_ using JavaScript to submit tasks and poll for " +"progress and results." msgstr "" +"El repositorio de Flask contiene `un ejemplo `_ usando JavaScript para enviar tareas y " +"sondear el progreso y los resultados." #: ../../patterns/celery.rst:221 msgid "Passing Data to Tasks" -msgstr "" +msgstr "Pasar datos a las tareas" #: ../../patterns/celery.rst:223 msgid "" @@ -228,6 +305,12 @@ msgid "" "that object is probably not serializable and is tied to the session that " "queried it." msgstr "" +"La tarea \"add\" anterior tomó dos enteros como argumentos. Para pasar " +"argumentos a las tareas, Celery tiene que serializarlos a un formato que " +"pueda pasar a otros procesos. Por lo tanto, no se recomienda pasar objetos " +"complejos. Por ejemplo, sería imposible pasar un objeto modelo SQLAlchemy, " +"ya que ese objeto probablemente no es serializable y está ligado a la " +"sesión que lo consultó." #: ../../patterns/celery.rst:229 msgid "" @@ -238,3 +321,10 @@ msgid "" "querying the database for a given id, so the task can do the same thing. " "Pass the user's id rather than the user object." msgstr "" +"Pase la cantidad mínima de datos necesaria para obtener o recrear cualquier " +"dato complejo dentro de la tarea. Consideremos una tarea que se ejecutará " +"cuando el usuario conectado solicite un archivo de sus datos. La petición " +"de Flask conoce el usuario conectado, y tiene el objeto usuario consultado " +"desde la base de datos. Para ello, consulta la base de datos con un " +"identificador determinado, por lo que la tarea puede hacer lo mismo. Pasa " +"el id del usuario en lugar del objeto usuario." From 51b5e79e397e0a4acccc32e12c7a532fda5f29ad Mon Sep 17 00:00:00 2001 From: luisinio Date: Tue, 21 May 2024 21:12:37 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Actualiza=20informaci=C3=B3n=20de=20los=20a?= =?UTF-8?q?rchivos=20.po?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a7f6a01..08ba8ae 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Primero que todo, ¡Gracias por tomarte el tiempo de contribuir a la documentaci | /patterns/appdispatch.po | SÍ | Pedro Torcatt | | /patterns/appfactories.po | SÍ | Pedro Torcatt | | /patterns/caching.po | SÍ | Pedro Torcatt | -| /patterns/celery.po | NO (31 restantes) | Pedro Torcatt | +| /patterns/celery.po | SÍ | Luis Alday | | /patterns/deferredcallbacks.po | SÍ | Pedro Torcatt | | /patterns/distribute.po | SÍ | Pedro Torcatt | | /patterns/fabric.po | SÍ | Pedro Torcatt |