From ef00c647d15cf08607b4fa79b97d55c07710f0d6 Mon Sep 17 00:00:00 2001 From: lizzie136 Date: Tue, 2 Apr 2019 10:24:48 -0600 Subject: [PATCH 1/7] Adds spanish translation for 6-async/01-callbacks - Translates article.md - Translates task.md - We consider to use 'callback' instead of a translation because it is the term used by the community. --- .../01-animate-circle-callback/task.md | 17 +-- 6-async/01-callbacks/article.md | 141 +++++++++--------- 2 files changed, 79 insertions(+), 79 deletions(-) diff --git a/6-async/01-callbacks/01-animate-circle-callback/task.md b/6-async/01-callbacks/01-animate-circle-callback/task.md index 4a20ca604..ea613cd41 100644 --- a/6-async/01-callbacks/01-animate-circle-callback/task.md +++ b/6-async/01-callbacks/01-animate-circle-callback/task.md @@ -1,19 +1,18 @@ +# Círculo animado con callbacks -# Animated circle with callback +En esta tarea se muestra un círculo animado creciendo. -In the task an animated growing circle is shown. +Ahora, digamos que no necesitamos sólo un círculo, sino también mostrar un mensaje dentro de él. El mensaje debe aparecer _después_ que se ha completado la animación (el círculo ha crecido por completo), de otra manera se vería feo. -Now let's say we need not just a circle, but to show a message inside it. The message should appear *after* the animation is complete (the circle is fully grown), otherwise it would look ugly. +El la solución de esta tarea, la función `showCircle(cx, cy, radius)` dibuja el círulo, pero no hay manera de rastrea cuando está listo. -In the solution of the task, the function `showCircle(cx, cy, radius)` draws the circle, but gives no way to track when it's ready. +Agrega un argumento callback: `showCircle(cx, cy, radius, callback)` a ser llamado cuando la animación se halla completado. El `callback` debe recibir como un argumonto el `
` del círculo. -Add a callback argument: `showCircle(cx, cy, radius, callback)` to be called when the animation is complete. The `callback` should receive the circle `
` as an argument. - -Here's the example: +Aquí hay un ejemplo: ```js showCircle(150, 150, 100, div => { - div.classList.add('message-ball'); + div.classList.add("message-ball"); div.append("Hello, world!"); }); ``` @@ -22,4 +21,4 @@ Demo: [iframe src="solution" height=260] -Take the solution of the task as the base. +Toma la solución de la tarea como base. diff --git a/6-async/01-callbacks/article.md b/6-async/01-callbacks/article.md index a5a91793e..c8731a9ce 100644 --- a/6-async/01-callbacks/article.md +++ b/6-async/01-callbacks/article.md @@ -1,53 +1,51 @@ +# Introducción: callbacks +Muchas acciones en JavaScript son _asíncronas_. -# Introduction: callbacks - -Many actions in JavaScript are *asynchronous*. - -For instance, take a look at the function `loadScript(src)`: +Por ejemplo, vemos la función `loadScript(src)`: ```js function loadScript(src) { - let script = document.createElement('script'); + let script = document.createElement("script"); script.src = src; document.head.append(script); } ``` -The purpose of the function is to load a new script. When it adds the `