Skip to content

Conversation

@LASalvador
Copy link

translating operators and operands

trranslating string convertions and the unary plus

@CLAassistant
Copy link

CLAassistant commented Aug 17, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@dheysonalves dheysonalves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put a comment on the code. There are just some incomplete words, just for the typing. However, everything okay for my reading. Gonna leave for another people to check more.

Copy link
Author

@LASalvador LASalvador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

@Mr-Saxobeat Mr-Saxobeat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a good translation!
Please, would you follow the suggestions? And then finish the translation :D
Thanks!

# Operadores

We know many operators from school. They are things like addition `+`, multiplication `*`, subtraction `-`, and so on.
Nós aprendemos muitos operadores na escolas. Alguns deles são adição `+`, multiplicação `*`, subtração `-` e assim por diante.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

([] - delete; {} - add, change)

  • "... operadores na escola[s]."

- *An operand* -- is what operators are applied to. For instance, in the multiplication of `5 * 2` there are two operands: the left operand is `5` and the right operand is `2`. Sometimes, people call these "arguments" instead of "operands".
- An operator is *unary* if it has a single operand. For example, the unary negation `-` reverses the sign of a number:
- *Um operando* -- é um valor onde os operadores são aplicados. Por exemplo, na multiplicacao `5 * 2` há dois operandos: o operador da esquerda é `5` e o operador da direita é `2`. Às vezes, pessoas os chamam de "argumentos" ao inves de "operandos".
- Um operador é *unário* se ele tem um único operando. Por exemplo, o negativo unário `-` reverte o sinal de um numero:
Copy link
Contributor

@Mr-Saxobeat Mr-Saxobeat Oct 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "... o unário negativo..."
    Because, "... o negativo unário..." sounds like "negativo" is an name, while it's a adjective.

x = -x;
*/!*
alert( x ); // -1, unary negation was applied
alert( x ); // -1, o negativo unário foi aplicado
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "o unário negativo..."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that "negação unária" would be better in that case.

```js run no-beautify
let x = 1, y = 3;
alert( y - x ); // 2, binary minus subtracts values
alert( y - x ); // 2, binário menos subtrai valores
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you writed the correct order of the terms "binário menos", like you need to do on the comments above.

```

Formally, we're talking about two different operators here: the unary negation (single operand: reverses the sign) and the binary subtraction (two operands: subtracts).
Formalmente, nós estamos falando sobre dois operadores diferentes aqui: o negativo unário (único operando: reverte o sinal) e o negativo binário (dois operandos: subtrai).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "... o unário negativo..."
  • "... o binário [negativo] (subtração)..."

Veja, não importa se o primeiro operando ou o segundo é uma string. A regra é simples: se um operando é uma string, o outro é convertido em uma string também.

However, note that operations run from left to right. If there are two numbers followed by a string, the numbers will be added before being converted to a string:
Entretanto, note que operatação são executadas da esquerda para direita. Se há dois números seguidos por uma string, os número serão adicionados antes e então convertidos para uma string:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "...note que (as) [operatação] (operações)..."
  • "...[adicionados] (somados)..."

```

String concatenation and conversion is a special feature of the binary plus `+`. Other arithmetic operators work only with numbers and always convert their operands to numbers.
String concatenação e conversão é uma característica especial do binário mais `+`. Outros operadores aritméticos funcionam apenas com números e sempre convertem seus operandos para números.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "Concatenação e conversão de string..."

## Conversão numérica, unário +

The plus `+` exists in two forms: the binary form that we used above and the unary form.
O mais `+` existe de duas formas: a forma binária que usamos acima e a forma unária.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "... existe [de] (em) duas formas..."

```

It actually does the same thing as `Number(...)`, but is shorter.
Na realidade faz a mesma coisa que `Number(...)`, mas é mais curto.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "... [mas] (porém) é mais curto." - Just to avoid alliteration.

*!*
// both values converted to numbers before the binary plus
// ambos valores convertidos para números antes do mais binário
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "... binário mais"

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@LASalvador
Copy link
Author

/done

Copy link
Contributor

@odsantos odsantos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Here is a review but the file is not complete.

The bold formatting only acts as a visual aid, please use plain text formatting.

Thanks.


We know many operators from school. They are things like addition `+`, multiplication `*`, subtraction `-`, and so on.
Nós aprendemos muitos operadores na escola. Alguns deles são adição `+`, multiplicação `*`, subtração `-` e assim por diante.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "Nós aprendemos sobre muitos operadores..."
  • "Alguns deles são a adição +, a multiplicação *, a subtração -..."

(do not include the bold formatting)


In this chapter, we'll concentrate on aspects of operators that are not covered by school arithmetic.
Nesta capítulo, iremos nos concentrar em aspectos dos operadores que não são cobertos pela aritmética escolar.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "Nesta Neste capítulo,..."

(do not include the bold formatting)

- *An operand* -- is what operators are applied to. For instance, in the multiplication of `5 * 2` there are two operands: the left operand is `5` and the right operand is `2`. Sometimes, people call these "arguments" instead of "operands".
- An operator is *unary* if it has a single operand. For example, the unary negation `-` reverses the sign of a number:
- *Um operando* -- é um valor onde os operadores são aplicados. Por exemplo, na multiplicacao `5 * 2` há dois operandos: o operador da esquerda é `5` e o operador da direita é `2`. Às vezes, pessoas os chamam de "argumentos" ao inves de "operandos".
- Um operador é *unário* se ele tem um único operando. Por exemplo, o unário negativo `-` reverte o sinal de um numero:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "...o operador operando da esquerda é 5 e o operador operando da direita é 2."
  • "Às vezes, as pessoas..."

(do not include the bold formatting)

```js run no-beautify
let x = 1, y = 3;
alert( y - x ); // 2, binary minus subtracts values
alert( y - x ); // 2, binário menos subtrai valores
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "o binário menos subtrai valores"

(do not include the bold formatting)

Normalmente, o operador mais `+` soma números.

But, if the binary `+` is applied to strings, it merges (concatenates) them:
Mas, se o binário `+` é aplicado em strings, junta (concatena) elas:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with @Mr-Saxobeat:

  • "...é aplicado em a strings, ele junta (concatena) elas:"

(do not include the bold formatting)


See, it doesn't matter whether the first operand is a string or the second one. The rule is simple: if either operand is a string, the other one is converted into a string as well.
Veja, não importa se o primeiro operando ou o segundo é uma string. A regra é simples: se um operando é uma string, o outro é convertido em uma string também.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "...convertido em para uma string também.

(do not include the bold formatting)


The unary plus or, in other words, the plus operator `+` applied to a single value, doesn't do anything to numbers. But if the operand is not a number, the unary plus converts it into a number.
O unário mais ou, em outras palavras, o operador mais `+` aplicado em um único valor, não faz nada para números. Mas se o operando não é um número, o unário mais converte-o em um número.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "... o operador mais + aplicado em a um único valor,"

(do not include the bold formatting)

alert( +x ); // 1
let y = -2;
alert( +y ); // -2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "Sem efeitos efeito em ..."

(do not include the bold formatting)


The need to convert strings to numbers arises very often. For example, if we are getting values from HTML form fields, they are usually strings.
A necessidade de converter strings em números surge frequentemente. Por exemplo, se nós estamos pegando valores de campos de formulário HTML, eles são geralmente strings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "...campos de um formulário HTML,"

(do not include the bold formatting)

```js run
let apples = "2";
let oranges = "3";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "... nós precisamos de converter e então..."

(do not include the bold formatting)

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@LASalvador
Copy link
Author

/done

Copy link
Contributor

@Mr-Saxobeat Mr-Saxobeat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, now we need you complete the translation. Thanks!

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@wnleao
Copy link
Contributor

wnleao commented May 16, 2020

I'm closing this PR due to inactivity. I'm going to update the current translation with respect to the English version and start a new PR with the requested changes.

@wnleao wnleao closed this May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants