From 102f1efb2924a73884c1c6ff431003d2ab1d9d59 Mon Sep 17 00:00:00 2001 From: Isaias Yafar Date: Fri, 14 Oct 2022 17:53:46 -0300 Subject: [PATCH 1/2] Translation from English to Spanish --- beta/src/content/apis/react/useId.md | 67 ++++++++++++++-------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/beta/src/content/apis/react/useId.md b/beta/src/content/apis/react/useId.md index 0a3488709..c792146b8 100644 --- a/beta/src/content/apis/react/useId.md +++ b/beta/src/content/apis/react/useId.md @@ -4,7 +4,8 @@ title: useId -`useId` is a React Hook for generating unique IDs that can be passed to accessibility attributes. +`useId` es un Hook de React para generar IDs unicos que se puede pasar a los atributos de accesibilidad. + ```js const id = useId() @@ -16,17 +17,17 @@ const id = useId() --- -## Usage {/*usage*/} +## Uso {/*usage*/} -**Do not call `useId` to generate keys in a list.** [Keys should be generated from your data.](/learn/rendering-lists#where-to-get-your-key) +**No utilices `useId` para generar keys en una lista.** [Las keys deben generarse a partir de sus datos.](/learn/rendering-lists#where-to-get-your-key) -### Generating unique IDs for accessibility attributes {/*generating-unique-ids-for-accessibility-attributes*/} +### Generación de ID únicos para atributos de accesibilidad {/*generating-unique-ids-for-accessibility-attributes*/} -Call `useId` at the top level of your component to generate a unique ID: +Llame a `useId` en el nivel superior de su componente para generar una ID única: ```js [[1, 4, "passwordHintId"]] import { useId } from 'react'; @@ -36,7 +37,7 @@ function PasswordField() { // ... ``` -You can then pass the generated ID to different attributes: +A continuación, puedes pasar el ID generado a los diferentes atributos: ```js [[1, 2, "passwordHintId"], [1, 3, "passwordHintId"]] <> @@ -45,11 +46,11 @@ You can then pass the generated ID to different at ``` -**Let's walk through an example to see when this is useful.** +**Veamos un ejemplo para ver cuándo es útil.** -[HTML accessibility attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) like [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) let you specify that two tags are related to each other. For example, you can specify that a certain element (like an input) is described by another element (like a paragraph). +[Atrbutos de accesibilidad HTML](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) como [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) le permite especificar que dos etiquetas están relacionadas entre sí. Por ejemplo, puede especificar que un determinado elemento (como una entrada) sea descrito por otro elemento (como un párrafo). -In regular HTML, you would write it like this: +En HTML normal, lo escribirías así: ```html {5,8}