Skip to content

Logical operators #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed

Logical operators #56

wants to merge 9 commits into from

Conversation

Mr-Saxobeat
Copy link
Contributor

Translate article, tasks and solutions.

@javascript-translate-bot

Error: the article already has PR number in the Progress Issue #1, it's 55 ⁉️

@Mr-Saxobeat
Copy link
Contributor Author

Mr-Saxobeat commented Sep 19, 2019

Error: the article already has PR number in the Progress Issue #1, it's 55 ⁉️

@iliakan What should I do? I've already closed the #55 because I forgot to translate the tasks that before.

@Mr-Saxobeat
Copy link
Contributor Author

I'm sorry, I didn't know that I should commit to the older pull request #55 .

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.

Here is the review.


Write an `if` condition to check that `age` is NOT between 14 and 90 inclusively.
Escreva uma condição `if` para verificar se `idade` NÃO está entre o intervalo fechado `14` e `90`.

Copy link
Contributor

Choose a reason for hiding this comment

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

  • "...está entre o no intervalo fechado de 14 -e- a 90."


---

# A question about "if"
# A questão sobre "if"

Copy link
Contributor

Choose a reason for hiding this comment

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

  • "A Uma questão sobre..."

}
```

Note the vertical indents inside the `if` blocks. They are technically not required, but make the code more readable.
Note as identações verticais dentro dos blocos de `if`s. Tecnicamente, elas não são necessárias, mas fazem o código mais legível.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • "alert( 'Cancelado Cancelada' );" in all
  • "...identações indentações verticais..."


If the visitor enters `"Admin"`, then `prompt` for a password, if the input is an empty line or `key:Esc` -- show "Canceled.", if it's another string -- then show "I don't know you".
Se o visitante digitar `"Admin"`, então faça `prompt` para a senha, se a entrada é uma linha vazia ou `key:Esc` -- mostre "Cancelado.", se for qualquer outra string -- então mostre "Eu não conheço você.".
Copy link
Contributor

Choose a reason for hiding this comment

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

  • "...faça prompt para uma senha,".
  • "...mostre "Cancelado." "Cancelada." "

- For an empty string or cancelled input, show "Canceled."
- Se for igual a "TheMaster", então mostre "Bem vindo!",
- Qualquer outra string -- mostre "Senha incorreta",
- Para uma string vazia ou cancelada, mostre "Cancelado.".
Copy link
Contributor

Choose a reason for hiding this comment

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

  • "Para uma string vazia ou entrada cancelada, mostre "Cancelado." "Cancelada." "


Write an "if" condition to check that `age` is between `14` and `90` inclusively.
Escreva uma condição "if" para verificar se `idade` está entre o intervalo fechado `14` e `90`.

Copy link
Contributor

Choose a reason for hiding this comment

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

  • "...está entre o no intervalo fechado de 14 -e- a 90."

@@ -1,12 +1,11 @@
The first variant:
A primeira variação:

Copy link
Contributor

Choose a reason for hiding this comment

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

  • "A primeira variação variante:"

```

The second variant:
A segunda variação:

Copy link
Contributor

Choose a reason for hiding this comment

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

  • "A segunda variação variante:"


Create two variants: the first one using NOT `!`, the second one -- without it.
Crie duas variações: a primeira usando NÃO `!`, e uma segunda -- sem ele.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • "Crie duas variações variantes: ..."


We can use OR `||`:
Nós podemos usar OU `||`:

```js run
let currentUser = null;
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 podemos usar OU OR ||:"

@javascript-translate-bot

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

@CLAassistant
Copy link

CLAassistant commented May 15, 2020

CLA assistant check
All committers have signed the CLA.

@odsantos
Copy link
Contributor

Hi @Mr-Saxobeat you're still on this?
If so, could please also resolve the conflicts?
Thank you.

@herbertpdl
Copy link

Hello @odsantos, I would like to collaborate. I saw that this topic is stopped from a long time.
Could I start for this one?

Thank you!

@odsantos
Copy link
Contributor

Hi @herbertpdl we'd appreciate it if you could translate Thank you.

@jonnathan-ls
Copy link
Contributor

This PR has been open for a long time and there has been no progress on the requested review.

Before evaluating what will be done with this demand:

@Mr-Saxobeat: are you still interested in continuing the translation? If so, please check the notes recorded in the requested code review by @odsantos, after correction, I will carry out my review.

@herbertpdl: if MrSaxobeat, not interested or not responding, would you like to do a translation?

@jonnathan-ls
Copy link
Contributor

@Mr-Saxobeat @herbertpdl

Still interested in translation?
Or can I mark it as closed?

Copy link
Contributor

@jonnathan-ls jonnathan-ls left a comment

Choose a reason for hiding this comment

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

Segue minha revisão!


Although they are called "logical", they can be applied to values of any type, not only boolean. Their result can also be of any type.
Embora eles sejam chamados de "lógicos", podem ser aplicados a valores de qualquer tipo, não apenas a boolean. Seus resultados também podem ser de qualquer tipo.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Embora eles sejam chamados de "lógicos", podem ser aplicados a valores de qualquer tipo, não apenas a boolean. Seus resultados também podem ser de qualquer tipo.
Embora eles são denominados como "lógicos", podem ser aplicados a valores de qualquer tipo, não apenas ao tipo `boolean`. Seus resultados também podem ser de qualquer tipo.


```js
result = a || b;
```

In classical programming, the logical OR is meant to manipulate boolean values only. If any of its arguments are `true`, it returns `true`, otherwise it returns `false`.
Em programação clássica, o operador OU é mencionado para manipular apenas valores booleanos. Se qualquer um dos seus argumentos for `true`, ele retorna `true`, se não, retorna `false`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Complementando a sugestão do @odsantos em ", o operador lógico OU é mencionado utilizado para manipular ..."

Suggested change
Em programação clássica, o operador OU é mencionado para manipular apenas valores booleanos. Se qualquer um dos seus argumentos for `true`, ele retorna `true`, se não, retorna `false`.
Em programação clássica, o operador OU é utilizado para manipular apenas valores do tipo `boolean`. Se qualquer um dos seus argumentos for `true`, ele retorna `true`, se não, retorna `false`.


In JavaScript, the operator is a little bit trickier and more powerful. But first, let's see what happens with boolean values.
Em JavaScript, este operador é um pouco mais útil e poderoso. Mas primeiro, vamos ver o que acontece com valores booleanos.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Em JavaScript, este operador é um pouco mais útil e poderoso. Mas primeiro, vamos ver o que acontece com valores booleanos.
Em JavaScript, este operador é um pouco mais útil e poderoso. Mas primeiro, vamos ver o que acontece com valores do tipo `boolean`.


If an operand is not a boolean, it's converted to a boolean for the evaluation.
Se um operando não é um boolean, ele é convertido em um boolean para ser avaliado.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Se um operando não é um boolean, ele é convertido em um boolean para ser avaliado.
Se um operando não é um `boolean`, ele é convertido em um `boolean` para ser avaliado.


In other words, a chain of OR `"||"` returns the first truthy value or the last one if no such value is found.
Em outras palavras, uma cadeia de OU `"||"` retorna o primeiro valor verdadeiro ou o último se nenhum `true` for encontrado.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Em outras palavras, uma cadeia de OU `"||"` retorna o primeiro valor verdadeiro ou o último se nenhum `true` for encontrado.
Em outras palavras, uma cadeia de OU `"||"`, retorna o primeiro valor verdadeiro ou o último se nenhum `true` for encontrado.


As we can see, such a use case is a "shorter way of doing `if`". The first operand is converted to boolean. If it's false, the second one is evaluated.
Como podemos ver, esse caso é como "uma maneira mais curta de se usar `if`". O primeiro operando é convertido para boolean. Se for false, o segundo operando é avaliado.
Copy link
Contributor

Choose a reason for hiding this comment

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

Complementando a sugestão do @odsantos em Dec 17, 2019

Suggested change
Como podemos ver, esse caso é como "uma maneira mais curta de se usar `if`". O primeiro operando é convertido para boolean. Se for false, o segundo operando é avaliado.
Como podemos ver, este caso é como "uma maneira mais curta de se usar `if`". O primeiro operando é convertido para o tipo `boolean`. Se for `false`, o segundo operando é avaliado.

@javascript-translate-bot

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

@jonnathan-ls
Copy link
Contributor

jonnathan-ls commented Mar 11, 2023

@odsantos adicionei minha revisão também.

Considerando que este PR e bastante antigo e como não tivemos retorno do @Mr-Saxobeat, pensei em utilizar a tradução realizada, corrigir as sugestões que solicitamos e realizar o commit diretamente neste PR, o que acha ?

Tudo bem realizarmos desta maneira ?

@odsantos
Copy link
Contributor

@jonnathan-ls I agree. Probably we could resolve the conflicts, revise each other, or have another maintainer joined to this PR, and have it merged when at least two maintainers see the translation ready for that.

@jonnathan-ls jonnathan-ls mentioned this pull request Apr 17, 2023
@jonnathan-ls
Copy link
Contributor

English

Considering that this PR is abandoned and the branch that the user used in the merge creation is no longer available so that it would be possible to contribute directly, a new PR #401 was opened replicating the existing translation in this PR with the corrections of the revision suggestions presented.

Therefore, we are closing this PR.

Portuguese

Considerando que este PR está abandonado e a branch que o usuário utilizou na criação do merge não está mais disponível para que fosse possível contribuir diretamente, foi aberto um novo PR #401 replicando a tradução existente neste PR com as correções das sugestões de revisão apresentadas

Portanto, estamos dando como encerrado este PR.

@jonnathan-ls jonnathan-ls added wontfix This will not be worked on and removed changes requested labels Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants