Skip to content

Commit bae6e02

Browse files
Merge pull request #15 from luisinio/pycon-sprint-may-2024-patterns-celery
Traducción de /patterns/celery.po
2 parents 101aa5e + 51b5e79 commit bae6e02

File tree

2 files changed

+132
-42
lines changed

2 files changed

+132
-42
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Primero que todo, ¡Gracias por tomarte el tiempo de contribuir a la documentaci
6666
| /patterns/appdispatch.po || Pedro Torcatt <[email protected]> |
6767
| /patterns/appfactories.po || Pedro Torcatt <[email protected]> |
6868
| /patterns/caching.po || Pedro Torcatt <[email protected]> |
69-
| /patterns/celery.po | NO (31 restantes) | Pedro Torcatt <pedrotorcattsoto@gmail.com> |
69+
| /patterns/celery.po | | Luis Alday <alday87@gmail.com> |
7070
| /patterns/deferredcallbacks.po || Pedro Torcatt <[email protected]> |
7171
| /patterns/distribute.po || Pedro Torcatt <[email protected]> |
7272
| /patterns/fabric.po || Pedro Torcatt <[email protected]> |

docs/locales/es/LC_MESSAGES/patterns/celery.po

Lines changed: 131 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ msgstr ""
88
"Project-Id-Version: Flask 3.0.x\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2023-05-09 22:02-0400\n"
11-
"PO-Revision-Date: 2022-07-12 19:02-0400\n"
12-
"Last-Translator: Pedro Torcatt <pedrotorcattsoto@gmail.com>\n"
11+
"PO-Revision-Date: 2024-05-21 17:11-0400\n"
12+
"Last-Translator: Luis Alday <alday87@gmail.com>\n"
1313
"Language-Team: ES\n"
1414
"Language: es\n"
1515
"MIME-Version: 1.0\n"
1616
"Content-Type: text/plain; charset=utf-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
1919
"Generated-By: Babel 2.10.1\n"
20+
"X-Generator: Poedit 3.4.4\n"
2021

2122
#: ../../patterns/celery.rst:2
2223
msgid "Background Tasks with Celery"
23-
msgstr ""
24+
msgstr "Tareas en segundo plano con Celery"
2425

2526
#: ../../patterns/celery.rst:4
2627
msgid ""
@@ -30,62 +31,84 @@ msgid ""
3031
"another process that will run the task in the background while the request "
3132
"returns immediately."
3233
msgstr ""
33-
"Si su aplicación tiene una tarea de larga duración, como el procesamiento de"
34-
" algunos datos cargados o el envío de correo electrónico, no querrá esperar "
35-
"a que termine durante una solicitud. En su lugar, utilice una cola de tareas"
36-
" para enviar los datos necesarios a otro proceso que ejecutará la tarea en "
37-
"segundo plano mientras la solicitud vuelve inmediatamente."
34+
"Si su aplicación tiene una tarea de larga duración, como el procesamiento "
35+
"de algunos datos cargados o el envío de correo electrónico, no querrá "
36+
"esperar a que termine durante una solicitud. En su lugar, utilice una cola "
37+
"de tareas para enviar los datos necesarios a otro proceso que ejecutará la "
38+
"tarea en segundo plano mientras la solicitud vuelve inmediatamente."
3839

3940
#: ../../patterns/celery.rst:9
4041
msgid ""
4142
"`Celery`_ is a powerful task queue that can be used for simple background "
42-
"tasks as well as complex multi-stage programs and schedules. This guide will"
43-
" show you how to configure Celery using Flask. Read Celery's `First Steps "
44-
"with Celery`_ guide to learn how to use Celery itself."
43+
"tasks as well as complex multi-stage programs and schedules. This guide "
44+
"will show you how to configure Celery using Flask. Read Celery's `First "
45+
"Steps with Celery`_ guide to learn how to use Celery itself."
4546
msgstr ""
47+
"`Celery`_ es una potente cola de tareas que se puede utilizar tanto para "
48+
"tareas simples en segundo plano como para complejos programas y "
49+
"planificaciones multietapa. Esta guía te mostrará cómo configurar Celery "
50+
"utilizando Flask. Lea la guía de Celery `Primeros pasos con Celery`_ para "
51+
"aprender a utilizar Celery."
4652

4753
#: ../../patterns/celery.rst:17
4854
msgid ""
49-
"The Flask repository contains `an example "
50-
"<https://github.com/pallets/flask/tree/main/examples/celery>`_ based on the "
51-
"information on this page, which also shows how to use JavaScript to submit "
52-
"tasks and poll for progress and results."
55+
"The Flask repository contains `an example <https://github.com/pallets/flask/"
56+
"tree/main/examples/celery>`_ based on the information on this page, which "
57+
"also shows how to use JavaScript to submit tasks and poll for progress and "
58+
"results."
5359
msgstr ""
60+
"El repositorio de Flask contiene `un ejemplo <https://github.com/pallets/"
61+
"flask/tree/main/examples/celery>`_ basado en la información de esta pagina, "
62+
"que también muestra cómo utilizar JavaScript para enviar tareas y sondear "
63+
"el progreso y los resultados."
5464

5565
#: ../../patterns/celery.rst:23
5666
msgid "Install"
5767
msgstr "Instalar"
5868

5969
#: ../../patterns/celery.rst:25
6070
msgid "Install Celery from PyPI, for example using pip:"
61-
msgstr ""
71+
msgstr "Instala Celery desde PyPI, por ejemplo utilizando pip:"
6272

6373
#: ../../patterns/celery.rst:33
6474
msgid "Integrate Celery with Flask"
65-
msgstr ""
75+
msgstr "Integra Celery con Flask"
6676

6777
#: ../../patterns/celery.rst:35
6878
msgid ""
6979
"You can use Celery without any integration with Flask, but it's convenient "
7080
"to configure it through Flask's config, and to let tasks access the Flask "
7181
"application."
7282
msgstr ""
83+
"Puedes usar Celery sin ninguna integración con Flask, pero es conveniente "
84+
"configurarlo a través de la configuración de Flask, y dejar que las tareas "
85+
"accedan a la aplicación de Flask."
7386

7487
#: ../../patterns/celery.rst:38
7588
msgid ""
7689
"Celery uses similar ideas to Flask, with a ``Celery`` app object that has "
7790
"configuration and registers tasks. While creating a Flask app, use the "
7891
"following code to create and configure a Celery app as well."
7992
msgstr ""
93+
"Celery utiliza ideas similares a Flask, con un objeto de aplicación "
94+
"``Celery`` que tiene tareas de configuración y registro. Mientras creas una "
95+
"app Flask, utiliza el siguiente código para crear y configurar también una "
96+
"app Celery."
8097

8198
#: ../../patterns/celery.rst:58
8299
msgid ""
83-
"This creates and returns a ``Celery`` app object. Celery `configuration`_ is"
84-
" taken from the ``CELERY`` key in the Flask configuration. The Celery app is"
85-
" set as the default, so that it is seen during each request. The ``Task`` "
100+
"This creates and returns a ``Celery`` app object. Celery `configuration`_ "
101+
"is taken from the ``CELERY`` key in the Flask configuration. The Celery app "
102+
"is set as the default, so that it is seen during each request. The ``Task`` "
86103
"subclass automatically runs task functions with a Flask app context active, "
87104
"so that services like your database connections are available."
88105
msgstr ""
106+
"Esto crea y devuelve un objeto de aplicación ``Celery``. Celery "
107+
"`configuration`_ se toma de la llave ``CELERY`` en la configuración de "
108+
"Flask. La aplicación Celery se establece por defecto, de forma que se vea "
109+
"durante cada petición. La subclase ``Task`` ejecuta automáticamente "
110+
"funciones de tarea con un contexto de aplicación Flask activo, para que los "
111+
"servicios como las conexiones a bases de datos estén disponibles."
89112

90113
#: ../../patterns/celery.rst:66
91114
msgid ""
@@ -94,68 +117,98 @@ msgid ""
94117
"This allows us to store results only for tasks where we care about the "
95118
"result."
96119
msgstr ""
120+
"Aquí hay un ``example.py`` básico que configura Celery para usar Redis para "
121+
"la comunicación. Habilitamos un backend de resultados, pero ignoramos los "
122+
"resultados por defecto. Esto nos permite almacenar los resultados sólo para "
123+
"las tareas en las que nos importa el resultado."
97124

98125
#: ../../patterns/celery.rst:84
99126
msgid ""
100127
"Point the ``celery worker`` command at this and it will find the "
101128
"``celery_app`` object."
102129
msgstr ""
130+
"Apunta el comando ``celery worker`` a esto y encontrará el objeto "
131+
"``celery_app``."
103132

104133
#: ../../patterns/celery.rst:90
105134
msgid ""
106-
"You can also run the ``celery beat`` command to run tasks on a schedule. See"
107-
" Celery's docs for more information about defining schedules."
135+
"You can also run the ``celery beat`` command to run tasks on a schedule. "
136+
"See Celery's docs for more information about defining schedules."
108137
msgstr ""
138+
"También puedes ejecutar el comando ``celery beat`` para ejecutar tareas de "
139+
"forma programada. Consulta la documentación de Celery para obtener más "
140+
"información acerca de la definición de horarios."
109141

110142
#: ../../patterns/celery.rst:99
111143
msgid "Application Factory"
112-
msgstr ""
144+
msgstr "Fábrica de aplicaciones"
113145

114146
#: ../../patterns/celery.rst:101
115147
msgid ""
116148
"When using the Flask application factory pattern, call the "
117-
"``celery_init_app`` function inside the factory. It sets "
118-
"``app.extensions[\"celery\"]`` to the Celery app object, which can be used "
119-
"to get the Celery app from the Flask app returned by the factory."
149+
"``celery_init_app`` function inside the factory. It sets ``app."
150+
"extensions[\"celery\"]`` to the Celery app object, which can be used to get "
151+
"the Celery app from the Flask app returned by the factory."
120152
msgstr ""
153+
"Cuando uses el patrón de fábrica de aplicaciones Flask, llama a la función "
154+
"``celery_init_app`` dentro de la fábrica. Establece ``app."
155+
"extensions[\"celery\"]`` al objeto de la aplicación Celery, que se puede "
156+
"utilizar para obtener la aplicación Celery de la aplicación Flask devuelta "
157+
"por la fábrica."
121158

122159
#: ../../patterns/celery.rst:120
123160
msgid ""
124-
"To use ``celery`` commands, Celery needs an app object, but that's no longer"
125-
" directly available. Create a ``make_celery.py`` file that calls the Flask "
126-
"app factory and gets the Celery app from the returned Flask app."
161+
"To use ``celery`` commands, Celery needs an app object, but that's no "
162+
"longer directly available. Create a ``make_celery.py`` file that calls the "
163+
"Flask app factory and gets the Celery app from the returned Flask app."
127164
msgstr ""
165+
"Para usar los comandos ``celery``, Celery necesita un objeto app, pero eso "
166+
"ya no está disponible directamente. Crea un archivo ``make_celery.py`` que "
167+
"llame a la fábrica de aplicaciones Flask y obtenga la aplicación Celery de "
168+
"la aplicación Flask devuelta."
128169

129170
#: ../../patterns/celery.rst:131
130171
msgid "Point the ``celery`` command to this file."
131-
msgstr ""
172+
msgstr "Apunta el comando ``celery`` a este archivo."
132173

133174
#: ../../patterns/celery.rst:140
134175
msgid "Defining Tasks"
135-
msgstr ""
176+
msgstr "Definición de Tareas"
136177

137178
#: ../../patterns/celery.rst:142
138179
msgid ""
139-
"Using ``@celery_app.task`` to decorate task functions requires access to the"
140-
" ``celery_app`` object, which won't be available when using the factory "
180+
"Using ``@celery_app.task`` to decorate task functions requires access to "
181+
"the ``celery_app`` object, which won't be available when using the factory "
141182
"pattern. It also means that the decorated tasks are tied to the specific "
142183
"Flask and Celery app instances, which could be an issue during testing if "
143184
"you change configuration for a test."
144185
msgstr ""
186+
"El uso de ``@celery_app.task`` para decorar funciones de tareas requiere el "
187+
"acceso al objeto ``celery_app``, que no estará disponible cuando se utiliza "
188+
"el patrón de fábrica. También significa que las tareas decoradas están "
189+
"vinculadas a las instancias específicas de Flask y Celery app, lo que "
190+
"podría ser un problema durante las pruebas si se cambia la configuración "
191+
"para una prueba."
145192

146193
#: ../../patterns/celery.rst:147
147194
msgid ""
148195
"Instead, use Celery's ``@shared_task`` decorator. This creates task objects "
149-
"that will access whatever the \"current app\" is, which is a similar concept"
150-
" to Flask's blueprints and app context. This is why we called "
196+
"that will access whatever the \"current app\" is, which is a similar "
197+
"concept to Flask's blueprints and app context. This is why we called "
151198
"``celery_app.set_default()`` above."
152199
msgstr ""
200+
"En su lugar, utiliza el decorador ``@shared_task`` de Celery. Esto crea "
201+
"objetos de tarea que accederán a cualquiera que sea la \"aplicación "
202+
"actual\", que es un concepto similar a blueprint de Flask y el contexto de "
203+
"la aplicación. Esta es la razón por la que llamamos ``celery_app."
204+
"set_default()`` arriba."
153205

154206
#: ../../patterns/celery.rst:151
155207
msgid ""
156208
"Here's an example task that adds two numbers together and returns the "
157209
"result."
158210
msgstr ""
211+
"Aquí hay una tarea de ejemplo que suma dos números y devuelve el resultado."
159212

160213
#: ../../patterns/celery.rst:161
161214
msgid ""
@@ -164,34 +217,48 @@ msgid ""
164217
"On the other hand, a task that didn't need a result, such as sending an "
165218
"email, wouldn't set this."
166219
msgstr ""
220+
"Anteriormente, hemos configurado Celery para ignorar los resultados de la "
221+
"tarea por defecto. Como queremos conocer el valor de retorno de esta tarea, "
222+
"configuramos ``ignore_result=False``. Por otra parte, una tarea que no "
223+
"necesita un resultado, como el envío de un correo electrónico, no requiere "
224+
"esto."
167225

168226
#: ../../patterns/celery.rst:167
169227
msgid "Calling Tasks"
170-
msgstr ""
228+
msgstr "Llamada a Tareas"
171229

172230
#: ../../patterns/celery.rst:169
173231
msgid ""
174232
"The decorated function becomes a task object with methods to call it in the "
175233
"background. The simplest way is to use the ``delay(*args, **kwargs)`` "
176234
"method. See Celery's docs for more methods."
177235
msgstr ""
236+
"La función decorada se convierte en un objeto tarea con métodos para "
237+
"llamarla en segundo plano. La forma más sencilla es utilizar el método "
238+
"``delay(*args, **kwargs)``. Ve la documentación de Celery para más métodos."
178239

179240
#: ../../patterns/celery.rst:173
180241
msgid ""
181242
"A Celery worker must be running to run the task. Starting a worker is shown "
182243
"in the previous sections."
183244
msgstr ""
245+
"Un Celery worker debe estar en ejecución para ejecutar la tarea. El inicio "
246+
"de un worker se muestra en las secciones anteriores."
184247

185248
#: ../../patterns/celery.rst:187
186249
msgid ""
187250
"The route doesn't get the task's result immediately. That would defeat the "
188251
"purpose by blocking the response. Instead, we return the running task's "
189252
"result id, which we can use later to get the result."
190253
msgstr ""
254+
"La ruta no obtiene el resultado de la tarea de inmediato. Eso iría en "
255+
"contra del objetivo al bloquear la respuesta. En su lugar, devolvemos el id "
256+
"de resultado de la tarea en ejecución, que podemos utilizar más tarde para "
257+
"obtener el resultado."
191258

192259
#: ../../patterns/celery.rst:193
193260
msgid "Getting Results"
194-
msgstr ""
261+
msgstr "Obtener Resultados"
195262

196263
#: ../../patterns/celery.rst:195
197264
msgid ""
@@ -200,24 +267,34 @@ msgid ""
200267
"finished (ready), whether it finished successfully, and what the return "
201268
"value (or error) was if it is finished."
202269
msgstr ""
270+
"Para obtener el resultado de la tarea que iniciamos anteriormente, "
271+
"añadiremos otra ruta que toma el identificador de resultado que devolvimos "
272+
"antes. Devolvemos si la tarea está terminada (lista), si terminó con éxito, "
273+
"y cuál fue el valor de retorno (o error) si está terminada."
203274

204275
#: ../../patterns/celery.rst:212
205276
msgid ""
206277
"Now you can start the task using the first route, then poll for the result "
207278
"using the second route. This keeps the Flask request workers from being "
208279
"blocked waiting for tasks to finish."
209280
msgstr ""
281+
"Ahora puede iniciar la tarea utilizando la primera ruta, y luego sondear el "
282+
"resultado utilizando la segunda ruta. Esto evita que los request workers de "
283+
"Flask se bloqueen esperando a que las tareas terminen."
210284

211285
#: ../../patterns/celery.rst:216
212286
msgid ""
213-
"The Flask repository contains `an example "
214-
"<https://github.com/pallets/flask/tree/main/examples/celery>`_ using "
215-
"JavaScript to submit tasks and poll for progress and results."
287+
"The Flask repository contains `an example <https://github.com/pallets/flask/"
288+
"tree/main/examples/celery>`_ using JavaScript to submit tasks and poll for "
289+
"progress and results."
216290
msgstr ""
291+
"El repositorio de Flask contiene `un ejemplo <https://github.com/pallets/"
292+
"flask/tree/main/examples/celery>`_ usando JavaScript para enviar tareas y "
293+
"sondear el progreso y los resultados."
217294

218295
#: ../../patterns/celery.rst:221
219296
msgid "Passing Data to Tasks"
220-
msgstr ""
297+
msgstr "Pasar datos a las tareas"
221298

222299
#: ../../patterns/celery.rst:223
223300
msgid ""
@@ -228,6 +305,12 @@ msgid ""
228305
"that object is probably not serializable and is tied to the session that "
229306
"queried it."
230307
msgstr ""
308+
"La tarea \"add\" anterior tomó dos enteros como argumentos. Para pasar "
309+
"argumentos a las tareas, Celery tiene que serializarlos a un formato que "
310+
"pueda pasar a otros procesos. Por lo tanto, no se recomienda pasar objetos "
311+
"complejos. Por ejemplo, sería imposible pasar un objeto modelo SQLAlchemy, "
312+
"ya que ese objeto probablemente no es serializable y está ligado a la "
313+
"sesión que lo consultó."
231314

232315
#: ../../patterns/celery.rst:229
233316
msgid ""
@@ -238,3 +321,10 @@ msgid ""
238321
"querying the database for a given id, so the task can do the same thing. "
239322
"Pass the user's id rather than the user object."
240323
msgstr ""
324+
"Pase la cantidad mínima de datos necesaria para obtener o recrear cualquier "
325+
"dato complejo dentro de la tarea. Consideremos una tarea que se ejecutará "
326+
"cuando el usuario conectado solicite un archivo de sus datos. La petición "
327+
"de Flask conoce el usuario conectado, y tiene el objeto usuario consultado "
328+
"desde la base de datos. Para ello, consulta la base de datos con un "
329+
"identificador determinado, por lo que la tarea puede hacer lo mismo. Pasa "
330+
"el id del usuario en lugar del objeto usuario."

0 commit comments

Comments
 (0)