Skip to content

Commit 8dab17f

Browse files
authored
Use language English as default
1 parent a9fd35b commit 8dab17f

5 files changed

Lines changed: 55 additions & 55 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Urutan Aritmatika
1+
# Arithmetic Sequence
22

3-
Sebuah aplikasi web untuk membuat dan menyelesaikan urutan aritmatika.
3+
A web application for generating and solving arithmetic sequences.
44

5-
## Fitur
5+
## Features
66

7-
- Membuat urutan aritmatika
8-
- Menyelesaikan urutan aritmatika yang hilang
7+
- Generate arithmetic sequences
8+
- Solve missing arithmetic sequences
99

10-
## Teknologi
10+
## Technology
1111

1212
- React
1313
- Framer Motion
1414
- Vite
1515

16-
## Kredit
16+
## Credits
1717

1818
- Icon: [Icons8](https://icons8.com)
1919
- Background: [Freepik](https://img.freepik.com)

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8" />
66
<link rel="icon" type="image/png" href="https://img.icons8.com/?size=100&id=21RZGSq7l9zF&format=png&color=000000" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>Urutan Aritmatika</title>
8+
<title>Arithmetic Sequence</title>
99
<link rel="preload" href="https://img.freepik.com/free-photo/stationery-with-apple-calculator-blackboard_23-2148199923.jpg" as="image">
1010
</head>
1111

src/App.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,44 +37,44 @@ const App = () => {
3737
return (
3838
<div className="main-menu fade-in">
3939
<h1 className="slide-down">
40-
Urutan Aritmatika
40+
Arithmetic Sequence
4141
</h1>
4242
<ButtonGroup>
4343
<Button
4444
type="arithmetic"
4545
onClick={() => handleNavigation("generate", "arithmetic")}
4646
>
47-
Membuat Urutan Aritmatika
47+
Generate Arithmetic Sequence
4848
</Button>
4949
<Button
5050
type="arithmetic"
5151
onClick={() => handleNavigation("solve", "arithmetic")}
5252
>
53-
Menyelesaikan Urutan Aritmatika yang Hilang
53+
Solve Missing Arithmetic Sequence
5454
</Button>
5555
<Button
5656
type="geometric"
5757
onClick={() => handleNavigation("generate", "geometric")}
5858
>
59-
Membuat Urutan Geometri
59+
Generate Geometric Sequence
6060
</Button>
6161
<Button
6262
type="geometric"
6363
onClick={() => handleNavigation("solve", "geometric")}
6464
>
65-
Menyelesaikan Urutan Geometri yang Hilang
65+
Solve Missing Geometric Sequence
6666
</Button>
6767
<Button
6868
type="alphabet"
6969
onClick={() => handleNavigation("generate", "alphabet")}
7070
>
71-
Membuat Urutan Abjad
71+
Generate Alphabet Sequence
7272
</Button>
7373
<Button
7474
type="alphabet"
7575
onClick={() => handleNavigation("solve", "alphabet")}
7676
>
77-
Menyelesaikan Urutan Abjad yang Hilang
77+
Solve Missing Alphabet Sequence
7878
</Button>
7979
</ButtonGroup>
8080
</div>

src/components/GenerateSequence.jsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const GenerateSequence = memo(({ sequenceType, goBack }) => {
4848
break;
4949
}
5050
default:
51-
throw new Error("Tipe urutan tidak diketahui");
51+
throw new Error("Unknown sequence type");
5252
}
5353
return result;
5454
}, []);
@@ -57,64 +57,64 @@ const GenerateSequence = memo(({ sequenceType, goBack }) => {
5757
const text = generatedSequence.join(", ");
5858
navigator.clipboard
5959
.writeText(text)
60-
.then(() => alert("Disalin ke clipboard"))
61-
.catch((err) => console.error("Gagal menyalin teks: ", err));
60+
.then(() => alert("Copied to clipboard"))
61+
.catch((err) => console.error("Failed to copy text: ", err));
6262
}, [generatedSequence]);
6363

6464
return (
6565
<div className="sequence-page fade-in">
66-
<motion.h2>{`Buat ${
66+
<motion.h2>{`Generate ${
6767
sequenceType.charAt(0).toUpperCase() + sequenceType.slice(1)
68-
} Urutan`}</motion.h2>
68+
} Sequence`}</motion.h2>
6969
<form onSubmit={handleSubmit} className="sequence-form">
7070
<div>
71-
<label>Suku Awal:</label>
71+
<label>Initial Term:</label>
7272
<input
7373
type={sequenceType === "alphabet" ? "text" : "number"}
7474
value={initialTerm}
7575
onChange={(event) => setInitialTerm(event.target.value)}
7676
required
77-
placeholder={sequenceType === "alphabet" ? "contoh: A" : "contoh: 1"}
77+
placeholder={sequenceType === "alphabet" ? "e.g.: A" : "e.g.: 1"}
7878
/>
7979
</div>
8080

8181
<div>
8282
<label>
8383
{sequenceType === "arithmetic"
84-
? "Selisih Umum"
84+
? "Common Difference"
8585
: sequenceType === "geometric"
86-
? "Rasio Umum"
87-
: "Langkah"}
86+
? "Common Ratio"
87+
: "Step"}
8888
</label>
8989
<input
9090
type="number"
9191
value={commonDifferenceOrRatio}
9292
onChange={(event) => setCommonDifferenceOrRatio(event.target.value)}
9393
required
94-
placeholder="contoh: 2"
94+
placeholder="e.g.: 2"
9595
/>
9696
</div>
9797
<div>
98-
<label>Jumlah Suku:</label>
98+
<label>Number of Terms:</label>
9999
<input
100100
type="number"
101101
value={numberOfTerms}
102102
onChange={(event) => setNumberOfTerms(event.target.value)}
103103
required
104-
placeholder="contoh: 5"
104+
placeholder="e.g.: 5"
105105
/>
106106
</div>
107107

108108
<button
109109
className="button-hover"
110110
type="submit"
111111
>
112-
Buat
112+
Generate
113113
</button>
114114
</form>
115115
{generatedSequence.length > 0 && (
116116
<div>
117-
<h3>Urutan yang Dihasilkan:</h3>
117+
<h3>Generated Sequence:</h3>
118118
<ul>
119119
{generatedSequence.map((num, index) => (
120120
<li key={index} className="list-item-hover">
@@ -126,15 +126,15 @@ const GenerateSequence = memo(({ sequenceType, goBack }) => {
126126
className="back-button button-hover"
127127
onClick={handleCopy}
128128
>
129-
Salin ke Clipboard
129+
Copy to Clipboard
130130
</button>
131131
</div>
132132
)}
133133
<button
134134
className="back-button button-hover"
135135
onClick={goBack}
136136
>
137-
Kembali
137+
Back
138138
</button>
139139
</div>
140140
);

src/components/SolveMissing.jsx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ const SolveMissing = memo(({ sequenceType, goBack }) => {
1919

2020
if (hasInvalidNumber || hasInvalidLetter) {
2121
throw new Error(
22-
`Masukan tidak valid: Hanya ${
23-
type === "alphabet" ? "huruf" : "angka"
24-
} yang diizinkan untuk urutan ${type}.`
22+
`Invalid input: Only ${
23+
type === "alphabet" ? "letters" : "numbers"
24+
} are allowed for ${type} sequence.`
2525
);
2626
}
2727
}, []);
@@ -38,7 +38,7 @@ const SolveMissing = memo(({ sequenceType, goBack }) => {
3838
.map((x) => (x.trim() === "..." ? null : x.trim()));
3939

4040
if (inputArray.length < 2) {
41-
throw new Error("Masukan urutan harus memiliki setidaknya dua urutan.");
41+
throw new Error("Sequence input must have at least two terms.");
4242
}
4343

4444
validateSequence(inputArray, sequenceType);
@@ -61,41 +61,41 @@ const SolveMissing = memo(({ sequenceType, goBack }) => {
6161
case "arithmetic": {
6262
const diff = findArithmeticDifference(solvedSequence);
6363
if (diff === null) {
64-
throw new Error("Tidak dapat menemukan selisih yang umum.");
64+
throw new Error("Cannot find common difference.");
6565
}
6666
solvedSequence = fillMissingTermsArithmetic(solvedSequence, diff);
6767
return {
6868
solvedArray: solvedSequence,
69-
details: `Selisih yang umum adalah ${diff}.`,
69+
details: `The common difference is ${diff}.`,
7070
};
7171
}
7272

7373
case "geometric": {
7474
const ratio = findGeometricRatio(solvedSequence);
7575
if (ratio === null) {
76-
throw new Error("Tidak dapat menemukan rasio yang umum.");
76+
throw new Error("Cannot find common ratio.");
7777
}
7878
solvedSequence = fillMissingTermsGeometric(solvedSequence, ratio);
7979
return {
8080
solvedArray: solvedSequence,
81-
details: `Rasio yang umum adalah ${ratio}.`,
81+
details: `The common ratio is ${ratio}.`,
8282
};
8383
}
8484

8585
case "alphabet": {
8686
const diff = findAlphabetDifference(solvedSequence);
8787
if (diff === null) {
88-
throw new Error("Tidak dapat menemukan perbedaan huruf yang umum.");
88+
throw new Error("Cannot find common letter difference.");
8989
}
9090
solvedSequence = fillMissingTermsAlphabet(solvedSequence, diff);
9191
return {
9292
solvedArray: solvedSequence,
93-
details: `Perbedaan huruf yang umum adalah ${diff}.`,
93+
details: `The common letter difference is ${diff}.`,
9494
};
9595
}
9696

9797
default:
98-
throw new Error("Tipe urutan tidak diketahui.");
98+
throw new Error("Unknown sequence type.");
9999
}
100100
}, []);
101101

@@ -158,25 +158,25 @@ const SolveMissing = memo(({ sequenceType, goBack }) => {
158158
const text = solvedSequence.join(", ");
159159
navigator.clipboard
160160
.writeText(text)
161-
.then(() => alert("Disalin ke Clipboard"))
162-
.catch((err) => console.error("Gagal menyalin teks: ", err));
161+
.then(() => alert("Copied to Clipboard"))
162+
.catch((err) => console.error("Failed to copy text: ", err));
163163
}, [solvedSequence]);
164164

165165
const placeholder = {
166-
arithmetic: "contoh: 2, 4, 6, 8, ...",
167-
geometric: "contoh: 2, 6, 18, 54, ...",
168-
alphabet: "contoh: A, D, G, J, ...",
166+
arithmetic: "e.g.: 2, 4, 6, 8, ...",
167+
geometric: "e.g.: 2, 6, 18, 54, ...",
168+
alphabet: "e.g.: A, D, G, J, ...",
169169
}[sequenceType];
170170

171171
return (
172172
<div className="sequence-page fade-in">
173-
<motion.h2>{`Menyelesaikan Urutan ${
173+
<motion.h2>{`Solve Missing ${
174174
sequenceType.charAt(0).toUpperCase() + sequenceType.slice(1)
175-
} yang Hilang`}</motion.h2>
175+
} Sequence`}</motion.h2>
176176
<form onSubmit={handleSubmit} className="sequence-form">
177177
<div>
178178
<label>
179-
Masukkan urutan (gunakan &quot;...&quot; untuk urutan yang hilang):
179+
Enter sequence (use &quot;...&quot; for missing terms):
180180
</label>
181181
<input
182182
type="text"
@@ -191,13 +191,13 @@ const SolveMissing = memo(({ sequenceType, goBack }) => {
191191
className="button-hover"
192192
type="submit"
193193
>
194-
Selesaikan
194+
Solve
195195
</button>
196196
</form>
197197

198198
{solvedSequence.length > 0 && (
199199
<div>
200-
<h3>Urutan yang Dipecahkan:</h3>
200+
<h3>Solved Sequence:</h3>
201201
<ul>
202202
{solvedSequence.map((num, index) => (
203203
<li key={index} className="list-item-hover">
@@ -210,15 +210,15 @@ const SolveMissing = memo(({ sequenceType, goBack }) => {
210210
className="back-button button-hover"
211211
onClick={handleCopy}
212212
>
213-
Salin ke Clipboard
213+
Copy to Clipboard
214214
</button>
215215
</div>
216216
)}
217217
<button
218218
className="back-button button-hover"
219219
onClick={goBack}
220220
>
221-
Kembali
221+
Back
222222
</button>
223223
</div>
224224
);

0 commit comments

Comments
 (0)