Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Conditional branching: if, '?'#246

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

jonnathan-ls
Copy link
Contributor

@jonnathan-lsjonnathan-ls commentedJun 29, 2022
edited
Loading

Conditional branching: if, '?'

📝Goal

Article translation

☑ What was done?

  • Translation of the article
  • Translation of the exercises
  • Translation of the SVG image

@javascript-translate-botjavascript-translate-bot requested a review froma teamJune 29, 2022 03:31
@jonnathan-lsjonnathan-ls changed the titleWIP: Conditional branching: if, '?'WIP Conditional branching: if, '?'Jun 29, 2022
@jonnathan-ls
Copy link
ContributorAuthor

🚧 work in progress

@jonnathan-lsjonnathan-ls changed the titleWIP Conditional branching: if, '?'Conditional branching: if, '?'Jul 7, 2022
@jonnathan-ls
Copy link
ContributorAuthor

✅ Ready for review

Copy link
Contributor

@odsantosodsantos left a comment

Choose a reason for hiding this comment

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

Hi, Please fell free to tell where you disagree. Thanks, Osvaldo.

---

#if (astring with zero)
#f (uma “string” com zero)
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
#f (uma “string” com zero)
#if (uma “string” com zero)

Usando a construção`if..else`, escreva o código que pergunta: 'Qual é o nome "oficial" do JavaScript?'

If the visitor enters "ECMAScript",then output "Right!",otherwise--output: "You don't know? ECMAScript!"
Se o visitante digitar "ECMAScript",então chame a função alerta passando como valor: "correto!",caso contrário--registre a seguinte mensagem: "Você não sabe? ECMAScript!"
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 o visitante digitar "ECMAScript", então chame a funçãoalerta passando como valor: "correto!", caso contrário -- registre a seguinte mensagem: "Você não sabe? ECMAScript!"
Se o visitante digitar "ECMAScript", então chame a função`alert` passando como valor: "Correto!", caso contrário -- registre a seguinte mensagem: "Você não sabe? ECMAScript!"

---

#Show the sign
#Mostra o sinal
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
#Mostra o sinal
#Mostre o sinal

-`0`,if equals zero.
-`1`,se o valor for maior que zero,
-`-1`,se menor que zero,
-`0`,se for igual a zero.
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
-`0`, seforigual a zero.
-`0`, se igual a zero.

#Ramificação condicional: if, '?'

Sometimes, we need to perform different actions based on different conditions.
Às vezes, precisamos realizar ações diferentes com base em condições diferentes.
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
Às vezes, precisamos realizar ações diferentes com base em condições diferentes.
Às vezes, precisamosderealizar ações diferentes com base em condições diferentes.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Não acho que a preposiçãode se encaixa corretamente entre a expressãoprecisamos realizar

Avaliando a tradução literal:

image

The so-called "conditional" or "question mark" operator lets us do that in a shorter and simpler way.
O chamado operador "condicional" ou "ponto de interrogação" nos permite fazer isso de uma forma curta e simples.

O operador é representado por um ponto de interrogação`?`. Às vezes referênciado como "ternário", porque o operador possui três operandos. Na verdade, é o único operador em JavaScript que possui tantos. Na verdade, é o único operador em JavaScript que possui tantas possibilidades de operandos.
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
O operador é representado por um ponto de interrogação`?`. Às vezesreferênciado como"ternário", porque o operador possui três operandos. Na verdade, é o único operador em JavaScript que possui tantos.Na verdade, é o único operador em JavaScript que possui tantas possibilidades de operandos.
O operador é representado por um ponto de interrogação`?`. Às vezesé chamado de"ternário", porque o operador possui três operandos. Na verdade, é o único operador em JavaScript que possui tantos.


```js run no-beautify
let company=prompt('Which company created JavaScript?','');
let company=prompt('Qual empresa criou o JavaScript?','');
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
let company = prompt('Qual empresa criou o JavaScript?', '');
let company = prompt('Que empresa criou o JavaScript?', '');

**Não é recomendado usar o operador de ponto de interrogação dessa maneira.**

The notation is shorter than the equivalent`if`statement, which appeals to some programmers. But it is less readable.
A notação é mais curta do que a instrução`if`equivalente, que atrai alguns programadores. Mas é menos 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.

Suggested change
A notação é mais curta do que a instrução`if` equivalente, que atrai alguns programadores. Mas é menos legível.
A notação é mais curta do que a instrução`if` equivalente,oque atrai alguns programadores. Mas é menos legível.


```js run no-beautify
let company=prompt('Which company created JavaScript?','');
let company=prompt('Qual empresa criou o JavaScript?','');
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
let company = prompt('Qual empresa criou o JavaScript?', '');
let company = prompt('Que empresa criou o JavaScript?', '');

Nossos olhos escaneiam o código verticalmente. Blocos de código que abrangem várias linhas são mais fáceis de entender do que um conjunto de instruções longo e horizontal.

The purpose of the question mark operator`?`is to return one value or another depending on its condition. Pleaseuse it for exactly that. Use`if`when you need to execute different branches of code.
O objetivo do operador de ponto de interrogação`?`é retornar um valor ou outro dependendo de sua condição. Por favor,use-o exatamente para isso. Use`if`quando precisar executar diferentes ramificações de código.
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
O objetivo do operador de ponto de interrogação`?` é retornar um valor ou outro dependendo de sua condição. Por favor, use-o exatamente para isso. Use`if` quando precisar executar diferentes ramificações de código.
O objetivo do operador de ponto de interrogação`?` é retornar um valor ou outro dependendo de sua condição. Por favor, use-o exatamente para isso. Use`if` quando precisardeexecutar diferentes ramificações de código.

Copy link
ContributorAuthor

@jonnathan-lsjonnathan-lsMar 26, 2023
edited
Loading

Choose a reason for hiding this comment

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

Semelhante ahttps://github.com/javascript-tutorial/pt.javascript.info/pull/246/files#r1148666022

Sem a preposição fica o mais próximo da tradução literal:

image

@javascript-translate-bot

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

@odsantos
Copy link
Contributor

Hi@jonnathan-ls ,

I updated to the English version.
As part of the pending tasks could you also resolve the conflicts?

Thanks,
Osvaldo.

@jonnathan-ls
Copy link
ContributorAuthor

Hi@jonnathan-ls ,

I updated to the English version. As part of the pending tasks could you also resolve the conflicts?

Thanks, Osvaldo.

@odsantos conflitos resolvidos.

@jonnathan-ls
Copy link
ContributorAuthor

jonnathan-ls commentedMar 26, 2023
edited
Loading

Hi, Please fell free to tell where you disagree. Thanks, Osvaldo.

@odsantos
Correções realizadas.

Apenas algumas sugestões relacionadas a preposição "de", pois entendo que fica um pouco estranho para o leitor.

@jonnathan-ls
Copy link
ContributorAuthor

/done

@nazarepiedady
Copy link
Member

@jonnathan-ls have you time to update this translation and correct its conflicts?

@jonnathan-ls
Copy link
ContributorAuthor

@jonnathan-ls have you time to update this translation and correct its conflicts?

Sure, I'll do it on the weekend

nazarepiedady reacted with heart emoji

@nazarepiedady
Copy link
Member

@jonnathan-ls I also recommend looking at all your pull requests to see what more needs to be done to let the pull request fine be applied.

jonnathan-ls reacted with thumbs up emoji

@jonnathan-ls
Copy link
ContributorAuthor

Conflicts resolved@nazarepiedady

@odsantos awaiting analysis of the corrections I made according to your review

@nazarepiedady
Copy link
Member

@jonnathan-ls Are all reviews requested by@odsantos resolved?

@jonnathan-ls
Copy link
ContributorAuthor

Are all reviews requested by@odsantos resolved?

Yes, i am waiting his to review again

@jonnathan-ls
Copy link
ContributorAuthor

/done

@nazarepiedadynazarepiedady merged commita1de0f9 intojavascript-tutorial:masterDec 23, 2023
@javascript-translate-bot

Thank you 💖 I updated the Progress Issue#1 🎉 🎉 🎉

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@odsantosodsantosodsantos requested changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@jonnathan-ls@javascript-translate-bot@odsantos@nazarepiedady

[8]ページ先頭

©2009-2025 Movatter.jp