chore(i8n,curriculum): processed translations (#41575)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
pull/41576/head
camperbot 2021-03-25 07:07:03 -06:00 committed by GitHub
parent b1bd2799cc
commit e55aa5c7bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 74 additions and 73 deletions

View File

@ -1,6 +1,6 @@
---
id: 587d7daf367417b2b2512b7f
title: Change the Prototype to a New Object
title: Cambia el prototipo a un nuevo objeto
challengeType: 1
forumTopicId: 301316
dashedName: change-the-prototype-to-a-new-object
@ -8,13 +8,13 @@ dashedName: change-the-prototype-to-a-new-object
# --description--
Up until now you have been adding properties to the `prototype` individually:
Hasta ahora, has estado agregando propiedades al `prototype` (prototipo) individualmente:
```js
Bird.prototype.numLegs = 2;
```
This becomes tedious after more than a few properties.
Esto se vuelve tedioso después de varias propiedades.
```js
Bird.prototype.eat = function() {
@ -26,7 +26,7 @@ Bird.prototype.describe = function() {
}
```
A more efficient way is to set the `prototype` to a new object that already contains the properties. This way, the properties are added all at once:
Una forma más eficiente es establecer el `prototype` a un nuevo objeto que ya contenga las propiedades. De esta forma, las propiedades son añadidas todas a la vez:
```js
Bird.prototype = {
@ -42,29 +42,29 @@ Bird.prototype = {
# --instructions--
Add the property `numLegs` and the two methods `eat()` and `describe()` to the `prototype` of `Dog` by setting the `prototype` to a new object.
Agrega la propiedad `numLegs`, y los dos métodos `eat()` y `describe()` al `prototype` de `Dog`, estableciendo `prototype` a un nuevo objeto.
# --hints--
`Dog.prototype` should be set to a new object.
`Dog.prototype` debe establecerse a un nuevo objeto.
```js
assert(/Dog\.prototype\s*?=\s*?{/.test(code));
```
`Dog.prototype` should have the property `numLegs`.
`Dog.prototype` debe tener la propiedad `numLegs`.
```js
assert(Dog.prototype.numLegs !== undefined);
```
`Dog.prototype` should have the method `eat()`.
`Dog.prototype` debe tener el método `eat()`.
```js
assert(typeof Dog.prototype.eat === 'function');
```
`Dog.prototype` should have the method `describe()`.
`Dog.prototype` debe tener el método `describe()`.
```js
assert(typeof Dog.prototype.describe === 'function');

View File

@ -1,6 +1,6 @@
---
id: 587d7dac367417b2b2512b73
title: Create a Basic JavaScript Object
title: Crea un objeto básico de JavaScript
challengeType: 1
forumTopicId: 301317
dashedName: create-a-basic-javascript-object
@ -8,13 +8,13 @@ dashedName: create-a-basic-javascript-object
# --description--
Think about things people see every day, like cars, shops, and birds. These are all <dfn>objects</dfn>: tangible things people can observe and interact with.
Piensa en cosas que la gente ve todos los días, como coches, tiendas y aves. Todos estos son <dfn>objetos</dfn>: cosas tangibles con las que la gente puede observar e interactuar.
What are some qualities of these objects? A car has wheels. Shops sell items. Birds have wings.
¿Cuáles son algunas de las cualidades de estos objetos? Un coche tiene ruedas. Las tiendas venden artículos. Las aves tienen alas.
These qualities, or <dfn>properties</dfn>, define what makes up an object. Note that similar objects share the same properties, but may have different values for those properties. For example, all cars have wheels, but not all cars have the same number of wheels.
Estas cualidades, o <dfn>propiedades</dfn>, definen los que constituye un objeto. Ten en cuenta que objetos similares comparten las mismas propiedades, pero posiblemente tengan valores diferentes para estas propiedades. Por ejemplo, todos los coches tienen ruedas, pero no todos los coches tienen la misma cantidad de ruedas.
Objects in JavaScript are used to model real-world objects, giving them properties and behavior just like their real-world counterparts. Here's an example using these concepts to create a `duck` object:
Los objetos en JavaScript son usados para modelar objetos del mundo real, dándoles propiedades y comportamientos como sus contrapartes del mundo real. Aquí hay un ejemplo usando estos conceptos para crear un objeto `duck` (pato):
```js
let duck = {
@ -23,27 +23,27 @@ let duck = {
};
```
This `duck` object has two property/value pairs: a `name` of "Aflac" and a `numLegs` of 2.
El objeto `duck` tiene dos pares propiedad/valor: un `name` (nombre) de `Aflac` y un `numLegs` (número de patas) de 2.
# --instructions--
Create a `dog` object with `name` and `numLegs` properties, and set them to a string and a number, respectively.
Crea un objeto `dog` con las propiedades `name` y `numLegs` y asígnales una cadena y un número, respectivamente.
# --hints--
`dog` should be an object.
`dog` debe ser un objeto.
```js
assert(typeof dog === 'object');
```
`dog` should have a `name` property set to a `string`.
`dog` debe tener una propiedad `name` establecida en una cadena.
```js
assert(typeof dog.name === 'string');
```
`dog` should have a `numLegs` property set to a `number`.
`dog` debe tener una propiedad `numLegs` establecida en un número.
```js
assert(typeof dog.numLegs === 'number');

View File

@ -1,6 +1,6 @@
---
id: 587d7dad367417b2b2512b75
title: Create a Method on an Object
title: Crea un método en un objeto
challengeType: 1
forumTopicId: 301318
dashedName: create-a-method-on-an-object
@ -8,9 +8,9 @@ dashedName: create-a-method-on-an-object
# --description--
Objects can have a special type of property, called a <dfn>method</dfn>.
Los objetos pueden tener un tipo de propiedad especial, llamada <dfn>método</dfn>.
Methods are properties that are functions. This adds different behavior to an object. Here is the `duck` example with a method:
Los métodos son propiedades que son funciones. Estos agregan diferentes comportamientos a los objetos. Aquí esta el ejemplo de `duck` con un método:
```js
let duck = {
@ -19,24 +19,23 @@ let duck = {
sayName: function() {return "The name of this duck is " + duck.name + ".";}
};
duck.sayName();
// Returns "The name of this duck is Aflac."
```
The example adds the `sayName` method, which is a function that returns a sentence giving the name of the `duck`. Notice that the method accessed the `name` property in the return statement using `duck.name`. The next challenge will cover another way to do this.
Este ejemplo agrega el método `sayName`, el cual es una función que devuelve una oración que entrega el nombre del `duck` (pato). Ten en cuenta que el método accedió a la propiedad `name` en la sentencia de retorno usando `duck.name`. El siguiente desafío abarcara otra forma de hacer esto.
# --instructions--
Using the `dog` object, give it a method called `sayLegs`. The method should return the sentence "This dog has 4 legs."
Usando el objeto `dog`, asígnale un método llamado `sayLegs`. El método debe devolver la frase `This dog has 4 legs.`
# --hints--
`dog.sayLegs()` should be a function.
`dog.sayLegs()` debe ser una función.
```js
assert(typeof dog.sayLegs === 'function');
```
`dog.sayLegs()` should return the given string - note that punctuation and spacing matter.
`dog.sayLegs()` debe devolver la cadena asignada; ten cuenta que la puntuación y los espacios importan.
```js
assert(dog.sayLegs() === 'This dog has 4 legs.');

View File

@ -1,6 +1,6 @@
---
id: 587d7dba367417b2b2512ba8
title: Check for All or None
title: Comprueba todos o ninguno
challengeType: 1
forumTopicId: 301338
dashedName: check-for-all-or-none
@ -8,48 +8,50 @@ dashedName: check-for-all-or-none
# --description--
Sometimes the patterns you want to search for may have parts of it that may or may not exist. However, it may be important to check for them nonetheless.
A veces los patrones que quieres buscar pueden tener partes que pueden o no existir. Sin embargo, podría ser importante buscarlos de todos maneras.
You can specify the possible existence of an element with a question mark, `?`. This checks for zero or one of the preceding element. You can think of this symbol as saying the previous element is optional.
Puedes especificar la posible existencia de un elemento con un signo de interrogación, `?`. Esto comprueba cero o uno de los elementos precedentes. Puedes pensar que este símbolo dice que el elemento anterior es opcional.
For example, there are slight differences in American and British English and you can use the question mark to match both spellings.
Por ejemplo, hay ligeras diferencias en inglés americano y británico y puedes usar el signo de interrogación para coincidir con ambas ortografías.
```js
let american = "color";
let british = "colour";
let rainbowRegex= /colou?r/;
rainbowRegex.test(american); // Returns true
rainbowRegex.test(british); // Returns true
rainbowRegex.test(american);
rainbowRegex.test(british);
```
Ambos usos del método `test` devolverán `true`.
# --instructions--
Change the regex `favRegex` to match both the American English (favorite) and the British English (favourite) version of the word.
Cambia la expresión regular `favRegex` para que coincida tanto la versión del inglés americano (`favorite`) como la versión del inglés británico de la palabra (`favourite`).
# --hints--
Your regex should use the optional symbol, `?`.
Tu expresión regular debe usar el símbolo opcional, `?`.
```js
favRegex.lastIndex = 0;
assert(favRegex.source.match(/\?/).length > 0);
```
Your regex should match `"favorite"`
Tu expresión regular debe coincidir con la cadena `favorite`
```js
favRegex.lastIndex = 0;
assert(favRegex.test('favorite'));
```
Your regex should match `"favourite"`
Tu expresión regular debe coincidir con la cadena `favourite`
```js
favRegex.lastIndex = 0;
assert(favRegex.test('favourite'));
```
Your regex should not match `"fav"`
Tu expresión regular no debe coincidir con la cadena `fav`
```js
favRegex.lastIndex = 0;

View File

@ -1,6 +1,6 @@
---
id: 5c3dda8b4d8df89bea71600f
title: Check For Mixed Grouping of Characters
title: Comprueba agrupaciones mixtas de caracteres
challengeType: 1
forumTopicId: 301339
dashedName: check-for-mixed-grouping-of-characters
@ -8,62 +8,63 @@ dashedName: check-for-mixed-grouping-of-characters
# --description--
Sometimes we want to check for groups of characters using a Regular Expression and to achieve that we use parentheses `()`.
A veces queremos comprobar grupos de caracteres utilizando una expresión regular y para conseguirlo usamos paréntesis `()`.
If you want to find either `Penguin` or `Pumpkin` in a string, you can use the following Regular Expression: `/P(engu|umpk)in/g`
Si deseas encontrar `Penguin` o `Pumpkin` en una cadena, puedes usar la siguiente expresión regular: `/P(engu|umpk)in/g`
Then check whether the desired string groups are in the test string by using the `test()` method.
Luego, comprueba si los grupos de cadena deseados están en la cadena de prueba usando el método `test()`.
```js
let testStr = "Pumpkin";
let testRegex = /P(engu|umpk)in/;
testRegex.test(testStr);
// Returns true
```
El método `test` aquí devolverá `true`.
# --instructions--
Fix the regex so that it checks for the names of `Franklin Roosevelt` or `Eleanor Roosevelt` in a case sensitive manner and it should make concessions for middle names.
Corrige la expresión regular para que compruebe los nombres de `Franklin Roosevelt` o `Eleanor Roosevelt` de una manera sensible a mayúsculas y minúsculas y haciendo concesiones para los segundos nombres.
Then fix the code so that the regex that you have created is checked against `myString` and either `true` or `false` is returned depending on whether the regex matches.
Luego, corrige el código para que la expresión regular que has creado se compruebe con `myString` y devuelva `true` o `false` dependiendo de si la expresión regular coincide.
# --hints--
Your regex `myRegex` should return `true` for the string `Franklin D. Roosevelt`
Tu expresión regular `myRegex` debe devolver `true` para la cadena `Franklin D. Roosevelt`
```js
myRegex.lastIndex = 0;
assert(myRegex.test('Franklin D. Roosevelt'));
```
Your regex `myRegex` should return `true` for the string `Eleanor Roosevelt`
Tu expresión regular `myRegex` debe devolver `true` para la cadena `Eleanor Roosevelt`
```js
myRegex.lastIndex = 0;
assert(myRegex.test('Eleanor Roosevelt'));
```
Your regex `myRegex` should return `false` for the string `Franklin Rosevelt`
Tu expresión regular `myRegex` debe devolver `false` para la cadena `Franklin Rosevelt`
```js
myRegex.lastIndex = 0;
assert(!myRegex.test('Franklin Rosevelt'));
```
Your regex `myRegex` should return `false` for the string `Frank Roosevelt`
Tu expresión regular `myRegex` debe devolver `false` para la cadena `Frank Roosevelt`
```js
myRegex.lastIndex = 0;
assert(!myRegex.test('Frank Roosevelt'));
```
You should use `.test()` to test the regex.
Debes usar `.test()` para probar la expresión regular.
```js
assert(code.match(/myRegex.test\(\s*myString\s*\)/));
```
Your result should return `true`.
Tu resultado debe devolver `true`.
```js
assert(result === true);

View File

@ -1,6 +1,6 @@
---
id: 587d7db4367417b2b2512b92
title: Extract Matches
title: Extrae coincidencias
challengeType: 1
forumTopicId: 301340
dashedName: extract-matches
@ -8,22 +8,22 @@ dashedName: extract-matches
# --description--
So far, you have only been checking if a pattern exists or not within a string. You can also extract the actual matches you found with the `.match()` method.
Hasta ahora, sólo has estado comprobando si un patrón existe o no dentro de una cadena. También puedes extraer las coincidencias encontradas con el método `.match()`.
To use the `.match()` method, apply the method on a string and pass in the regex inside the parentheses.
Para utilizar el método `.match()`, aplica el método a una cadena y pasa la expresión regular dentro de los paréntesis.
Here's an example:
Este es un ejemplo:
```js
"Hello, World!".match(/Hello/);
// Returns ["Hello"]
let ourStr = "Regular expressions";
let ourRegex = /expressions/;
ourStr.match(ourRegex);
// Returns ["expressions"]
```
Note that the `.match` syntax is the "opposite" of the `.test` method you have been using thus far:
Aquí el primer `match` devolverá `["Hello"]` y el segundo devolverá `["expressions"]`.
Ten en cuenta que la sintaxis `.match` es lo "opuesto" al método `.test` que has estado utilizando hasta ahora:
```js
'string'.match(/regex/);
@ -32,23 +32,23 @@ Note that the `.match` syntax is the "opposite" of the `.test` method you have b
# --instructions--
Apply the `.match()` method to extract the word `coding`.
Aplica el método `.match()` para extraer la cadena `coding`.
# --hints--
The `result` should have the word `coding`
`result` debe contener la cadena `coding`
```js
assert(result.join() === 'coding');
```
Your regex `codingRegex` should search for `coding`
Tu expresión regular `codingRegex` debe buscar la cadena `coding`
```js
assert(codingRegex.source === 'coding');
```
You should use the `.match()` method.
Debes utilizar el método `.match()`.
```js
assert(code.match(/\.match\(.*\)/));

View File

@ -1,6 +1,6 @@
---
id: 587d7db6367417b2b2512b9b
title: Find Characters with Lazy Matching
title: Encuentra caracteres con una coincidencia perezosa
challengeType: 1
forumTopicId: 301341
dashedName: find-characters-with-lazy-matching
@ -8,36 +8,35 @@ dashedName: find-characters-with-lazy-matching
# --description--
In regular expressions, a <dfn>greedy</dfn> match finds the longest possible part of a string that fits the regex pattern and returns it as a match. The alternative is called a <dfn>lazy</dfn> match, which finds the smallest possible part of the string that satisfies the regex pattern.
En las expresiones regulares, una coincidencia <dfn>codiciosa</dfn> encuentra la parte más larga posible de una cadena que se ajusta al patrón de la expresión regular y la devuelve como una coincidencia. La alternativa es llamada coincidencia <dfn>perezosa</dfn>, la cual encuentra la parte más pequeña posible de la cadena que satisface el patrón de la expresión regular.
You can apply the regex `/t[a-z]*i/` to the string `"titanic"`. This regex is basically a pattern that starts with `t`, ends with `i`, and has some letters in between.
Puedes aplicar la expresión regular `/t[a-z]*i/` a la cadena `"titanic"`. Esta expresión regular es básicamente un patrón que comienza con `t`, termina con `i`, y tiene algunas letras intermedias.
Regular expressions are by default greedy, so the match would return `["titani"]`. It finds the largest sub-string possible to fit the pattern.
Las expresiones regulares son por defecto codiciosas, por lo que la coincidencia devolvería `["titani"]`. Encuentra la sub-cadena más grande posible que se ajusta al patrón.
However, you can use the `?` character to change it to lazy matching. `"titanic"` matched against the adjusted regex of `/t[a-z]*?i/` returns `["ti"]`.
Sin embargo, puedes usar el carácter `?` para cambiarla a una coincidencia perezosa. `"titanic"` al coincidir con la expresión regular ajustada de `/t[a-z]*?i/` devuelve `["ti"]`.
**Note**
Parsing HTML with regular expressions should be avoided, but pattern matching an HTML string with regular expressions is completely fine.
**Nota:** Se debe evitar analizar HTML con expresiones regulares, pero coincidir patrones con una cadena HTML utilizando expresiones regulares está completamente bien.
# --instructions--
Fix the regex `/<.*>/` to return the HTML tag `<h1>` and not the text `"<h1>Winter is coming</h1>"`. Remember the wildcard `.` in a regular expression matches any character.
Corrige la expresión regular `/<.*>/` para que devuelva la etiqueta HTML `<h1>` y no el texto `"<h1>Winter is coming</h1>"`. Recuerda que el comodín `.` en una expresión regular coincide con cualquier carácter.
# --hints--
The `result` variable should be an array with `<h1>` in it
La variable `result` debe ser un arreglo con `<h1>` en él
```js
assert(result[0] == '<h1>');
```
`myRegex` should use lazy matching
`myRegex` debe usar una coincidencia perezosa
```js
assert(/\?/g.test(myRegex));
```
`myRegex` should not include the string 'h1'
`myRegex` no debe incluir la cadena `h1`
```js
assert(!myRegex.source.match('h1'));