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(content): translate meta #705

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
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
44 changes: 22 additions & 22 deletions src/content/reference/react-dom/components/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ canary: true

<Canary>

React's extensions to `<meta>` are currently only available in React's canary and experimental channels. In stable releases of React `<meta>` works only as a [built-in browser HTML component](https://react.dev/reference/react-dom/components#all-html-components). Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
Ekstensi React pada `<meta>` saat ini hanya tersedia di saluran eksperimental dan canary. Dalam rilis stabil React `<meta>` hanya bekerja sebagai [komponen HTML bawaan](https://react.dev/reference/react-dom/components#all-html-components). Pelajari lebih lanjut tentang [saluran rilis React di sini](/community/versioning-policy#all-release-channels).

</Canary>


<Intro>

The [built-in browser `<meta>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) lets you add metadata to the document.
[Komponen HTML bawaan `<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) memungkinkan Anda menambahkan metadata ke dokumen.

```js
<meta name="keywords" content="React, JavaScript, semantic markup, html" />
Expand All @@ -24,51 +24,51 @@ The [built-in browser `<meta>` component](https://developer.mozilla.org/en-US/do

---

## Reference {/*reference*/}
## Referensi {/*reference*/}

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

To add document metadata, render the [built-in browser `<meta>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta). You can render `<meta>` from any component and React will always place the corresponding DOM element in the document head.
Untuk menambahkan metadata dokumen, *render* komponen HTML bawaan `<meta>`. Anda dapat me-*render* `<meta>` dari komponen apa pun dan React akan selalu menempatkan elemen DOM yang sesuai di `<head>` dokumen.

```js
<meta name="keywords" content="React, JavaScript, semantic markup, html" />
```

[See more examples below.](#usage)
[Lihat contoh lebih lanjut di bawah.](#usage)

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

`<meta>` supports all [common element props.](/reference/react-dom/components/common#props)
`<meta>` mendukung semua [*props* elemen pada umumnya.](/reference/react-dom/components/common#props)

It should have *exactly one* of the following props: `name`, `httpEquiv`, `charset`, `itemProp`. The `<meta>` component does something different depending on which of these props is specified.
Elemen ini harus memiliki *setidaknya satu* dari *props* berikut: `name`, `httpEquiv`, `charset`, `itemProp`. Komponen `<meta>` akan menghasilkan hal yang berbeda tergantung dari *props* yang diberikan.

* `name`: a string. Specifies the [kind of metadata](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name) to be attached to the document.
* `charset`: a string. Specifies the character set used by the document. The only valid value is `"utf-8"`.
* `httpEquiv`: a string. Specifies a directive for processing the document.
* `itemProp`: a string. Specifies metadata about a particular item within the document rather than the document as a whole.
* `content`: a string. Specifies the metadata to be attached when used with the `name` or `itemProp` props or the behavior of the directive when used with the `httpEquiv` prop.
* `name`: sebuah string. Menentukan [jenis dari metadata](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name) yang akan dilampirkan ke dokumen.
* `charset`: sebuah string. Menentukan setelan karakter yang akan digunakan dokumen. Nilai yang valid hanyalah `"utf-8"`.
* `httpEquiv`: sebuah string. Menentukan direktif dalam memproses dokumen.
* `itemProp`: sebuah string. Menentukan metadata tentang item tertentu dalam dokumen, bukan dokumen secara keseluruhan.
* `content`: sebuah string. Menentukan metadata yang akan dilampirkan saat digunakan dengan *props* `name` atau `itemProp` atau perilaku direktif saat digunakan dengan *prop* `httpEquiv`.

#### Special rendering behavior {/*special-rendering-behavior*/}
#### Perilaku khusus pe-*render*-an {/*special-rendering-behavior*/}

React will always place the DOM element corresponding to the `<meta>` component within the document’s `<head>`, regardless of where in the React tree it is rendered. The `<head>` is the only valid place for `<meta>` to exist within the DOM, yet it’s convenient and keeps things composable if a component representing a specific page can render `<meta>` components itself.
React akan selalu menempatkan elemen DOM yang terkait dengan komponen `<meta>` di dalam `<head>` dokumen, di mana pun elemen tersebut di-*render* di pohon React. Hanyalah `<head>`tempat yang valid untuk meletakkan `<meta>` di dalam DOM, namun tetap cocok dan membuat semuanya tetap dapat disusun jika komponen yang mewakili halaman tertentu dapat me-*render* komponen `<meta>` itu sendiri.

There is one exception to this: if `<meta>` has an [`itemProp`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemprop) prop, there is no special behavior, because in this case it doesn’t represent metadata about the document but rather metadata about a specific part of the page.
Ada satu pengecualian: jika komponen `<meta>` memiliki sebuah *prop* [`itemProp`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemprop), maka tidak ada perilaku khusus, karena dalam hal ini komponen tersebut tidak mewakili metadata tentang dokumen, melainkan metadata tentang bagian tertentu dari halaman.

---

## Usage {/*usage*/}
## Penggunaan {/*usage*/}

### Annotating the document with metadata {/*annotating-the-document-with-metadata*/}
### Menandai dokumen dengan metadata {/*annotating-the-document-with-metadata*/}

You can annotate the document with metadata such as keywords, a summary, or the author’s name. React will place this metadata within the document `<head>` regardless of where in the React tree it is rendered.
Anda dapat memberikan keterangan dokumen dengan metadata seperti kata kunci, ringkasan, atau nama pembuat. React akan menempatkan metadata ini di dalam dokumen `<head>` terlepas dari di mana metadata tersebut di-*render* di pohon React.

```html
<meta name="author" content="John Smith" />
<meta name="keywords" content="React, JavaScript, semantic markup, html" />
<meta name="description" content="API reference for the <meta> component in React DOM" />
```

You can render the `<meta>` component from any component. React will put a `<meta>` DOM node in the document `<head>`.
Anda dapat me-*render* komponen `<meta>` dari komponen mana pun. React akan meletakkan simpul DOM `<meta>` tersebut di dalam dokumen `<head>`.

<SandpackWithHTMLOutput>

Expand All @@ -89,9 +89,9 @@ export default function SiteMapPage() {

</SandpackWithHTMLOutput>

### Annotating specific items within the document with metadata {/*annotating-specific-items-within-the-document-with-metadata*/}
### Menandai item tertentu di dalam dokumen dengan metadata {/*annotating-specific-items-within-the-document-with-metadata*/}

You can use the `<meta>` component with the `itemProp` prop to annotate specific items within the document with metadata. In this case, React will *not* place these annotations within the document `<head>` but will place them like any other React component.
Anda dapat menggunakan komponen `<meta>` dengan *prop* `itemProp` untuk memberi anotasi pada item tertentu dalam dokumen dengan metadata. Dalam hal ini, React tidak akan menempatkan anotasi ini di dalam dokumen `<head>`, melainkan akan menempatkannya seperti komponen React lainnya.

```js
<section itemScope>
Expand Down
Loading