Skip to content

Commit

Permalink
Merge pull request #15 from luisinio/pycon-sprint-may-2024-patterns-c…
Browse files Browse the repository at this point in the history
…elery

Traducción de /patterns/celery.po
  • Loading branch information
Abdur-rahmaanJ authored May 21, 2024
2 parents 101aa5e + 51b5e79 commit bae6e02
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Primero que todo, ¡Gracias por tomarte el tiempo de contribuir a la documentaci
| /patterns/appdispatch.po || Pedro Torcatt <[email protected]> |
| /patterns/appfactories.po || Pedro Torcatt <[email protected]> |
| /patterns/caching.po || Pedro Torcatt <[email protected]> |
| /patterns/celery.po | NO (31 restantes) | Pedro Torcatt <pedrotorcattsoto@gmail.com> |
| /patterns/celery.po | | Luis Alday <alday87@gmail.com> |
| /patterns/deferredcallbacks.po || Pedro Torcatt <[email protected]> |
| /patterns/distribute.po || Pedro Torcatt <[email protected]> |
| /patterns/fabric.po || Pedro Torcatt <[email protected]> |
Expand Down
172 changes: 131 additions & 41 deletions docs/locales/es/LC_MESSAGES/patterns/celery.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ 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 <pedrotorcattsoto@gmail.com>\n"
"PO-Revision-Date: 2024-05-21 17:11-0400\n"
"Last-Translator: Luis Alday <alday87@gmail.com>\n"
"Language-Team: ES\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"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 ""
Expand All @@ -30,62 +31,84 @@ 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 "
"<https://github.com/pallets/flask/tree/main/examples/celery>`_ 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 <https://github.com/pallets/flask/"
"tree/main/examples/celery>`_ 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 <https://github.com/pallets/"
"flask/tree/main/examples/celery>`_ 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"
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 ""
"You can use Celery without any integration with Flask, but it's convenient "
"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 ""
"Celery uses similar ideas to Flask, with a ``Celery`` app object that has "
"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 ""
Expand All @@ -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 ""
Expand All @@ -164,34 +217,48 @@ 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 ""
"The decorated function becomes a task object with methods to call it in the "
"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 ""
"The route doesn't get the task's result immediately. That would defeat the "
"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 ""
Expand All @@ -200,24 +267,34 @@ 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 ""
"Now you can start the task using the first route, then poll for the result "
"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 "
"<https://github.com/pallets/flask/tree/main/examples/celery>`_ using "
"JavaScript to submit tasks and poll for progress and results."
"The Flask repository contains `an example <https://github.com/pallets/flask/"
"tree/main/examples/celery>`_ using JavaScript to submit tasks and poll for "
"progress and results."
msgstr ""
"El repositorio de Flask contiene `un ejemplo <https://github.com/pallets/"
"flask/tree/main/examples/celery>`_ 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 ""
Expand All @@ -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 ""
Expand All @@ -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."

0 comments on commit bae6e02

Please sign in to comment.