Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

lanachayka
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLAassistant commentedJul 24, 2022
edited
Loading

CLA assistant check
All committers have signed the CLA.

@dolgachiodolgachio self-assigned thisAug 4, 2022
@dolgachiodolgachio changed the titletranslate an article: Unicode: flag u and class \p{...}Unicode: flag "u" and class \p{...}Aug 4, 2022
@dolgachio
Copy link
Collaborator

#1

@dolgachiodolgachio added the in progressTranslation in progress labelAug 4, 2022
Copy link
Collaborator

@dolgachiodolgachio left a comment

Choose a reason for hiding this comment

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

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

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

|------------|---------|--------|
| a | `0x0061` | 2 |
| ≈ | `0x2248` | 2 |
|𝒳| `0x1d4b3` | 4 |
|𝒴| `0x1d4b4` | 4 |
|😄| `0x1f604` | 4 |

So characters like`a`and `≈` occupy 2bytes, while codes for `𝒳`, `𝒴`and `😄`are longer, they have 4 bytes.
Таким чином, такі символи, як`a`і `≈`, займають 2байти, а коди для `𝒳`, `𝒴`і `😄`довші, в них - 4 байти.
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
Таким чином, такі символи, як`a` і``, займають 2 байти, а коди для`𝒳`,`𝒴` і`😄` довші, в них - 4 байти.
Таким чином, такі символи, як`a` і``, займають 2 байти, а коди для`𝒳`,`𝒴` і`😄` довші, в них -- 4 байти.


Long time ago, whenJavaScript language was created, Unicode encoding was simpler: there were no 4-byte characters. So, some language features still handle them incorrectly.
Коли створювалась моваJavaScript, кодування Юнікод було простіше: 4-байтвоих символів не існувало. Тому досі деякі функції мови все ще обробляють їх неправильно.
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, кодування Юнікод було простіше: 4-байтвоих символів не існувало. Тому досі деякі функції мови все ще обробляють їх неправильно.
Коли створювалась мова JavaScript, кодування Юнікод було простіше: 4-байтових символів не існувало. Тому досі деякі функції мови все ще обробляють їх неправильно.


```js run
alert('😄'.length); // 2
alert('𝒳'.length); // 2
```
...Але ми бачимо, що лише один, правда ж? Річ у тому, що властивість `length` трактує 4 байти, як два символи по 2 байти. Це не правильно, адже їх необхідно розглядати тільки разом (так звана "сурогатна пара", детальніше у розділі <info:string>).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Перенесіть, будь ласка, цей текст на наступний рядок. У перекладі має бути стільки ж рядків, як і в оригінальній статті. Це необхідно щоб у майбутньому синхронізувати зміни.


...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>.
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
За замовчуванням регулярні вирази також розглядають 4-байтові«довгі символи» як пару 2-байтових. Як і у випадку з рядками, це може призвести до дивних результатів. Ми побачимо це трохи пізніше, у розділі<info:regexp-character-sets-and-ranges>.
За замовчуванням регулярні вирази також розглядають 4-байтові"довгі символи" як пару 2-байтових. Як і у випадку з рядками, це може призвести до дивних результатів. Ми побачимо це трохи пізніше, у розділі<info:regexp-character-sets-and-ranges>.


## Unicode properties \p{...}
Кожен символ в кодуванні Юнікод має багато властивостей. Вони описують, до якої «категорії» належить символ та містять різну інформацію про нього.
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
Кожен символ в кодуванні Юнікод має багато властивостей. Вони описують, до якої«категорії» належить символ та містять різну інформацію про нього.
Кожен символ в кодуванні Юнікод має багато властивостей. Вони описують, до якої"категорії" належить символ та містять різну інформацію про нього.

- `Hex_Digit` містить шістнадцяткові числа: `0-9`, `a-f`.
- ...І так далі.

Юнікод підтримує велику кількість властивостей, і їхній повний перелік потребував би дуже багато місця, тому ось посилання.
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
Юнікод підтримує велику кількість властивостей, і їхній повний перелікпотребував би дуже багато місця, тому ось посилання.
Юнікод підтримує велику кількість властивостей, і їхній повний переліквимагав би дуже багато місця, тому ось посилання:


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)).
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
Нам допоможе властивість Юнікоду -`Script` (система письма), яка може мати значення:`Cyrillic`(Кирилиця),`Greek` (Грецька),`Arabic` (Арабська),`Han` (Китайська) та інші,[тут повний перелік](https://en.wikipedia.org/wiki/Script_(Unicode)).
Нам допоможе властивість Юнікоду --`Script` (система письма), яка може мати значення:`Cyrillic`(Кирилиця),`Greek` (Грецька),`Arabic` (Арабська),`Han` (Китайська) та інші,[тут повний перелік](https://en.wikipedia.org/wiki/Script_(Unicode)).

  - не призначенні `Cn`,
- для приватного користування `Co`,
- сурогат `Cs`.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Додайте тут, будь ласка, пустий рядок як було в оригінальній статті. Це потрібно знову ж таки для сумісності з англійським варіантом.

@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 👻

@lanachayka
Copy link
ContributorAuthor

/done

@dolgachio
Copy link
Collaborator

@all-contributors please add@lanachayka for translate

@allcontributors
Copy link
Contributor

@stas-dolgachov

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

@dolgachio
Copy link
Collaborator

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

@dolgachio
Copy link
Collaborator

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

@dolgachio
Copy link
Collaborator

@all-contributors please add@lanachayka for translation

@allcontributors
Copy link
Contributor

@stas-dolgachov

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

@javascript-translate-bot
Copy link
Contributor

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dolgachiodolgachiodolgachio approved these changes

Assignees

@dolgachiodolgachio

Labels
in progressTranslation in progressneeds +1
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@lanachayka@CLAassistant@dolgachio@javascript-translate-bot@ruslana-pidsadiuk-telus

[8]ページ先頭

©2009-2025 Movatter.jp