← Winnitude! Search  ·  Reader Mode (1611 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 57 LINKS

Class inheritance by diogoosz · Pull Request #472 · javascript-tutorial/pt.javascript.info

Repository navigation

Class inheritance - #472


Merged
gabifs merged 2 commits into javascript-tutorial:master from diogoosz:translate-class-inheritance Nov 8, 2026
Merged

Class inheritance #472 gabifs merged 2 commits into javascript-tutorial:master from diogoosz:translate-class-inheritance

Conversation

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 .

Translate 'Class inheritance' article to Portuguese, translate class-... bb555d3
...inheritance-rabbit-animal.svg
gabifs mentioned this pull request Nov 7, 2026 Portuguese Translation Progress #1 Open 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 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 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 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 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 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 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 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
Apply review suggestions from gabifs: revert hand-edited SVG, keep Ch... e0bc9bc
...ild/Parent untranslated

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.

gabifs merged commit d06fc4c into javascript-tutorial : master Nov 8, 2026 1 check passed Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

2 participants