GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Promise by diogoosz · Pull Request #465 · javascript-tutorial/pt.javascript.info

Conversation

@diogoosz

@diogoosz diogoosz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Tradução do artigo "Promise" para o português, incluindo os três exercícios.

Conforme comentado na #1.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@diogoosz
Translate 'Promise' article to Portuguese
51b642e
@CLAassistant

CLAassistant commented Nov 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/02-promise-basics/article.md Outdated
Assim como existe uma cláusula `finally` em um `try {...} catch {...}` comum, existe `finally` em promises também.

The call `.finally(f)` is similar to `.then(f, f)` in the sense that `f` runs always, when the promise is settled: be it resolve or reject.
A chamada `.finally(f)` é parecida com `.then(f, f)`, no sentido de que `f` sempre roda quando a promise é resolvida (settled): seja em `resolve` ou `reject`.

@gabifs gabifs Nov 7, 2026

Copy link
Copy Markdown
Contributor

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.

Aqui "settled" foi traduzido como "resolvida", mas o próprio artigo já usa "resolvida" para o caso de sucesso (resolve/fulfilled). Na linha 84 temos "Uma promise que foi resolvida ou rejeitada é chamada de settled", então quem lê pode entender que o finally só roda quando a promise dá certo.

Sugiro escolher uma palavra exclusiva para "settled", como "finalizada" ou "concluída", e usar a mesma em todo o artigo. O mesmo problema aparece em:

  • linha 234 (comentário no código: "roda quando a promise é resolvida, não importa se com sucesso ou não", que acaba se contradizendo)
  • linha 286 ("promises já resolvidas")
  • linha 289

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/11-async/02-promise-basics/article.md Outdated
Resumindo, o executor deve realizar um trabalho (geralmente algo que leva tempo) e então chamar `resolve` ou `reject` para mudar o estado da promise correspondente.

A promise that is either resolved or rejected is called "settled", as opposed to an initially "pending" promise.
Uma promise que foi resolvida ou rejeitada é chamada de "settled" (encerrada/resolvida), em contraste com uma promise inicialmente "pending" (pendente).

@gabifs gabifs Nov 7, 2026

Copy link
Copy Markdown
Contributor

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.

O glossário "settled (encerrada/resolvida)" dá duas opções, e "resolvida" já tem outro significado no artigo. Que tal deixar só um termo (ex.: "finalizada") para não confundir com o caso de sucesso?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/11-async/02-promise-basics/article.md Outdated
// assim o indicador de carregamento sempre é parado antes de continuarmos
*/!*
.then(result => show result, err => show error)
.then(resultado => mostra o resultado, erro => mostra o erro)

@gabifs gabifs Nov 7, 2026

Copy link
Copy Markdown
Contributor

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.

Os nomes dos parâmetros foram traduzidos (resultado, erro), mas a convenção do projeto é não traduzir nomes de variáveis ou funções no código. Sugestão:

.then(result => mostra o resultado, err => mostra o erro)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/11-async/02-promise-basics/article.md Outdated
![](promise-resolve-1.svg)

That was an example of a successful job completion, a "fulfilled promise".
Esse foi um exemplo de uma conclusão de trabalho bem-sucedida, uma "promise cumprida" (fulfilled).

@gabifs gabifs Nov 7, 2026

Copy link
Copy Markdown
Contributor

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.

O estado de sucesso aparece com três nomes diferentes: "cumprida" (aqui), "resolvida" (em outras partes do artigo) e "fulfilled". Seria bom padronizar um único termo para facilitar a leitura.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/11-async/02-promise-basics/article.md Outdated
A chamada `.finally(f)` é parecida com `.then(f, f)`, no sentido de que `f` sempre roda quando a promise é resolvida (settled): seja em `resolve` ou `reject`.

The idea of `finally` is to set up a handler for performing cleanup/finalizing after the previous operations are complete.
A ideia do `finally` é configurar um handler para fazer a limpeza/finalização depois que as operações anteriores forem concluídas.

@gabifs gabifs Nov 7, 2026

Copy link
Copy Markdown
Contributor

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 palavra "handler" ficou em inglês ao longo do texto (mais de 15 ocorrências, entre as linhas 221 e 327). O capítulo seguinte (03-promise-chaining) já usa "tratador"/"tratadores". Que tal seguir o mesmo termo para manter a consistência entre os capítulos?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/11-async/02-promise-basics/article.md Outdated
3. A *promise* is a special JavaScript object that links the "producing code" and the "consuming code" together. In terms of our analogy: this is the "subscription list". The "producing code" takes whatever time it needs to produce the promised result, and the "promise" makes that result available to all of the subscribed code when it's ready.
1. Um "código produtor" que faz alguma coisa e leva um tempo pra isso. Por exemplo, algum código que carrega dados pela rede. Esse é o "cantor".
2. Um "código consumidor" que quer o resultado do "código produtor" assim que ele estiver pronto. Várias funções podem precisar desse resultado. Esses são os "fãs".
3. Uma *promise* é um objeto especial do JavaScript que liga o "código produtor" e o "código consumidor". Em termos da nossa analogia: essa é a "lista de inscrição". O "código produtor" leva o tempo que precisar para produzir o resultado prometido, e a "promise" disponibiliza esse resultado para todo o código inscrito assim que ele estiver pronto.

@gabifs gabifs Nov 7, 2026

Copy link
Copy Markdown
Contributor

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.

Pergunta sobre o termo: aqui o texto mantém "promise" em inglês, mas o capítulo 03-promise-chaining usa "promessa". Vale alinhar os dois capítulos, seja qual for a escolha, para o leitor não achar que são coisas diferentes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/11-async/02-promise-basics/article.md Outdated
|----------|-----------|
| Promises allow us to do things in the natural order. First, we run `loadScript(script)`, and `.then` we write what to do with the result. | We must have a `callback` function at our disposal when calling `loadScript(script, callback)`. In other words, we must know what to do with the result *before* `loadScript` is called. |
| We can call `.then` on a Promise as many times as we want. Each time, we're adding a new "fan", a new subscribing function, to the "subscription list". More about this in the next chapter: [](info:promise-chaining). | There can be only one callback. |
| Promises nos permitem fazer as coisas na ordem natural. Primeiro, rodamos `loadScript(script)`, e `.then` escrevemos o que fazer com o resultado. | Precisamos ter uma função `callback` disponível ao chamar `loadScript(script, callback)`. Em outras palavras, precisamos saber o que fazer com o resultado *antes* de `loadScript` ser chamado. |

@gabifs gabifs Nov 7, 2026

Copy link
Copy Markdown
Contributor

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 inglês funciona o trocadilho com "then", mas "e .then escrevemos o que fazer" não fica natural em português. Sugestão:

"Rodamos loadScript(script), e depois (.then) escrevemos o que fazer com o resultado."

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/11-async/02-promise-basics/02-delay-promise/task.md Outdated
// seu código
}

delay(3000).then(() => alert('runs after 3 seconds'));

@gabifs gabifs Nov 7, 2026

Copy link
Copy Markdown
Contributor

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.

O comentário // seu código foi traduzido, mas a string ficou em inglês. Strings podem ser traduzidas. Sugestão:

delay(3000).then(() => alert('roda depois de 3 segundos'));

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@diogoosz
Apply review suggestions from gabifs
0a7d6b8
@diogoosz

diogoosz commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Obrigado pela revisão, @gabifs! Apliquei tudo:

  • Padronizei "settled" como "estabelecida" e o estado de sucesso como "resolvida" (removi "cumprida"), em todo o artigo, pra não confundir os dois conceitos.
  • Troquei "handler" por "tratador"/"tratadores" em todo o artigo, alinhando com o 03-promise-chaining.
  • Troquei "promise" (substantivo comum) por "promessa" em todo o artigo e nos exercícios, mantendo Promise/new Promise como estão quando é o nome da classe/identificador no código.
  • Reverti os nomes dos parâmetros no exemplo do finally pra result/err (nomes de variável não devem ser traduzidos).
  • Corrigi o trocadilho do "then" pra algo mais natural em português.
  • Troquei a string em inglês no exercício do delay por "roda depois de 3 segundos".
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gabifs
gabifs merged commit c8abd97 into javascript-tutorial:master Nov 7, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@gabifs gabifs mentioned this pull request Nov 7, 2026
Portuguese Translation Progress #1
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gabifs gabifs gabifs left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@diogoosz @CLAassistant @gabifs
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.