Skip to content

Mutation observer #372

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

Conversation

AdriandeCita
Copy link
Contributor

No description provided.

@AdriandeCita
Copy link
Contributor Author

Згадав, що у вас тут було прийнято замість апострофа використовували одинарну праву лапку. Це досі актуально, чи мій "стандартний" апостроф теж згодиться?

@dolgachio
Copy link
Collaborator

@AdriandeCita дякую за переклад, стандартний апостроф підійде :) Дивлюся :)

Copy link
Collaborator

@dolgachio dolgachio left a comment

Choose a reason for hiding this comment

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

Дякую за чудовий переклад!
Подивіться, будь ласка, мої коментарі, напишіть мені, якщо не згодні з чимось :)


`MutationObserver` is a built-in object that observes a DOM element and fires a callback when it detects a change.
`MutationObserver` -- це вбудований об'єкт, який спостерігає за елементом DOM і викликає функцію зворотного виклику кожного разу, коли він помічає зміну.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`MutationObserver` -- це вбудований об'єкт, який спостерігає за елементом DOM і викликає функцію зворотного виклику кожного разу, коли він помічає зміну.
`MutationObserver` -- це вбудований обєкт, який спостерігає за елементом DOM і викликає функцію зворотного виклику кожного разу, коли він помічає зміну.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI, ви пропонуєте замінити стандартний апостроф на символ правої одинарної лапки.
' - https://unicode-table.com/en/0027/
- https://unicode-table.com/en/2019/

Загалом я не проти, просто це виглядає дивним

- `attributes` -- attributes of `node`,
- `attributeFilter` -- an array of attribute names, to observe only selected ones.
- `characterData` -- whether to observe `node.data` (text content),
`config` -- це об'єкт із булевими опціями, які вказують "на якого роду зміни слід реагувати":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`config` -- це об'єкт із булевими опціями, які вказують "на якого роду зміни слід реагувати":
`config` -- це обєкт із булевими опціями, які вказують "на якого роду зміни слід реагувати":


Then after any changes, the `callback` is executed: changes are passed in the first argument as a list of [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) objects, and the observer itself as the second argument.
Далі після будь-яких змін виконується `callback`: зміни передаються першим аргументом у вигляді списку об'єктів типу [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord), а другим аргументом передається сам спостерігач.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Далі після будь-яких змін виконується `callback`: зміни передаються першим аргументом у вигляді списку об'єктів типу [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord), а другим аргументом передається сам спостерігач.
Далі після будь-яких змін виконується `callback`: зміни передаються першим аргументом у вигляді списку обєктів типу [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord), а другим аргументом передається сам спостерігач.


[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) objects have properties:
Об'єкти [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) містять такі властивості:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Об'єкти [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) містять такі властивості:
Обєкти [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) містять такі властивості:

- `target` -- де саме відбулася зміна: для `"attributes"` це елемент, або текстовий вузол у випадку `"characterData"`, або елемент для мутації типу `"childList"`,
- `addedNodes/removedNodes` -- вузли, які було додано/прибрано,
- `previousSibling/nextSibling` -- відповідно попередній та наступний елемент відносно доданих/прибраних вузлів,
- `attributeName/attributeNamespace` -- ім'я/простір імен (для XML) зміненого атрибута,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- `attributeName/attributeNamespace` -- ім'я/простір імен (для XML) зміненого атрибута,
- `attributeName/attributeNamespace` -- імя/простір імен (для XML) зміненого атрибута,


If you run this code, it starts observing the element below and highlighting any code snippets that appear there:
Якщо ви запустите цей код, він почне спостерігати за наведеним нижче елементом, і підсвічувати будь який фрагмент коду, який з'являтиметься там:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Якщо ви запустите цей код, він почне спостерігати за наведеним нижче елементом, і підсвічувати будь який фрагмент коду, який з'являтиметься там:
Якщо ви запустите цей код, він почне спостерігати за наведеним нижче елементом, і підсвічувати будь який фрагмент коду, який зявлятиметься там:

// should be called before disconnecting,
// if you care about possibly unhandled recent mutations
// отримання переліку необроблених мутацій
// повинно викликатись перед роз'єднанням,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// повинно викликатись перед роз'єднанням,
// повинно викликатись перед розєднанням,

@javascript-translate-bot
Copy link
Contributor

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

Co-authored-by: Stanislav <s.dolgachov@gmail.com>
@AdriandeCita
Copy link
Contributor Author

@stas-dolgachov прийняв усі зауваження, окрім лапок. Стосовно них я залишив коментар вище 🙂

@dolgachio
Copy link
Collaborator

Згоден, щодо апострофу. Думаю, ми спробуємо найближчим часом привести все до ладу у цьому питанні якось автоматично :) Дякую, за ваш внесок!

@dolgachio
Copy link
Collaborator

#1

@dolgachio dolgachio changed the title translation: mutation observer Mutation observer Aug 4, 2022
@dolgachio
Copy link
Collaborator

Mutation observer

@dolgachio dolgachio merged commit ddba596 into javascript-tutorial:master Aug 4, 2022
@javascript-translate-bot
Copy link
Contributor

Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉

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

Successfully merging this pull request may close these issues.

3 participants