Skip to content

Commit f57c560

Browse files
committed
feat(i18n): 1.02.09.*
1 parent 321d6b4 commit f57c560

File tree

3 files changed

+36
-36
lines changed

3 files changed

+36
-36
lines changed

Diff for: 1-js/02-first-steps/09-alert-prompt-confirm/1-simple-page/solution.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
JavaScript-code:
1+
Kode JavaScript:
22

33
```js demo run
44
let name = prompt("What is your name?", "");
55
alert(name);
66
```
77

8-
The full page:
8+
Laman penuh:
99

1010
```html
1111
<!DOCTYPE html>
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
importance: 4
1+
nilai penting: 4
22

33
---
44

5-
# A simple page
5+
# Laman simpel
66

7-
Create a web-page that asks for a name and outputs it.
7+
Buat laman web yang meminta nama dan menampilkannya.
88

99
[demo]
+31-31
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Interaction: alert, prompt, confirm
1+
# Interaksi: alert, prompt, confirm
22

3-
In this part of the tutorial we cover JavaScript language "as is", without environment-specific tweaks.
3+
Di bagian tutorial ini kita membahas bahasa JavaScript "apa adanya", tanpa tweak ke lingkungan tertentu.
44

5-
But we'll still be using the browser as our demo environment, so we should know at least a few of its user-interface functions. In this chapter, we'll get familiar with the browser functions `alert`, `prompt` and `confirm`.
5+
Tapi kita masih akan memakai peramban sebagai lingkungan demo kita, jadi kita sebaiknya paham minimal beberapa fungsi user-interface-nya. Di bab ini, kita akan berkenalan dengan fungsi browser `alert`, `prompt` dan `confirm`.
66

77
## alert
88

@@ -12,37 +12,37 @@ Syntax:
1212
alert(message);
1313
```
1414

15-
This shows a message and pauses script execution until the user presses "OK".
15+
Ini menampilkan pesan dan menyela exekusi script hingga pengguna menekan "OK".
1616

17-
For example:
17+
Misalnya:
1818

1919
```js run
2020
alert("Hello");
2121
```
2222

23-
The mini-window with the message is called a *modal window*. The word "modal" means that the visitor can't interact with the rest of the page, press other buttons, etc. until they have dealt with the window. In this case -- until they press "OK".
23+
Mini-window dengan pesan ini disebut *modal window*. Kata "modal" artinya pengunjung tak bisa berinteraksi dengan apapun di laman, menekan tombol lain, dll. hingga mereka selesai berurusan dengan window ini. Dalam hal ini -- hingga mereka menekan "OK".
2424

2525
## prompt
2626

27-
The function `prompt` accepts two arguments:
27+
Fungsi `prompt` menerima dua argumen:
2828

2929
```js no-beautify
3030
result = prompt(title, [default]);
3131
```
3232

33-
It shows a modal window with a text message, an input field for the visitor, and the buttons OK/CANCEL.
33+
Ia menampilkan modal window dengan pesan teks, input field untuk pengunjung, dan tombol OK/CANCEL.
3434

3535
`title`
36-
: The text to show the visitor.
36+
: Teks untuk ditampilkan ke pengunjung.
3737

3838
`default`
39-
: An optional second parameter, the initial value for the input field.
39+
: Parameter kedua opsional, nilai inisial untuk input field.
4040

41-
The visitor may type something in the prompt input field and press OK. Or they can cancel the input by pressing CANCEL or hitting the `key:Esc` key.
41+
Pengunjung boleh menulis apapun di input field prompt dan menekan OK. Atau mereka bisa membatalkan input dengan menekan CANCEL atau menekan `key:Esc`.
4242

43-
The call to `prompt` returns the text from the input field or `null` if the input was canceled.
43+
Panggilan ke `prompt` mengembalikan teks dari input field atau `null` jika input dibatalkan.
4444

45-
For instance:
45+
Misalnya:
4646

4747
```js run
4848
let age = prompt('How old are you?', 100);
@@ -51,15 +51,15 @@ alert(`You are ${age} years old!`); // You are 100 years old!
5151
```
5252

5353
````warn header="In IE: always supply a `default`"
54-
The second parameter is optional, but if we don't supply it, Internet Explorer will insert the text `"undefined"` into the prompt.
54+
Parameter kedua ini opsional, tapi jika kita tidak menyuplai, Internet Explorer akan menyisipkan teks `"undefined"` ke dalam prompt.
5555

56-
Run this code in Internet Explorer to see:
56+
Jalan kode ini di Internet Explorer untuk melihat:
5757

5858
```js run
5959
let test = prompt("Test");
6060
```
6161

62-
So, for prompts to look good in IE, we recommend always providing the second argument:
62+
Jadi, supaya prompt terlihat bagus di IE, sebaiknya sediakan argumen kedua:
6363

6464
```js run
6565
let test = prompt("Test", ''); // <-- for IE
@@ -68,42 +68,42 @@ let test = prompt("Test", ''); // <-- for IE
6868
6969
## confirm
7070
71-
The syntax:
71+
Syntaxnya:
7272
7373
```js
7474
result = confirm(question);
7575
```
7676
77-
The function `confirm` shows a modal window with a `question` and two buttons: OK and CANCEL.
77+
Fungsi `confirm` menampilkan modal window dengan `pertanyaan` dan dua tombol: OK dan CANCEL.
7878
79-
The result is `true` if OK is pressed and `false` otherwise.
79+
Hasilnya `true` jika OK ditekan dan `false` jika tidak.
8080
81-
For example:
81+
Misalnya:
8282
8383
```js run
8484
let isBoss = confirm("Are you the boss?");
8585
86-
alert( isBoss ); // true if OK is pressed
86+
alert( isBoss ); // true jika OK ditekan
8787
```
8888
89-
## Summary
89+
## Kesimpulan
9090
91-
We covered 3 browser-specific functions to interact with visitors:
91+
Kita membahas 3 fungsi spesifik peramban untuk berinteraksi dengan pengunjung:
9292
9393
`alert`
94-
: shows a message.
94+
: menampilkan pesan.
9595
9696
`prompt`
97-
: shows a message asking the user to input text. It returns the text or, if CANCEL or `key:Esc` is clicked, `null`.
97+
: menampilkan pesan yang minta input teks pengguna. Ia mengembalikan teks atau, jika CANCEL atau `key:Esc` diklik, `null`.
9898
9999
`confirm`
100-
: shows a message and waits for the user to press "OK" or "CANCEL". It returns `true` for OK and `false` for CANCEL/`key:Esc`.
100+
: menampilkan pesan dan menunggu pengguna menekan "OK" atau "CANCEL". It returns `true` for OK and `false` for CANCEL/`key:Esc`.
101101
102-
All these methods are modal: they pause script execution and don't allow the visitor to interact with the rest of the page until the window has been dismissed.
102+
Semua metode ini ialah modal: mereka menyela exekusi script dan tak membolehkan pengunjung berinteraksi dengan apapun di laman hingga window ditutup.
103103
104-
There are two limitations shared by all the methods above:
104+
Ada dua batasan yang dibagikan semua metode di atas:
105105
106-
1. The exact location of the modal window is determined by the browser. Usually, it's in the center.
107-
2. The exact look of the window also depends on the browser. We can't modify it.
106+
1. Lokasi tepat modal window ditentukan oleh peramban. Biasanya, di tengah.
107+
2. Tampilan tepat window juga tergantung peramban. Kita tak bisa modifikasi ini.
108108
109-
That is the price for simplicity. There are other ways to show nicer windows and richer interaction with the visitor, but if "bells and whistles" do not matter much, these methods work just fine.
109+
Itulah harga untuk kesederhanaan. Ada banyak cara menampilkan window lebih manis dan kaya akan interaksi dengan pengguna, tapi jika "bells and whistles" tak jadi masalah, metode ini baik-baik saja.

0 commit comments

Comments
 (0)