Skip to content
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

docs(pt-br): translate option page #687

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions src/content/reference/react-dom/components/option.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "<option>"

<Intro>

The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option) lets you render an option inside a [`<select>`](/reference/react-dom/components/select) box.
O [componente `<option>` nativo do navegador](https://developer.mozilla.org/pt-BR/docs/Web/HTML/Element/option) permite que você renderize uma opção dentro de uma caixa de seleção [`<select>`](/reference/react-dom/components/select).
Copy link
Contributor

Choose a reason for hiding this comment

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

apontar pras docs traduzidas ao invés das comuns foi genial, não tinha feito essas alterações até agora. Roubei a ideia.


```js
<select>
Expand All @@ -19,11 +19,11 @@ The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/

---

## Reference {/*reference*/}
## Referência {/*reference*/}

### `<option>` {/*option*/}

The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) lets you render an option inside a [`<select>`](/reference/react-dom/components/select) box.
O [componente `<option>` nativo do navegador](https://developer.mozilla.org/pt-BR/docs/Web/HTML/Element/select) permite que você renderize uma opção dentro de uma caixa de seleção [`<select>`](/reference/react-dom/components/select).

```js
<select>
Expand All @@ -32,31 +32,31 @@ The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/
</select>
```

[See more examples below.](#usage)
[Veja mais exemplos abaixo.](#usage)

#### Props {/*props*/}

`<option>` supports all [common element props.](/reference/react-dom/components/common#props)
`<option>` suporta todas as [props comuns dos elementos.](/reference/react-dom/components/common#props)
Copy link
Contributor

Choose a reason for hiding this comment

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

esse é um que facilmente passa despercebido, mas depois ao ler, soa bem estranho. Algumas alternativas que uso quando preciso traduzir supports:

  • "oferece suporte"
  • "possui suporte"
  • "permite o uso"
  • etc. (cabe ao contexto tb)


Additionally, `<option>` supports these props:
Além disso, `<option>` suporta as seguintes props:
Copy link
Contributor

Choose a reason for hiding this comment

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

Mesmo caso relacionado a tradução de supports


* [`disabled`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#disabled): A boolean. If `true`, the option will not be selectable and will appear dimmed.
* [`label`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#label): A string. Specifies the meaning of the option. If not specified, the text inside the option is used.
* [`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#value): The value to be used [when submitting the parent `<select>` in a form](/reference/react-dom/components/select#reading-the-select-box-value-when-submitting-a-form) if this option is selected.
* [`disabled`](https://developer.mozilla.org/pt-BR/docs/Web/HTML/Element/option#disabled): Um booleano. Se `true`, a opção não será selecionável e aparecerá escurecida.
* [`label`](https://developer.mozilla.org/pt-BR/docs/Web/HTML/Element/option#label): Uma string. Especifica o significado da opção. Caso não seja especificado, o texto dentro da opção será utilizado.
* [`value`](https://developer.mozilla.org/pt-BR/docs/Web/HTML/Element/option#value): O valor a ser utilizado [quando um elemento pai `<select>` é submetido em um formulário](/reference/react-dom/components/select#reading-the-select-box-value-when-submitting-a-form) se esta opção for selecionada.

#### Caveats {/*caveats*/}
#### Observações {/*caveats*/}

* React does not support the `selected` attribute on `<option>`. Instead, pass this option's `value` to the parent [`<select defaultValue>`](/reference/react-dom/components/select#providing-an-initially-selected-option) for an uncontrolled select box, or [`<select value>`](/reference/react-dom/components/select#controlling-a-select-box-with-a-state-variable) for a controlled select.
* O React não suporta o atributo `selected` em `<option>`. Em vez disso, passe o `value` da opção ao componente pai [`<select defaultValue>`](/reference/react-dom/components/select#providing-an-initially-selected-option) para uma caixa de seleção não controlada, ou [`<select value>`](/reference/react-dom/components/select#controlling-a-select-box-with-a-state-variable) para uma caixa de seleção controlada.
Copy link
Contributor

@NivaldoFarias NivaldoFarias May 13, 2023

Choose a reason for hiding this comment

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

Mesmo caso relacionado a tradução de supports


---

## Usage {/*usage*/}
## Uso {/*usage*/}

### Displaying a select box with options {/*displaying-a-select-box-with-options*/}
### Exibindo uma caixa de seleção com opções {/*displaying-a-select-box-with-options*/}

Render a `<select>` with a list of `<option>` components inside to display a select box. Give each `<option>` a `value` representing the data to be submitted with the form.
Renderize um `<select>` com uma lista de componentes `<option>` dentro para exibir uma caixa de seleção. Atribua a cada `<option>` um `<value>` representando os dados a serem submetidos com o formulário.
Copy link
Contributor

Choose a reason for hiding this comment

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

<value> deveria constar value


[Read more about displaying a `<select>` with a list of `<option>` components.](/reference/react-dom/components/select)
[Leia mais sobre a exibição de um `<select>` com uma lista de componentes `<option>`.](/reference/react-dom/components/select)

<Sandpack>

Expand All @@ -79,5 +79,4 @@ export default function FruitPicker() {
select { margin: 5px; }
```

</Sandpack>

</Sandpack>