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 API by diogoosz · Pull Request #468 · javascript-tutorial/pt.javascript.info

Conversation

@diogoosz

@diogoosz diogoosz commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Tradução do artigo "Promise API" para o português.

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 API' article to Portuguese
ca5795a
@gabifs gabifs mentioned this pull request Nov 7, 2026
Portuguese Translation Progress #1
Open
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated

````smart header="`Promise.all(iterable)` allows non-promise \"regular\" values in `iterable`"
Normally, `Promise.all(...)` accepts an iterable (in most cases an array) of promises. But if any of those objects is not a promise, it's passed to the resulting array "as is".
````smart header="`Promise.all(iterable)` permite valores "normais" (não promessas) no `iterable`"

@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.

As aspas internas do header não estão escapadas. O original usava \"regular\", e o resto do repositório também escapa assim (header="Não exitem regras \"você deve\" "). Sem o escape, o atributo termina em permite valores e o título da caixa smart aparece cortado ou quebrado.

Suggested change
````smart header="`Promise.all(iterable)` permite valores "normais" (não promessas) no `iterable`"
````smart header="`Promise.all(iterable)` permite valores \"normais\" (não promessas) no `iterable`"

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
let requests = urls.map(url => fetch(url));

// Promise.all waits until all jobs are resolved
// Promise.all espera até que todas os trabalhos sejam resolvidos

@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.

Erro de concordância: todas os trabalhos deveria ser todos os trabalhos.

Suggested change
// Promise.all espera até que todas os trabalhos sejam resolvidos
// Promise.all espera até que todos os trabalhos sejam resolvidos

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
## Promise.any

Similar to `Promise.race`, but waits only for the first fulfilled promise and gets its result. If all of the given promises are rejected, then the returned promise is rejected with [`AggregateError`](mdn:js/AggregateError) - a special error object that stores all promise errors in its `errors` property.
Parecido com o `Promise.race`, mas espera apenas pela primeira promessa resolvida e pega o resultado dela. Se todas as promessas dadas forem rejeitadas, então a promessa retornada é rejeitada com [`AggregateError`](mdn:js/AggregateError) - um objeto de erro especial que guarda todos os erros das promessas na sua propriedade `errors`.

@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 fulfilled virou "resolvida", a mesma palavra usada para resolved e para Promise.resolve ("cria uma promessa resolvida"). Só que o estado literal é "fulfilled", e uma promessa resolvida com outra promessa ainda pendente não está fulfilled. Isso também acontece nas linhas 240 e 317 (value (se resolvida)). Sugestão: usar um termo próprio, como "realizada" ou "cumprida", ou deixar fulfilled entre parênteses.

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
```

So for each promise we get its status and `value/error`.
Então, para cada promessa, obtemos o status e o `value`/`error` dela.

@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.

value/error era um único trecho de código. Dividido em `value`/`error`, ele passa a impressão de que existe uma propriedade error. Na verdade a propriedade é reason (como na lista acima). Sugestão: `value`/`reason` ou manter "o valor/erro".

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
## Promise.all

Let's say we want many promises to execute in parallel and wait until all of them are ready.
Digamos que queremos que várias promessas sejam executadas em paralelo e esperar até que todas estejam prontas.

@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.

Falta paralelismo na frase: "queremos que ... sejam executadas ... e esperar" junta uma oração no subjuntivo com um infinitivo. Sugestão: "Digamos que queremos executar várias promessas em paralelo e esperar até que todas estejam prontas."

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
# API do Promise

There are 6 static methods in the `Promise` class. We'll quickly cover their use cases here.
Existem 6 métodos estáticos na classe `Promise`. Vamos cobrir rapidamente os seus casos de uso aqui.

@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.

"cobrir" (de cover) é um anglicismo. O CLAUDE.md pede "Natural translation over literal". "Abordar" soa mais natural. Isso se repete nas linhas 99, 259 e 261.

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
fetch('/style.css'),
fetch('/data.json')
]).then(render); // render method needs results of all fetches
]).then(render); // o método render precisa dos resultados de todos os fetches

@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 CLAUDE.md diz: "avoid using foreign words". fetches é um substantivo em inglês no plural. Sugestão: "precisa dos resultados de todas as requisições".

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
- `value` (se resolvida) ou `reason` (se rejeitada).
3. `Promise.race(promises)` -- espera que a primeira promessa seja estabelecida, e o resultado/erro dela se torna o resultado final.
4. `Promise.any(promises)` (método adicionado recentemente) -- espera que a primeira promessa seja resolvida, e o resultado dela se torna o resultado final. Se todas as promessas dadas forem rejeitadas, [`AggregateError`](mdn:js/AggregateError) se torna o erro do `Promise.any`.
5. `Promise.resolve(value)` -- faz uma promessa resolvida com o valor dado.

@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.

Inconsistência: aqui está "faz uma promessa resolvida" (e "faz uma promessa rejeitada" na linha 321), mas antes o texto usa "cria uma promessa resolvida/rejeitada". "cria" fica mais natural e mantém a consistência.

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
@@ -1,40 +1,40 @@
# Promise API
# API do Promise

@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 título mistura Promise (masculino, nome da classe) com o corpo do texto, que traduz promise como "promessa". A linha 99 repete a forma "API do Promise". Uma opção mais consistente é "API de Promise" / "API de promessas".

Sorry, something went wrong.

Uh oh!

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

All reactions
gabifs
gabifs reviewed Nov 7, 2026
View reviewed changes
Comment thread 1-js/11-async/05-promise-api/article.md Outdated
Repare que a ordem dos membros do array resultante é a mesma das promessas de origem. Mesmo que a primeira promessa leve o maior tempo para ser resolvida, ela continua sendo a primeira no array de resultados.

A common trick is to map an array of job data into an array of promises, and then wrap that into `Promise.all`.
Um truque comum é mapear um array de dados de trabalho em um array de promessas, e então envolver isso em um `Promise.all`.

@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.

"dados de trabalho" é uma tradução literal de job data e fica estranha. Sugestão: "um array de dados de tarefas" ou "um array de dados".

Sorry, something went wrong.

Uh oh!

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

All reactions
@diogoosz
Apply review suggestions from gabifs
c3549b9
@diogoosz

diogoosz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Obrigado, @gabifs! Apliquei tudo: escapei as aspas do header, corrigi concordância, usei "cumprida" exclusivamente pra "fulfilled" (distinto de "resolvida"), corrigi value/reason, ajustei o paralelismo da frase, troquei "cobrir"→"abordar" e "fetches"→"requisições", padronizei "cria uma promessa", e troquei o título pra "API de Promise" pra não misturar gênero.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gabifs
gabifs merged commit 10dd00c into javascript-tutorial:master Nov 8, 2026
1 check passed

Uh oh!

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

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.

2 participants

@diogoosz @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 01402503 — 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.