Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototypal inheritance #230

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

flaviohblima
Copy link
Contributor

Prototypal inheritance

flaviohblima and others added 3 commits October 30, 2021 21:08
- Tasks 'importance';
- Trocar 'setar' por 'configurar';
- Translate strings in code;
Copy link
Contributor

@odsantos odsantos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @flaviohblima ,

Here is a review.
Please, feel free to leave a note where you might disagree.

Thank you,
Osvaldo.

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

flaviohblima and others added 19 commits February 26, 2022 20:22
@flaviohblima
Copy link
Contributor Author

/done

@odsantos
Copy link
Contributor

Hi @flaviohblima ,

Still working in this one?
There is a conflict here.

Please, let me know if you haven't time and I might be able to resolve it.

Thanks,
Osvaldo.

@flaviohblima
Copy link
Contributor Author

Hi @odsantos ,

Sorry I could not resolve this pull request.
I might work in some translations soon.

In any case, feel free to resolve the conflicts and close it.

Team work is always quickier!

Thank you,
Flávio.

@odsantos
Copy link
Contributor

Hi @flaviohblima ,

I'll try to resolve the conflicts but keep it open.
Probably, it can be reviewed by others maintainers, as well, and get merged.

Thank you,
Osvaldo.

@nazarepiedady
Copy link
Member

@Peruibeloko, @jonnathan-ls, do you have time to see what is possible to do in relation to this pull request?

Copy link
Contributor

@Peruibeloko Peruibeloko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parece bastante coisa, mas na verdade são só alterações pequenas e pedidos de tradução do código.

Acredito que seja importante traduzir os nomes usados nos exemplos do artigo, já que o tópico pode ser de difícil compreensão para iniciantes


In programming, we often want to take something and extend it.
Na programação, nós sempre queremos extender algum comportamento.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Na programação, nós sempre queremos extender algum comportamento.
Na programação, é comum querermos extender algum comportamento.

Comment on lines +2 to +4
1. `true`, obtido de `rabbit`.
2. `null`, obtido de `animal`.
3. `undefined`, essa propriedade não existe mais.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. `true`, obtido de `rabbit`.
2. `null`, obtido de `animal`.
3. `undefined`, essa propriedade não existe mais.
1. `true`, obtido de `coelho`.
2. `null`, obtido de `animal`.
3. `undefined`, essa propriedade não existe mais.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traduzir as variáveis

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traduzir o código

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traduzir o código


For that reason `admin.fullName` works correctly in the code below:
Por essa razão, `admin.fullName` funciona corretamente no código abaixo:

```js run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traduzir o código


The call `rabbit.sleep()` sets `this.isSleeping` on the `rabbit` object:
A chamada de `rabbit.sleep()` configura `this.isSleeping` no objeto `rabbit`:

```js run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traduzir o resto do código


For instance:
Por exemplo:

```js run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traduzir o código


```smart header="Almost all other key/value-getting methods ignore inherited properties"
Almost all other key/value-getting methods, such as `Object.keys`, `Object.values` and so on ignore inherited properties.
```smart header="Quase todas as outras chaves/métodos *obtém-valor* ignoram propriedades herdadas."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```smart header="Quase todas as outras chaves/métodos *obtém-valor* ignoram propriedades herdadas."
```smart header="Quase todos os métodos que obtém valores a partir de chaves ignoram propriedades herdadas."

- If we call `obj.method()`, and the `method` is taken from the prototype, `this` still references `obj`. So methods always work with the current object even if they are inherited.
- The `for..in` loop iterates over both its own and its inherited properties. All other key/value-getting methods only operate on the object itself.
- No Javascript, todos os objetos possuem uma propriedade `[[Prototype]]` escondida que ou é um objeto ou é `null`.
- Nós podemos usar `obj.__proto__` para acessá-lo (um histórico getter/setter, mas já existem alternativas, que veremos em breve).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Nós podemos usar `obj.__proto__` para acessá-lo (um histórico getter/setter, mas já existem alternativas, que veremos em breve).
- Nós podemos usar `obj.__proto__` para acessá-lo (um getter/setter mantido historicamente, mas já existem alternativas, que veremos em breve).

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@nazarepiedady
Copy link
Member

@Peruibeloko, I was talking about to edit this pull request and approved if possible.

@Peruibeloko
Copy link
Contributor

@nazarepiedady I believe the repo is write protected, but it I'll see what I can do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants