Translate "WeakRef and FinalizationRegistry" by diogoosz · Pull Request #491 · javascript-tutorial/pt.javascript.info
Repository navigation
Translate "WeakRef and FinalizationRegistry" - #491
Merged
gabifs merged 2 commits into javascript-tutorial:master from diogoosz:translate-weakref-finalizationregistry Nov 13, 2026
Merged
Translate "WeakRef and FinalizationRegistry" #491 gabifs merged 2 commits into javascript-tutorial:master from diogoosz:translate-weakref-finalizationregistry
Conversation
diogoosz commented Nov 9, 2026 · edited Loading
Copy link Copy Markdown
Contributor
Resumo
- Traduz o artigo "WeakRef and FinalizationRegistry" (
1-js/99-js-misc/07-weakref-finalizationregistry/article.md). - Traduz as strings voltadas ao usuário nas duas demos interativas embutidas (
weakref-dom.view/,weakref-finalizationregistry.view/): rótulos de botão, títulos, placeholders, mensagens de log/console. Identificadores de código, nomes de classe e as tags de evento de logFETCHED_IMAGE/CACHED_IMAGE/CLEANED_IMAGE/FETCHED_FAILEDforam deliberadamente deixados sem tradução, já que são usados como tags literais na prosa e no código do artigo.
Nota sobre os diagramas SVG
Os 5 diagramas (weakref-finalizationregistry-01.svg a -05.svg) usam uma estrutura interna de SVG diferente da dos diagramas traduzidos em PRs anteriores: atributos style inline com posicionamento via transform="matrix(...)", em vez de elementos <tspan> com atributos separados de font-family/x. O pipeline de tradução via images.yml + gulp (imageYaml/figuresTranslate) não consegue extrair texto dessa estrutura (a extração retorna resultados vazios ou quase vazios para os 5 arquivos). Seguindo a convenção do projeto de nunca editar SVGs manualmente, essas imagens foram deixadas sem tradução. O único texto narrativo perdido com isso é "WeakRef object" (arquivos 03/04/05) e "Deleted by FinalizationRegistry cleanup callback" (arquivo 05); todo o resto nesses SVGs são identificadores de código/dados que ficariam sem tradução de qualquer forma.
Plano de teste
- Diff de todos os trechos de código (code spans) entre o original em inglês e a tradução (só a string de log
heldValue, traduzida de propósito, é diferente). - Grep em busca de falsos cognatos conhecidos (eventualmente/travar/cobrir/atualmente/realizar).
- Releitura manual completa para checar sentido e concordância de gênero/número.
- Verificação dos novos links da Wikipédia (Gato de Schrödinger em pt.wikipedia.org; mantive o link de array associativo apontando para en.wikipedia.org, já que não existe artigo em pt.wikipedia.org).
Conforme comentado na #1 .
Translate "WeakRef and FinalizationRegistry" article
fdc5ba9
Translates the article text and the two embedded interactive demos (weakref-dom.view, weakref-finalizationregistry.view). The 5 SVG diagrams (weakref-finalizationregistry-01..05.svg) use a different internal structure (inline style attr + matrix transforms, no tspan) that the images.yml/gulp translation pipeline cannot parse, so they are left untranslated rather than hand-edited. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>diogoosz mentioned this pull request Nov 9, 2026 Portuguese Translation Progress #1 Open gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/99-js-misc/07-weakref-finalizationregistry/article.md
| Isso acontece para cada imagem selecionada : | ||
| </br><br> | ||
|
|
||
|  |
View reviewed changes
Comment thread 1-js/99-js-misc/07-weakref-finalizationregistry/weakref-finalizationregistry.view/utils.js
Outdated
| const logEl = document.createElement("div"); | ||
| logEl.classList.add("logger-item", "logger--error"); | ||
| logEl.innerHTML = `CLEANED_IMAGE: Url : ${imgName}, Size : ${size}, Type : ${type}`; | ||
| logEl.innerHTML = `CLEANED_IMAGE: URL : ${imgName}, Tamanho : ${size}, Tipo : ${type}`; |
View reviewed changes
Comment thread 1-js/99-js-misc/07-weakref-finalizationregistry/weakref-dom.view/index.html
| <meta charset="utf-8"> | ||
| <link rel="stylesheet" href="index.css"> | ||
| <title> WeakRef DOM Logger </title> | ||
| <title> Logger DOM com WeakRef </title> |
View reviewed changes
Comment thread 1-js/99-js-misc/07-weakref-finalizationregistry/weakref-finalizationregistry.view/index.html
| <meta charset="utf-8"> | ||
| <link rel="stylesheet" href="index.css"> | ||
| <title> Photo Library Collage </title> | ||
| <title> Colagem da Biblioteca de Fotos </title> |
View reviewed changes
Comment thread 1-js/99-js-misc/07-weakref-finalizationregistry/article.md
Outdated
| ```js | ||
| // When the user object is deleted by the garbage collector, the following message will be printed in the console: | ||
| "John has been collected by the garbage collector ." | ||
| // Quando o objeto user é excluído pelo coletor de lixo, a seguinte mensagem será exibida na console: |
View reviewed changes
Comment thread 1-js/99-js-misc/07-weakref-finalizationregistry/article.md
Outdated
|
|
||
| Paying attention to the output in the console, you can see, which of the photos were downloaded from the cloud - this is indicated by <span style="background-color:#133159;color:white;font-weight:500">FETCHED_IMAGE</span>. | ||
| Since this is the first attempt to create a collage, this means, that at this stage the "weak cache " was still empty, and all the photos were downloaded from the cloud and put in it . | ||
| Observando a saída na console, você pode ver quais das fotos foram baixadas da nuvem - isso é indicado por <span style="background-color:#133159;color:white;font-weight:500">FETCHED_IMAGE</span>. |
View reviewed changes
Comment thread 1-js/99-js-misc/07-weakref-finalizationregistry/article.md
Outdated
| To increase page loading speed, it would be reasonable to download and display photo thumbnails in *compressed* quality . | ||
| But, to create a collage from selected photos, download and use them in *full-size* quality. | ||
| Para aumentar a velocidade de carregamento da página, seria razoável baixar e exibir as miniaturas das fotos em qualidade *comprimida* . | ||
| Mas, para criar uma colagem a partir das fotos selecionadas, baixá-las e usá-las em qualidade *tamanho real*. |
Apply review feedback from @gabifs
cea5b53
- "na console" -> "no console" (console is masculine in pt-BR), 2 occurrences - Fix awkward "em qualidade *tamanho real*" phrasing - Set lang="pt-BR" on the two .view demo HTML files - Revert the Url/Size/Type console log labels in utils.js back to English, matching the demo screenshots (which are raster images and can't be translated), to avoid the live demo diverging from what the article's screenshots show - Add a note disclosing the demo screenshots are untranslated raster images Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
diogoosz commented Nov 13, 2026
Copy link Copy Markdown
Contributor
Author
|
Obrigado, @gabifs ! Apliquei tudo: "na console"→"no console" (2x), corrigi a frase "em qualidade tamanho real ", |
b243a25
into
javascript-tutorial : master
Nov 13, 2026
1 check passed
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment