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
|
|
dolgachio commented Aug 4, 2022
Copy link Copy Markdown
Collaborator
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.mdOutdated
| |😄| `0x1f604` | 4 | | ||
|
|
||
| So characters like `a` and `≈` occupy 2 bytes, while codes for `𝒳`, `𝒴` and `😄` are longer, they have 4 bytes . | ||
| Таким чином, такі символи, як `a` і `≈` , займають 2 байти, а коди для `𝒳`, `𝒴` і `😄` довші, в них - 4 байти . |
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-байтвоих символів не існувало. Тому досі деякі функції мови все ще обробляють їх неправильно . |
| alert('😄'.length); // 2 | ||
| alert('𝒳'.length); // 2 | ||
| ``` | ||
| ...Але ми бачимо, що лише один, правда ж? Річ у тому, що властивість `length` трактує 4 байти, як два символи по 2 байти. Це не правильно, адже їх необхідно розглядати тільки разом (так звана "сурогатна пара", детальніше у розділі <info:string>). |
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> . |
Outdated
| ## Властивості Юнікоду \p{...} | ||
|
|
||
| ## Unicode properties \p{...} | ||
| Кожен символ в кодуванні Юнікод має багато властивостей. Вони описують, до якої «категорії» належить символ та містять різну інформацію про нього. |
Outdated
| - `Hex_Digit` містить шістнадцяткові числа: `0-9`, `a-f`. | ||
| - ...І так далі. | ||
|
|
||
| Юнікод підтримує велику кількість властивостей, і їхній повний перелік потребував би дуже багато місця, тому ось посилання. |
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)). |
| - не призначенні `Cn`, | ||
| - для приватного користування `Co`, | ||
| - сурогат `Cs`. | ||
|
|
javascript-translate-bot commented Oct 12, 2022
Copy link Copy Markdown
Contributor
|
Please make the requested changes. After it, add a comment "/done". |
update text after review
6f66886
lanachayka commented Oct 12, 2022
Copy link Copy Markdown
Contributor
Author
|
/done |
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? |
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 |
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 ! 🎉 |
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 🎉 🎉 🎉 |