-
Notifications
You must be signed in to change notification settings - Fork 386
Translation List and keys #64
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
content/docs/lists-and-keys.md
Outdated
|
||
Let's assign a `key` to our list items inside `numbers.map()` and fix the missing key issue. | ||
Добавим `key` к нашему списку элементов внутри `numbers.map()` и поправим проблему его отсутствия. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
проблему его отсутствия
слишком сложно звучит
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaearon а можно совет как лучше? В оригинале написано так:
and fix the missing key issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чтобы исправить проблему с неуказанными ключами, добавим каждому элементу в списке атрибут key
.
content/docs/lists-and-keys.md
Outdated
|
||
Let's assign a `key` to our list items inside `numbers.map()` and fix the missing key issue. | ||
Добавим `key` к нашему списку элементов внутри `numbers.map()` и поправим проблему его отсутствия. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чтобы исправить проблему с неуказанными ключами, добавим каждому элементу в списке атрибут key
.
341c5fc
to
34117f5
Compare
content/docs/lists-and-keys.md
Outdated
|
||
Below, we loop through the `numbers` array using the JavaScript [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) function. We return a `<li>` element for each item. Finally, we assign the resulting array of elements to `listItems`: | ||
Ниже, мы проходим по массиву `numbers`, используя функцию JavaScript [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map), и возвращаем элемент `<li>` в каждой итерации. Получившийся массив элементов мы сохраним в `listItems`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ниже, мы
Лишняя запятая
content/docs/lists-and-keys.md
Outdated
|
||
### Keys Must Only Be Unique Among Siblings {#keys-must-only-be-unique-among-siblings} | ||
### Ключи должны быть уникальными среди соседей {#keys-must-only-be-unique-among-siblings} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Siblings
соседей
Может быть, одноуровневыми элементами?
content/docs/lists-and-keys.md
Outdated
@@ -44,13 +44,13 @@ ReactDOM.render( | |||
|
|||
[**Try it on CodePen**](https://codepen.io/gaearon/pen/GjPyQr?editors=0011) | |||
|
|||
This code displays a bullet list of numbers between 1 and 5. | |||
Этот код выведет ненумерованный список с числами от 1 до 5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ненумерованный список с числами" звучит странно. Тут буллет-поинты это не важная часть повествования и скорее только сбивает с толку. Можно просто "список".
content/docs/lists-and-keys.md
Outdated
|
||
We can refactor the previous example into a component that accepts an array of `numbers` and outputs an unordered list of elements. | ||
Мы можем отрефакторить предыдущий пример с использованием компонента, который принимает массив `numbers` и выводит неупорядоченный список элементов. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Та же проблема. Я убрал unordered из оригинального текста только что, так что просто "список" ок
content/docs/lists-and-keys.md
Outdated
@@ -70,9 +70,9 @@ ReactDOM.render( | |||
); | |||
``` | |||
|
|||
When you run this code, you'll be given a warning that a key should be provided for list items. A "key" is a special string attribute you need to include when creating lists of elements. We'll discuss why it's important in the next section. | |||
Когда вы запустите данный код, то увидите предупреждение о том, что у каждого элемента массива должен быть ключ (key). «Ключ» – это специальный строковый атрибут, который вам необходимо добавлять при создании списка элементов. Мы обсудим почему это важно ниже на странице. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отбить запятыми "почему это важно"
content/docs/lists-and-keys.md
Outdated
|
||
Keys help React identify which items have changed, are added, or are removed. Keys should be given to the elements inside the array to give the elements a stable identity: | ||
Ключи помогают React определять какие элементы были изменены, добавлены или удалены. Ключи нужно присваивать элементам внутри массива для их явной идентификации: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Запятая перед какие
content/docs/lists-and-keys.md
Outdated
|
||
Keys help React identify which items have changed, are added, or are removed. Keys should be given to the elements inside the array to give the elements a stable identity: | ||
Ключи помогают React определять какие элементы были изменены, добавлены или удалены. Ключи нужно присваивать элементам внутри массива для их явной идентификации: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ключи нужно присваивать элементам внутри массива для их явной идентификации:
Identity это не идентификация, а идентичность. Stable тоже важно как-то передать (это не "явная").
Я бы по-другому переписал:
Их нужно указывать, чтобы React смог сопоставлять элементы между массивами с течением времени.
@@ -173,7 +173,7 @@ ReactDOM.render( | |||
); | |||
``` | |||
|
|||
**Example: Correct Key Usage** | |||
**Пример правильного использования ключей** | |||
|
|||
```javascript{2,3,9,10} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут комментарии не переведены
content/docs/lists-and-keys.md
Outdated
|
||
Keys used within arrays should be unique among their siblings. However they don't need to be globally unique. We can use the same keys when we produce two different arrays: | ||
Ключам, которые используются в массивах, нужно быть уникальными среди своих соседей. Однако они не должны быть уникальными глобально. Мы можем использовать одни и те же ключи для создания двух разных массивов. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ключам, которые используются в массивах, нужно быть уникальными среди своих соседей. Однако они не должны быть уникальными глобально. Мы можем использовать одни и те же ключи для создания двух разных массивов.
Ключи внутри массива должны быть уникальны только среди своих соседей. Им не нужно быть глобально уникальными. Можно использовать один и тот же ключ в двух разных массивах:
content/docs/lists-and-keys.md
Outdated
@@ -248,7 +248,7 @@ ReactDOM.render( | |||
|
|||
[**Try it on CodePen**](https://codepen.io/gaearon/pen/NRZYGN?editors=0010) | |||
|
|||
Keys serve as a hint to React but they don't get passed to your components. If you need the same value in your component, pass it explicitly as a prop with a different name: | |||
Ключи являются подсказками для React, но они никогда не передаются в ваши компоненты. Если в компоненте нужно тоже самое значение, то передайте его явно через проп с другим именем: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
служат подсказками
"то же самое"
content/docs/lists-and-keys.md
Outdated
@@ -280,7 +280,7 @@ function NumberList(props) { | |||
} | |||
``` | |||
|
|||
JSX allows [embedding any expression](/docs/introducing-jsx.html#embedding-expressions-in-jsx) in curly braces so we could inline the `map()` result: | |||
JSX позволяет [встроить любое выражение](/docs/introducing-jsx.html#embedding-expressions-in-jsx) в фигурные скобки, так мы можем включить результат `map()`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"так что"?
content/docs/lists-and-keys.md
Outdated
@@ -298,4 +298,4 @@ function NumberList(props) { | |||
|
|||
[**Try it on CodePen**](https://codepen.io/gaearon/pen/BLvYrB?editors=0010) | |||
|
|||
Sometimes this results in clearer code, but this style can also be abused. Like in JavaScript, it is up to you to decide whether it is worth extracting a variable for readability. Keep in mind that if the `map()` body is too nested, it might be a good time to [extract a component](/docs/components-and-props.html#extracting-components). | |||
Иногда это приводит к более чистому коду, но бывает и наоборот. Как и в любом JavaScript-коде, вам придется самостоятельно решать стоит ли извлекать код в переменную для читабельности. Держите в голове, что если содержимое `map()` является слишком сложным, вероятно это отличная возможность чтобы . Не забывайте, что если код внутри `map()` слишком громоздкий, имеет смысл [извлечь его в отдельный компонент](/docs/components-and-props.html#extracting-components). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
запятая перед стоит
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Держите в голове" осталось старое предложение
34117f5
to
eda13d0
Compare
Поправил пару мелочей. Спасибо! |
* upstream/master: (108 commits) Update nav Translation List and keys (reactjs#64) Translate "State and Lifecycle" (state-and-lifecycle.md) (reactjs#42) Add the term fallback Update getting-started.md Update getting-started.md Update TRANSLATION.md Update getting-started.md Update getting-started.md Update TRANSLATION.md Терминология: уборка Исправить Условный рендеринг в нав панели Пропущенное исправление в conditional-rendering Терминология: code splitting Терминология: helper Терминология child [component] Упорядочить глоссарий по алфавиту Больше исправлений по замечаниям касательно conditional-rendering Исправил PR-замечания про conditional-rendering.md Translate "Conditional Rendering" into Russian ...
No description provided.