Skip to content

Commit 5839b86

Browse files
aroyanresir014
andauthored
docs: title component translation (#704)
Co-authored-by: Resi Respati <[email protected]>
1 parent 29476ff commit 5839b86

File tree

1 file changed

+22
-22
lines changed
  • src/content/reference/react-dom/components

1 file changed

+22
-22
lines changed

src/content/reference/react-dom/components/title.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ canary: true
55

66
<Canary>
77

8-
React's extensions to `<title>` are currently only available in React's canary and experimental channels. In stable releases of React `<title>` 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).
8+
Ekstensi React untuk `<title>` saat ini hanya tersedia di kanal *canary* dan eksperimental React. Pada rilis stabil React, `<title>` hanya berfungsi sebagai [komponen HTML bawaan peramban](https://react.dev/reference/react-dom/components#all-html-components). Pelajari lebih lanjut tentang [kanal rilis React di sini](/community/versioning-policy#all-release-channels).
99

1010
</Canary>
1111

1212

1313
<Intro>
1414

15-
The [built-in browser `<title>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title) lets you specify the title of the document.
15+
[Komponen bawaan peramban `<title>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title) memungkinkan Anda untuk menentukan judul dari dokumen.
1616

1717
```js
18-
<title>My Blog</title>
18+
<title>Blog Saya</title>
1919
```
2020

2121
</Intro>
@@ -24,45 +24,45 @@ The [built-in browser `<title>` component](https://developer.mozilla.org/en-US/d
2424

2525
---
2626

27-
## Reference {/*reference*/}
27+
## Referensi {/*reference*/}
2828

2929
### `<title>` {/*title*/}
3030

31-
To specify the title of the document, render the [built-in browser `<title>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title). You can render `<title>` from any component and React will always place the corresponding DOM element in the document head.
31+
Untuk menentukan judul dokmen, render [komponen bawaan peramban `<title>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title). Anda dapat me-*render* `<title>` dari komponen apapun dan React akan selalu menempatkan elemen DOM yang sesuai di *document head*.
3232

3333
```js
34-
<title>My Blog</title>
34+
<title>Blog Saya</title>
3535
```
3636

37-
[See more examples below.](#usage)
37+
[Lihat contoh-contoh lainnya di bawah ini.](#usage)
3838

3939
#### Props {/*props*/}
4040

41-
`<title>` supports all [common element props.](/reference/react-dom/components/common#props)
41+
`<title>` mendukung semua [element props yang umum.](/reference/react-dom/components/common#props)
4242

43-
* `children`: `<title>` accepts only text as a child. This text will become the title of the document. You can also pass your own components as long as they only render text.
43+
* `children`: `<title>` hanya menerima teks sebagai anak. Teks ini akan menjadi judul dokumen. Anda juga dapat meng-oper komponen Anda sendiri selama komponen tersebut hanya me-*render* teks.
4444

45-
#### Special rendering behavior {/*special-rendering-behavior*/}
45+
#### Perilaku *render*-ing khusus {/*special-rendering-behavior*/}
4646

47-
React will always place the DOM element corresponding to the `<title>` component within the document’s `<head>`, regardless of where in the React tree it is rendered. The `<head>` is the only valid place for `<title>` to exist within the DOM, yet it’s convenient and keeps things composable if a component representing a specific page can render its `<title>` itself.
47+
React akan selalu menempatkan elemen DOM yang sesuai dengan komponen `<title>` di dalam `<head>` dokumen, di mana pun elemen tersebut di-*render* di pohon React. `<head>` adalah satu-satunya tempat yang valid untuk `<title>` berada dalam DOM, namun tetap mudah dan membuat segala sesuatunya tetap dapat disusun jika komponen yang mewakili laman tertentu dapat me-*render* `<title>`-nya sendiri.
4848

49-
There are two exception to this:
50-
* If `<title>` is within an `<svg>` component, then there is no special behavior, because in this context it doesn’t represent the document’s title but rather is an [accessibility annotation for that SVG graphic](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title).
51-
* If the `<title>` 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 the document’s title but rather metadata about a specific part of the page.
49+
Ada dua pengecualian untuk hal ini:
50+
* Jika `<title>` berada dalam komponen `<svg>`, maka tidak ada perilaku khusus, karena dalam konteks ini tidak mewakili judul dokumen melainkan merupakan [anotasi aksesibilitas untuk grafik SVG tersebut](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title).
51+
* Jika `<title>` memiliki prop [`itemProp`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemprop), maka tidak ada perilaku khusus, karena dalam hal ini dalam hal ini tidak mewakili judul dokumen melainkan metadata tentang bagian halaman tertentu.
5252

5353
<Pitfall>
5454

55-
Only render a single `<title>` at a time. If more than one component renders a `<title>` tag at the same time, React will place all of those titles in the document head. When this happens, the behavior of browsers and search engines is undefined.
55+
Hanya *render* satu `<title>` dalam satu waktu. Jika lebih dari satu komponen me-*render* tag `<title>` secara bersamaan, React akan menempatkan semua judul tersebut di dokumen `head`. Jika hal ini terjadi, perilaku peramban dan mesin telusur tidak terdefinisi.
5656

5757
</Pitfall>
5858

5959
---
6060

61-
## Usage {/*usage*/}
61+
## Penggunaan {/*usage*/}
6262

63-
### Set the document title {/*set-the-document-title*/}
63+
### Menyetel judul dokumen {/*set-the-document-title*/}
6464

65-
Render the `<title>` component from any component with text as its children. React will put a `<title>` DOM node in the document `<head>`.
65+
*Render* komponen `<title>` dari komponen apapun dengan teks sebagai anak. React akan menempatkan node DOM `<title>` di dokumen `<head>`.
6666

6767
<SandpackWithHTMLOutput>
6868

@@ -82,15 +82,15 @@ export default function ContactUsPage() {
8282

8383
</SandpackWithHTMLOutput>
8484

85-
### Use variables in the title {/*use-variables-in-the-title*/}
85+
### Penggunaan variabel dalam title {/*use-variables-in-the-title*/}
8686

87-
The children of the `<title>` component must be a single string of text. (Or a single number or a single object with a `toString` method.) It might not be obvious, but using JSX curly braces like this:
87+
*Children* dari komponen `<title>` harus berupa string teks tunggal. (Atau satu nomor atau satu objek dengan metode `toString`.) Ini mungkin tidak terlihat jelas, tetapi menggunakan kurung kurawal JSX seperti ini:
8888

8989
```js
90-
<title>Results page {pageNumber}</title> // 🔴 Problem: This is not a single string
90+
<title>Results page {pageNumber}</title> // 🔴 Masalah: Ini bukan string tunggal
9191
```
9292

93-
... actually causes the `<title>` component to get a two-element array as its children (the string `"Results page"` and the value of `pageNumber`). This will cause an error. Instead, use string interpolation to pass `<title>` a single string:
93+
... sebenarnya menyebabkan komponen `<title>` mendapatkan array dua elemen sebagai turunan-nya (string `"Results page"` dan nilai `pageNumber`). Ini akan menyebabkan kesalahan. Sebagai gantinya, gunakan interpolasi string untuk meng-oper `<title>` satu string:
9494

9595
```js
9696
<title>{`Results page ${pageNumber}`}</title>

0 commit comments

Comments
 (0)