Repository navigation
Conversation
Translates the prose labels in event-order-bubbling.svg and eventflow.svg (the W3C spec's own capturing/target/bubbling phase diagram) via images.yml + gulp pipeline, keeping tag names, song lyrics and musical mode names (Aeolian/Dorian) from the spec's example untouched. The capture.view/both.view/bubble-target.view demos have no other translatable prose. "Bubbling" and "capturing" are kept as established English technical terms in the prose, consistent with common PT-BR dev usage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
| @@ -1 +1 @@ | |||
| <svg xmlns="http://www.w3.org/2000/svg" width="353" height="216" viewBox="0 0 353 216"><defs><style>@import url(https://fonts.googleapis.com/css?family=Open+Sans:bold,italic,bolditalic%7CPT+Mono);@font-face{font-family:'PT Mono';font-weight:700;font-style:normal;src:local('PT MonoBold'),url(/font/PTMonoBold.woff2) format('woff2'),url(/font/PTMonoBold.woff) format('woff'),url(/font/PTMonoBold.ttf) format('truetype')}</style></defs><g id="dom" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><g id="event-order-bubbling.svg"><path id="Rectangle-210" fill="#DBAF88" d="M159.488 140L174 186H60l14.512-46z"/><path id="Rectangle-209" stroke="#91C2A3" stroke-width="18" d="M173.634 81l16.09 51H43.276l16.09-51h114.267z"/><path id="Rectangle-208" stroke="#EFA39F" stroke-width="18" d="M193.014 29l22.71 72H17.276l22.71-72h153.028z"/><path id="Fill-46" fill="#166388" d="M121.5 141v13.816a4.5 4.5 0 11-9 0V141h9zm0-31v13h-9v-13h9zM117 20.53a4.471 4.471 0 013.362 1.3l17.64 17.64a4.5 4.5 0 01-6.364 6.364L121.5 35.698V92h-9V35.7l-10.138 10.136a4.5 4.5 0 11-6.363-6.364l17.639-17.64a4.477 4.477 0 013.363-1.3z"/><text id="1" fill="#643B0C" font-family="PTMono-Bold, PT Mono" font-size="14" font-weight="bold"><tspan x="210" y="105">1</tspan></text><text id="2" fill="#643B0C" font-family="PTMono-Bold, PT Mono" font-size="14" font-weight="bold"><tspan x="185" y="136">2</tspan></text><text id="3" fill="#C06334" font-family="PTMono-Bold, PT Mono" font-size="14" font-weight="bold"><tspan x="157" y="181">3</tspan></text><text id="Most-deeply-nested-e" fill="#AF6E24" font-family="OpenSans-Bold, Open Sans" font-size="14" font-weight="bold"><tspan x="233.48" y="175">Most deeply</tspan> <tspan x="221.306" y="194">nested element</tspan></text><path id="Line-30" stroke="#C06334" stroke-dasharray="3,6" stroke-linecap="square" stroke-width="2" d="M179.5 177.5h30"/></g></g></svg> No newline at end of file | |||
| <svg xmlns="http://www.w3.org/2000/svg" width="353" height="216" viewBox="0 0 353 216"><defs><style>@import url(https://fonts.googleapis.com/css?family=Open+Sans:bold,italic,bolditalic%7CPT+Mono);@font-face{font-family:'PT Mono';font-weight:700;font-style:normal;src:local('PT MonoBold'),url(/font/PTMonoBold.woff2) format('woff2'),url(/font/PTMonoBold.woff) format('woff'),url(/font/PTMonoBold.ttf) format('truetype')}</style></defs><g id="dom" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><g id="event-order-bubbling.svg"><path id="Rectangle-210" fill="#DBAF88" d="M159.488 140L174 186H60l14.512-46z"/><path id="Rectangle-209" stroke="#91C2A3" stroke-width="18" d="M173.634 81l16.09 51H43.276l16.09-51h114.267z"/><path id="Rectangle-208" stroke="#EFA39F" stroke-width="18" d="M193.014 29l22.71 72H17.276l22.71-72h153.028z"/><path id="Fill-46" fill="#166388" d="M121.5 141v13.816a4.5 4.5 0 11-9 0V141h9zm0-31v13h-9v-13h9zM117 20.53a4.471 4.471 0 013.362 1.3l17.64 17.64a4.5 4.5 0 01-6.364 6.364L121.5 35.698V92h-9V35.7l-10.138 10.136a4.5 4.5 0 11-6.363-6.364l17.639-17.64a4.477 4.477 0 013.363-1.3z"/><text id="1" fill="#643B0C" font-family="PTMono-Bold, PT Mono" font-size="14" font-weight="bold"><tspan x="210" y="105">1</tspan></text><text id="2" fill="#643B0C" font-family="PTMono-Bold, PT Mono" font-size="14" font-weight="bold"><tspan x="185" y="136">2</tspan></text><text id="3" fill="#C06334" font-family="PTMono-Bold, PT Mono" font-size="14" font-weight="bold"><tspan x="157" y="181">3</tspan></text><text id="Most-deeply-nested-e" fill="#AF6E24" font-family="OpenSans-Bold, Open Sans" font-size="14" font-weight="bold"><tspan x="224.48" y="175">Elemento mais</tspan> <tspan x="186.306" y="194">profundamente aninhado</tspan></text><path id="Line-30" stroke="#C06334" stroke-dasharray="3,6" stroke-linecap="square" stroke-width="2" d="M179.5 177.5h30"/></g></g></svg> No newline at end of file | |||
There was a problem hiding this comment.
Importante: os arquivos SVG não devem ser editados diretamente. Pelas diretrizes de tradução do projeto, as imagens ficam com o texto original em inglês e a tradução é aplicada automaticamente a partir do images.yml, e as entradas que você adicionou lá já cumprem esse papel.
Com o texto já trocado dentro do SVG, as chaves do images.yml ("Most deeply", "nested element") deixam de ser encontradas, e as próximas atualizações vindas do repositório em inglês vão gerar conflitos neste arquivo.
Sugestão: desfazer as alterações neste arquivo e também em eventflow.svg, mantendo apenas as entradas no images.yml.
| "Target": | ||
| text: "Destino" | ||
| position: left | ||
| "Phase": |
There was a problem hiding this comment.
Importante: na imagem, cada legenda de fase ocupa duas linhas ("Target" / "Phase", "Capture" / "Phase", "Bubbling" / "Phase"). Traduzindo palavra por palavra, o resultado fica "Destino Fase (2)", "Captura Fase (1)" e "Propagação Fase (3)", com a ordem invertida para o português.
Como "Phase" é uma única chave usada nas três legendas, uma possibilidade é colocar o nome completo já na primeira linha ("Fase de destino", "Fase de captura" etc.) e deixar "Phase" com texto vazio, se a ferramenta do images.yml permitir. Vale conferir como a imagem fica depois de gerada.
| "Capture": | ||
| text: "Captura" | ||
| position: left | ||
| "Bubbling": |
There was a problem hiding this comment.
Importante: no artigo o termo foi mantido como "bubbling" ("fase de bubbling"), mas aqui a legenda virou "Propagação". Além da inconsistência, "propagação" é o nome do processo completo, que inclui as três fases: o próprio texto fala em "3 fases de propagação de eventos", e o método se chama stopPropagation. Assim, a legenda passa a dizer algo diferente do original.
Sugestão: usar "Bubbling", como no restante do artigo.
| "Most deeply": | ||
| text: "Elemento mais" | ||
| position: center | ||
| "nested element": |
There was a problem hiding this comment.
Importante: "profundamente aninhado" é bem mais longo que "nested element" e não cabe na imagem. Com fonte de 14px em negrito, o texto passa da largura de 353px do SVG e fica cortado na borda direita.
Sugestão: um texto mais curto, como "Elemento mais" / "aninhado", que também combina com o resumo do artigo ("o elemento mais aninhado").
| text: "profundamente aninhado" | ||
| position: center | ||
| eventflow.svg: | ||
| "Window": |
There was a problem hiding this comment.
Sugestão (opcional): "Window" e "Document" representam os objetos window e document, que no artigo continuam com os nomes originais (por exemplo, "até o objeto document"). Com "Janela" e "Documento", o leitor pode não associar o diagrama a esses objetos.
Sugestão: remover essas duas entradas e manter os nomes originais na imagem.
| - Then the event moves down from the document root to `event.target`, calling handlers assigned with `addEventListener(..., true)` on the way (`true` is a shorthand for `{capture: true}`). | ||
| - Then handlers are called on the target element itself. | ||
| - Then the event bubbles up from `event.target` to the root, calling handlers assigned using `on<event>`, HTML attributes and `addEventListener` without the 3rd argument or with the 3rd argument `false/{capture:false}`. | ||
| - Então o evento se move do raiz do documento para baixo até `event.target`, chamando os manipuladores atribuídos com `addEventListener(..., true)` pelo caminho (`true` é uma forma abreviada de `{capture: true}`). |
There was a problem hiding this comment.
Sugestão (opcional): pequeno erro de concordância: "raiz" é feminino, então o certo é "da raiz" (como já aparece na linha 217, "até a raiz").
| - Então o evento se move do raiz do documento para baixo até `event.target`, chamando os manipuladores atribuídos com `addEventListener(..., true)` pelo caminho (`true` é uma forma abreviada de `{capture: true}`). | |
| - Então o evento se move da raiz do documento para baixo até `event.target`, chamando os manipuladores atribuídos com `addEventListener(..., true)` pelo caminho (`true` é uma forma abreviada de `{capture: true}`). |
|
|
||
| 1. `HTML` -> `BODY` -> `FORM` -> `DIV -> P` (capturing phase, the first listener): | ||
| 2. `P` -> `DIV` -> `FORM` -> `BODY` -> `HTML` (bubbling phase, the second listener). | ||
| 1. `HTML` -> `BODY` -> `FORM` -> `DIV -> P` (fase de captura, o primeiro listener): |
There was a problem hiding this comment.
Sugestão (opcional): a palavra "listener" ficou sem tradução aqui e também nas linhas 185, 187 ("dois listeners") e 195 (título do bloco "Listeners no mesmo elemento..."). O restante do artigo já usa "manipulador".
Sugestão: "ouvinte", ou simplesmente "manipulador" para manter um só termo ao longo do texto.
| Note que `P` aparece duas vezes, porque definimos dois listeners: captura e bubbling. O destino é acionado no final da primeira fase e no início da segunda. | ||
|
|
||
| There's a property `event.eventPhase` that tells us the number of the phase on which the event was caught. But it's rarely used, because we usually know it in the handler. | ||
| Há uma propriedade `event.eventPhase` que nos diz o número da fase em que o evento foi capturado. Mas ela é raramente usada, porque geralmente já a conhecemos no manipulador. |
There was a problem hiding this comment.
Sugestão (opcional): "o evento foi capturado" pode confundir, porque neste artigo "captura" é o nome de uma fase específica. O original diz apenas em qual fase o evento foi recebido, que pode ser qualquer uma das três.
Sugestão: "o número da fase em que o evento foi tratado" (ou "recebido"). O mesmo cuidado vale para "capturar" nas linhas 67 e 112, onde "interceptar" ou "receber" evitaria a ambiguidade.
| @@ -1,24 +1,24 @@ | |||
| # Bubbling and capturing | |||
| # Bubbling e capturing | |||
There was a problem hiding this comment.
Sugestão (opcional): o título mantém "capturing" em inglês, mas no corpo do artigo o termo usado é "captura" ("fase de captura"). Para manter a consistência, sugiro "# Bubbling e captura", e o mesmo na última frase do artigo (linha 233, "Bubbling e capturing são a base...").
- Revert hand-edited SVGs (event-order-bubbling.svg, eventflow.svg)
to their pristine English originals; translation must go through
images.yml only, or future upstream syncs will conflict
- Fix images.yml: shorten the overflowing "nested element" label,
keep "Window"/"Document" untranslated since the article refers to
those objects by their original names, and restructure the
two-line phase captions so the full phrase reads correctly in
Portuguese ("Fase de destino" instead of "Destino"+"Fase")
- Keep "Bubbling" as the loanword used throughout the article instead
of "Propagação", which names the whole process (stopPropagation),
not just one phase
- Use "Bubbling e captura" consistently in the title and summary
instead of mixing in the English "capturing"
- Translate "listener" as "manipulador" for consistency
- Fix "foi capturado" ambiguity (reads as the capture phase) and two
uses of "capturar" that meant "intercept"/"receive", not the
capturing phase specifically
- Fix gender agreement: "da raiz" (raiz is feminine)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Obrigado pela revisão detalhada, @gabifs! Corrigido:
|
|
Obrigado pelas correções, @diogoosz! Ficou muito bom. Só um detalhe sobre os SVGs: conferi e No repositório, os arquivos Pode restaurar os dois arquivos a partir da git checkout <remoto-do-repositório-principal>/master -- 2-ui/2-events/02-bubbling-and-capturing/event-order-bubbling.svg 2-ui/2-events/02-bubbling-and-capturing/eventflow.svgAs entradas novas no |
Per gabifs: SVG files always stay in English in the repo; translation is applied only from images.yml, never by committing a translated file (even one generated by the figuresTranslate pipeline). The images.yml entries added earlier stay as-is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Per gabifs (on PR javascript-tutorial#505/javascript-tutorial#511, same rule applies here): SVG files in the repo always stay identical to the English upstream; translation is applied only from images.yml, never by committing a translated file, whether hand-edited or generated by the figuresTranslate pipeline. This includes two files (metric-client-left-top.svg, metric-client-left-top-rtl.svg) that had been committed translated since before this round of fixes. All images.yml entries, including the label-width fixes from the previous commit, stay as-is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Feito, @gabifs! Restaurei os dois SVGs ( |
Resumo
Traduz o artigo "Bubbling and capturing" para o português.
Traduzi os rótulos em prosa de
event-order-bubbling.svgeeventflow.svg(o diagrama das fases de captura/destino/bubbling tirado diretamente da especificação do W3C) viaimages.yml+ pipeline do gulp. Mantive sem tradução os nomes de tags, a letra da música de exemplo e os nomes de modos musicais (Aeolian/Dorian) usados no exemplo da própria especificação. As demoscapture.view/both.view/bubble-target.viewnão têm mais nenhum texto traduzível além do já ajustado."Bubbling" e "capturing" foram mantidos como termos técnicos em inglês já estabelecidos na prosa, consistente com o uso comum da comunidade dev em PT-BR.
Conforme comentado na #1 (um PR anterior, #441 de @Silas310, foi fechado sem merge - retomando o trabalho).
Plano de teste