-
Notifications
You must be signed in to change notification settings - Fork 112
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
Logical operators #56
Conversation
Sync with the original
Start to translate the article
There are some grammar erros
Fix grammar errors and some expressions translations
Just deleted the english version I was using to translate
Error: the article already has PR number in the Progress Issue #1, it's 55 |
I'm sorry, I didn't know that I should commit to the older pull request #55 . |
There was a problem hiding this 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`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "...está
entre ono intervalo fechado de14
-e-a90
."
|
||
--- | ||
|
||
# A question about "if" | ||
# A questão sobre "if" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "
AUma 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "alert( '
CanceladoCancelada' );" in all - "...
identaçõesindentaçõ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ê.". |
There was a problem hiding this comment.
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.". |
There was a problem hiding this comment.
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`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "...está
entre ono intervalo fechado de14
-e-a90
."
@@ -1,12 +1,11 @@ | |||
The first variant: | |||
A primeira variação: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "A primeira
variaçãovariante:"
``` | ||
|
||
The second variant: | ||
A segunda variação: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "A segunda
variaçãovariante:"
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "Crie duas
variaçõesvariantes: ..."
|
||
We can use OR `||`: | ||
Nós podemos usar OU `||`: | ||
|
||
```js run | ||
let currentUser = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "Nós podemos usar
OUOR||
:"
Please make the requested changes. After it, add a comment "/done". |
Hi @Mr-Saxobeat you're still on this? |
Hello @odsantos, I would like to collaborate. I saw that this topic is stopped from a long time. Thank you! |
Hi @herbertpdl we'd appreciate it if you could translate Thank you. |
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? |
Still interested in translation? |
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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`. |
There was a problem hiding this comment.
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 ..."
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
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
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. |
Please make the requested changes. After it, add a comment "/done". |
@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
|
@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. |
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.
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. |
Translate article, tasks and solutions.