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

Unicode: flag "u" and class \p{...} by lanachayka · Pull Request #374 · javascript-tutorial/uk.javascript.info

Repository navigation

Unicode: flag "u" and class \p{...} - #374


Merged
dolgachio merged 2 commits into javascript-tutorial:master from lanachayka:regexpUnicode Oct 12, 2022
Merged

Unicode: flag "u" and class \p{...} #374 dolgachio merged 2 commits into javascript-tutorial:master from lanachayka:regexpUnicode

Conversation

lanachayka commented Jul 24, 2022



Copy link Copy Markdown
Contributor

No description provided.

translate an article: Unicode: flag u and class \p{...} c1c7a99 javascript-translate-bot added the review needed label Jul 24, 2022

CLAassistant commented Jul 24, 2022 · edited Loading



Copy link Copy Markdown


All committers have signed the CLA.

dolgachio self-assigned this Aug 4, 2022 dolgachio changed the title translate an article: Unicode: flag u and class \p{...} Unicode: flag "u" and class \p{...} Aug 4, 2022

dolgachio commented Aug 4, 2022



Copy link Copy Markdown
Collaborator

#1

dolgachio added the in progress Translation in progress label Aug 4, 2022 dolgachio requested changes Oct 12, 2022
View reviewed changes

dolgachio left a comment



Copy link Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Дякую, за чудовий переклад! Вибачаюсь, що так довго перевіряв.
Наступного разу все буде набагато швидше =)

Внесіть, будь ласка, зміни про які я написав. Якщо будуть питання, напишіть мені :)

Comment thread 9-regular-expressions/03-regexp-unicode/article.md
Outdated
|😄| `0x1f604` | 4 |

So characters like `a` and `≈` occupy 2 bytes, while codes for `𝒳`, `𝒴` and `😄` are longer, they have 4 bytes .
Таким чином, такі символи, як `a` і `≈` , займають 2 байти, а коди для `𝒳`, `𝒴` і `😄` довші, в них - 4 байти .
Comment thread 9-regular-expressions/03-regexp-unicode/article.md
Outdated
Таким чином, такі символи, як `a` і `≈` , займають 2 байти, а коди для `𝒳`, `𝒴` і `😄` довші, в них - 4 байти .

Long time ago, when JavaScript language was created, Unicode encoding was simpler: there were no 4-byte characters. So, some language features still handle them incorrectly .
Коли створювалась мова JavaScript , кодування Юнікод було простіше: 4-байтвоих символів не існувало. Тому досі деякі функції мови все ще обробляють їх неправильно .
Comment thread 9-regular-expressions/03-regexp-unicode/article.md
alert('😄'.length); // 2
alert('𝒳'.length); // 2
```
...Але ми бачимо, що лише один, правда ж? Річ у тому, що властивість `length` трактує 4 байти, як два символи по 2 байти. Це не правильно, адже їх необхідно розглядати тільки разом (так звана "сурогатна пара", детальніше у розділі <info:string>).
Comment thread 9-regular-expressions/03-regexp-unicode/article.md
Outdated
...Але ми бачимо, що лише один, правда ж? Річ у тому, що властивість `length` трактує 4 байти, як два символи по 2 байти. Це не правильно, адже їх необхідно розглядати тільки разом (так звана "сурогатна пара", детальніше у розділі <info:string>).

...But we can see that there's only one, right? The point is that `length` treats 4 bytes as two 2-byte characters. That's incorrect, because they must be considered only together (so-called "surrogate pair", you can read about them in the article <info: string>) .
За замовчуванням регулярні вирази також розглядають 4-байтові «довгі символи» як пару 2-байтових. Як і у випадку з рядками, це може призвести до дивних результатів. Ми побачимо це трохи пізніше, у розділі <info: regexp-character-sets-and-ranges> .
Comment thread 9-regular-expressions/03-regexp-unicode/article.md
Outdated
## Властивості Юнікоду \p{...}

## Unicode properties \p{...}
Кожен символ в кодуванні Юнікод має багато властивостей. Вони описують, до якої «категорії» належить символ та містять різну інформацію про нього.
Comment thread 9-regular-expressions/03-regexp-unicode/article.md
Outdated
- `Hex_Digit` містить шістнадцяткові числа: `0-9`, `a-f`.
- ...І так далі.

Юнікод підтримує велику кількість властивостей, і їхній повний перелік потребував би дуже багато місця, тому ось посилання.
Comment thread 9-regular-expressions/03-regexp-unicode/article.md
Outdated
Пошукаймо китайські ієрогліфи .

There's a Unicode property `Script` ( a writing system ), that may have a value : `Cyrillic`, `Greek`, `Arabic`, `Han` ( Chinese) and so on , [ here's the full list ](https://en.wikipedia.org/wiki/Script_(Unicode)).
Нам допоможе властивість Юнікоду - `Script` ( система письма ), яка може мати значення : `Cyrillic` (Кирилиця) , `Greek` (Грецька) , `Arabic` (Арабська) , `Han` ( Китайська) та інші , [ тут повний перелік ](https://en.wikipedia.org/wiki/Script_(Unicode)).
Comment thread 9-regular-expressions/03-regexp-unicode/article.md
  - не призначенні `Cn`,
- для приватного користування `Co`,
- сурогат `Cs`.

javascript-translate-bot added changes requested and removed review needed labels Oct 12, 2022

javascript-translate-bot commented Oct 12, 2022



Copy link Copy Markdown
Contributor

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

update text after review 6f66886

lanachayka commented Oct 12, 2022



Copy link Copy Markdown
Contributor

Author

/done

javascript-translate-bot added review needed and removed changes requested labels Oct 12, 2022

dolgachio commented Oct 12, 2022



Copy link Copy Markdown
Collaborator

@all-contributors please add @lanachayka for translate

allcontributors
Bot
commented Oct 12, 2022



Copy link Copy Markdown
Contributor

@stas-dolgachov

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names .

dolgachio commented Oct 12, 2022



Copy link Copy Markdown
Collaborator

https://github.com/all-contributors please add @lanachayka for translate

dolgachio commented Oct 12, 2022



Copy link Copy Markdown
Collaborator

https://github.com/all-contributors please add @lanachayka for translation

dolgachio commented Oct 12, 2022



Copy link Copy Markdown
Collaborator

@all-contributors please add @lanachayka for translation

allcontributors
Bot
mentioned this pull request Oct 12, 2022 docs: add lanachayka as a contributor for translation #394 Merged

allcontributors
Bot
commented Oct 12, 2022



Copy link Copy Markdown
Contributor

@stas-dolgachov

I've put up a pull request to add @lanachayka ! 🎉

dolgachio approved these changes Oct 12, 2022
View reviewed changes
javascript-translate-bot added needs +1 and removed review needed labels Oct 12, 2022 dolgachio merged commit b9ee395 into javascript-tutorial : master Oct 12, 2022 javascript-translate-bot mentioned this pull request Oct 12, 2022 Ukrainian Translation Progress #1 Open

javascript-translate-bot commented Oct 12, 2022



Copy link Copy Markdown
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

in progress Translation in progress needs +1

5 participants