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 — Class inheritance by diogoosz · Pull Request #472 · javascript-tutorial/pt.javascript.info

Conversation

@diogoosz

@diogoosz diogoosz commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Tradução do artigo "Class inheritance" para o português, incluindo os 2 exercícios e a tradução do diagrama class-inheritance-rabbit-animal.svg.

Conforme comentado na #1.

Sorry, something went wrong.

Uh oh!

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

All reactions
@diogoosz
Translate 'Class inheritance' article to Portuguese, translate class-…
bb555d3
…inheritance-rabbit-animal.svg
@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 images.yml Outdated
"I love":
"text": "Eu amo"
"position": "center"
class-inheritance-rabbit-animal.svg:

@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 SVG class-inheritance-rabbit-animal.svg foi traduzido duas vezes: o texto foi editado direto no arquivo .svg e também foi adicionada esta entrada no images.yml. Como o SVG já não contém mais "methods of Animal", "methods of Rabbit" nem "properties of rabbit", as chaves desta entrada não batem com nada no arquivo, e a edição direta do SVG vai gerar conflito na próxima sincronização com o repositório original em inglês. O CLAUDE.md do projeto diz: "SVG text translations are defined in images.yml at repository root." Sugestão: reverter a alteração no .svg e manter só esta entrada no images.yml.

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/09-classes/02-class-inheritance/class-inheritance-rabbit-animal.svg Outdated
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="198" height="258" viewBox="0 0 198 258"><defs><style>@import url(https://fonts.googleapis.com/css?family=Open+Sans:bold,italic,bolditalic%7CPT+Mono);@font-face{font-family:&apos;PT Mono&apos;;font-weight:700;font-style:normal;src:local(&apos;PT MonoBold&apos;),url(/font/PTMonoBold.woff2) format(&apos;woff2&apos;),url(/font/PTMonoBold.woff) format(&apos;woff&apos;),url(/font/PTMonoBold.ttf) format(&apos;truetype&apos;)}</style></defs><g id="inheritance" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><g id="class-inheritance-rabbit-animal.svg"><path id="Rectangle-1" fill="#FBF2EC" stroke="#DBAF88" stroke-width="2" d="M11 128h179v28H11z"/><text id="methods-of-Rabbit" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="19" y="146">methods of Rabbit</tspan></text><text id="Rabbit.prototype" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="10" y="120">Rabbit.prototype</tspan></text><text id="rabbit" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="10" y="213">rabbit</tspan></text><path id="Rectangle-1" fill="#FBF2EC" stroke="#DBAF88" stroke-width="2" d="M11 21h179v28H11z"/><text id="methods-of-Animal" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="19" y="38">methods of Animal</tspan></text><text id="Animal.prototype" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="10" y="13">Animal.prototype</tspan></text><path id="Rectangle-1" fill="#FBF2EC" stroke="#DBAF88" stroke-width="2" d="M11 222h179v28H11z"/><path id="Line" fill="#C06334" fill-rule="nonzero" d="M70.5 167.5l7 14h-6v28h-2v-28h-6l7-14z"/><path id="Line-2" fill="#C06334" fill-rule="nonzero" d="M70.5 62.5l7 14h-6v28h-2v-28h-6l7-14z"/><text id="[[Prototype]]" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="80" y="86">[[Prototype]]</tspan></text><text id="[[Prototype]]-Copy" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="80" y="190">[[Prototype]]</tspan></text><text id="properties-of-rabbit" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="19" y="239">properties of rabbit</tspan></text></g></g></svg> No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="198" height="258" viewBox="0 0 198 258"><defs><style>@import url(https://fonts.googleapis.com/css?family=Open+Sans:bold,italic,bolditalic%7CPT+Mono);@font-face{font-family:&apos;PT Mono&apos;;font-weight:700;font-style:normal;src:local(&apos;PT MonoBold&apos;),url(/font/PTMonoBold.woff2) format(&apos;woff2&apos;),url(/font/PTMonoBold.woff) format(&apos;woff&apos;),url(/font/PTMonoBold.ttf) format(&apos;truetype&apos;)}</style></defs><g id="inheritance" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><g id="class-inheritance-rabbit-animal.svg"><path id="Rectangle-1" fill="#FBF2EC" stroke="#DBAF88" stroke-width="2" d="M11 128h179v28H11z"/><text id="methods-of-Rabbit" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="19" y="146">métodos de Rabbit</tspan></text><text id="Rabbit.prototype" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="10" y="120">Rabbit.prototype</tspan></text><text id="rabbit" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="10" y="213">rabbit</tspan></text><path id="Rectangle-1" fill="#FBF2EC" stroke="#DBAF88" stroke-width="2" d="M11 21h179v28H11z"/><text id="methods-of-Animal" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="19" y="38">métodos de Animal</tspan></text><text id="Animal.prototype" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="10" y="13">Animal.prototype</tspan></text><path id="Rectangle-1" fill="#FBF2EC" stroke="#DBAF88" stroke-width="2" d="M11 222h179v28H11z"/><path id="Line" fill="#C06334" fill-rule="nonzero" d="M70.5 167.5l7 14h-6v28h-2v-28h-6l7-14z"/><path id="Line-2" fill="#C06334" fill-rule="nonzero" d="M70.5 62.5l7 14h-6v28h-2v-28h-6l7-14z"/><text id="[[Prototype]]" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="80" y="86">[[Prototype]]</tspan></text><text id="[[Prototype]]-Copy" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="80" y="190">[[Prototype]]</tspan></text><text id="properties-of-rabbit" fill="#AF6E24" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal"><tspan x="11" y="239">propriedades de rabbit</tspan></text></g></g></svg> No newline at end of file

@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 texto "propriedades de rabbit" (22 caracteres em PT Mono 14px, ~8,4px por caractere, cerca de 185px) foi movido para x="11", mas o retângulo vai de x=11 a x=190. O texto começa em cima da borda esquerda e termina por volta de x=196, passando da borda direita. "métodos de Animal/Rabbit" cabem; este não. Além disso, nenhum artigo referencia este SVG (grep por class-inheritance-rabbit-animal.svg só encontra o próprio arquivo), então a tradução não aparece em lugar nenhum. Os SVGs que o artigo usa (rabbit-animal-independent-animal.svg, animal-rabbit-extends.svg, this-super-loop.svg, super-homeobject-wrong.svg) só têm código. Dá para reverter este arquivo.

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/09-classes/02-class-inheritance/article.md Outdated
Como coelhos são animais, a classe `Rabbit` deveria ser baseada em `Animal`, ter acesso aos métodos de animal, para que coelhos possam fazer o que animais "genéricos" conseguem fazer.

The syntax to extend another class is: `class Child extends Parent`.
A sintaxe para estender outra classe é: `class Filha extends Pai`.

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

class Child extends Parent virou class Filha extends Pai, e o mesmo aconteceu no Resumo (linhas 688-693: Filha.prototype.__proto__, Pai.prototype, "construtor de Filha", "método de Pai"). Isso traduz nomes de classe dentro de código, e o CLAUDE.md do projeto diz: "Don't translate code: You should not translate variable or function names". Os gêneros também não combinam ("Filha" é feminino e "Pai" é masculino). Sugestão: manter Child/Parent dentro dos trechos de código e traduzir só o texto ao redor.

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/09-classes/02-class-inheritance/article.md Outdated

````smart header="Arrow functions have no `super`"
As was mentioned in the chapter <info:arrow-functions>, arrow functions do not have `super`.
````smart header="Funções arrow não têm `super`"

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

"Funções arrow" (aqui, nas linhas 160 e 242 e no Resumo, linha 701) não segue o termo que o resto do tutorial já usa: 1-js/02-first-steps/17-arrow-functions-basics tem o título "Funções seta, o básico" e 1-js/06-advanced-functions/12-arrow-functions usa "Arrow Functions (funções seta)". O CLAUDE.md também pede "avoid using foreign words". Sugestão: usar "funções seta" em todo o artigo.

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/09-classes/02-class-inheritance/article.md
@@ -611,17 +611,17 @@ rabbit.eat(); // Error calling super (because there's no [[HomeObject]])
*/!*

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

Na linha 610, logo acima, o comentário // Error calling super (because there's no [[HomeObject]]) ficou em inglês. Diferente de // Unexpected super, que é a mensagem real do motor, a parte entre parênteses é uma explicação e deveria ser traduzida, por exemplo: // Erro ao chamar super (porque não existe [[HomeObject]]).

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/09-classes/02-class-inheritance/2-clock-class-extended/task.md Outdated
# Relógio estendido

We've got a `Clock` class. As of now, it prints the time every second.
Temos uma classe `Clock`. Até agora, ela imprime a hora a cada segundo.

@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 of now" quer dizer "atualmente/por enquanto". "Até agora" passa a ideia de que algo vai mudar ou já mudou.

Suggested change
Temos uma classe `Clock`. Até agora, ela imprime a hora a cada segundo.
Temos uma classe `Clock`. Por enquanto, ela imprime a hora a cada segundo.

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/09-classes/02-class-inheritance/2-clock-class-extended/task.md Outdated
[js src="source.view/clock.js"]

Create a new class `ExtendedClock` that inherits from `Clock` and adds the parameter `precision` -- the number of `ms` between "ticks". Should be `1000` (1 second) by default.
Crie uma nova classe `ExtendedClock` que herda de `Clock` e adiciona o parâmetro `precision` -- o número de `ms` entre os "ticks". Deve ser `1000` (1 segundo) por padrão.

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

"ticks" ficou em inglês. O CLAUDE.md do projeto pede "avoid using foreign words". Sugestão: "tiques" (ou "batidas").

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/09-classes/02-class-inheritance/article.md Outdated
class Rabbit extends Animal {
stop() {
setTimeout(() => super.stop(), 1000); // call parent stop after 1sec
setTimeout(() => super.stop(), 1000); // chama o stop do pai depois de 1seg

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

"1seg" não é uma abreviação padrão (o símbolo do SI é "s").

Suggested change
setTimeout(() => super.stop(), 1000); // chama o stop do pai depois de 1seg
setTimeout(() => super.stop(), 1000); // chama o stop do pai depois de 1 segundo

Sorry, something went wrong.

Uh oh!

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

All reactions
@diogoosz
Apply review suggestions from gabifs: revert hand-edited SVG, keep Ch…
e0bc9bc
…ild/Parent untranslated
@diogoosz

diogoosz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Obrigado pela revisão detalhada, @gabifs! Revertei o SVG editado à mão e removi a entrada órfã do images.yml (já que a imagem nem é referenciada pelo artigo). Também desfiz o "Filha"/"Pai" — voltei pra Child/Parent em todos os trechos de código, já que isso viola a regra de não traduzir identificadores (e nem fazia sentido com os gêneros). Troquei "Funções arrow" por "funções seta" (alinhando com os outros capítulos), traduzi o comentário explicativo que tinha ficado em inglês, e corrigi "1seg"→"1 segundo", "As of now"→"Por enquanto", e "ticks"→"tiques" no exercício.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gabifs
gabifs merged commit d06fc4c 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.