Skip to content

Commit bb3620e

Browse files
Finish i18n for all current pages
1 parent ccbf634 commit bb3620e

File tree

9 files changed

+413
-19
lines changed

9 files changed

+413
-19
lines changed

assets/chars.ts

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
export type CharcodeMap = {
2+
[index: string]: {
3+
[index: string]: number | undefined
4+
} | undefined
5+
}
6+
7+
export const CHARCODE_MAP = {
8+
zChan: {
9+
none: 0xF0000,
10+
normal: 0xF0001,
11+
full: 0xF0002,
12+
happy: 0xF0003,
13+
confused: 0xF0004,
14+
grinning: 0xF0005,
15+
frowning: 0xF0006,
16+
tears: 0xF0007,
17+
anxious: 0xF0008,
18+
rage: 0xF0009,
19+
fear: 0xF000A,
20+
question: 0xF000B,
21+
angry: 0xF000C,
22+
shocked: 0xF000D,
23+
ellipses: 0xF000E,
24+
sweatDrop: 0xF000F,
25+
cry: 0xF0010,
26+
cracked: 0xF0011,
27+
qualified: 0xF0012,
28+
unqualified: 0xF0013,
29+
understand: 0xF0014,
30+
thinking: 0xF0015,
31+
spark: 0xF0016,
32+
},
33+
mino: {
34+
Z: 0xF0040,
35+
S: 0xF0041,
36+
J: 0xF0042,
37+
L: 0xF0043,
38+
T: 0xF0044,
39+
O: 0xF0045,
40+
I: 0xF0046,
41+
42+
Z5: 0xF0047,
43+
S5: 0xF0048,
44+
P: 0xF0049,
45+
Q: 0xF004A,
46+
F: 0xF004B,
47+
E: 0xF004C,
48+
T5: 0xF004D,
49+
U: 0xF004E,
50+
V: 0xF004F,
51+
W: 0xF0050,
52+
X: 0xF0051,
53+
J5: 0xF0052,
54+
L5: 0xF0053,
55+
R: 0xF0054,
56+
Y: 0xF0055,
57+
N: 0xF0056,
58+
H: 0xF0057,
59+
I5: 0xF0058,
60+
61+
I3: 0xF0059,
62+
C: 0xF005A,
63+
I2: 0xF005B,
64+
O1: 0xF005C,
65+
},
66+
icon: {
67+
menu: 0xF0080,
68+
music: 0xF0081,
69+
language: 0xF0082,
70+
back: 0xF0083,
71+
play_pause: 0xF0084,
72+
info: 0xF0085,
73+
help: 0xF0086,
74+
mute: 0xF0087,
75+
volume_up: 0xF0088,
76+
volume_down: 0xF0089,
77+
retry_spin: 0xF008A,
78+
filledLogo: 0xF008B,
79+
hollowLogo: 0xF008C,
80+
toUp: 0xF008D,
81+
toDown: 0xF008E,
82+
toLeft: 0xF008F,
83+
toRight: 0xF0090,
84+
checkMark: 0xF0091,
85+
crossMark: 0xF0092,
86+
musicMark: 0xF0093,
87+
infoMark: 0xF0094,
88+
warnMark: 0xF0095,
89+
console: 0xF0096,
90+
globe: 0xF0097,
91+
video_camera: 0xF0098,
92+
settings: 0xF0099,
93+
mrz: 0xF009A,
94+
apple: 0xF009B,
95+
home: 0xF009C,
96+
cross_thick: 0xF009D,
97+
num0InSpin: 0xF009E,
98+
num1InSpin: 0xF009F,
99+
num2InSpin: 0xF00A0,
100+
num3InSpin: 0xF00A1,
101+
num4InSpin: 0xF00A2,
102+
play: 0xF00A3,
103+
pause: 0xF00A4,
104+
nextFrame: 0xF00A5,
105+
yen: 0xF00A6,
106+
dollar: 0xF00A7,
107+
euro: 0xF00A8,
108+
pound: 0xF00A9,
109+
bitcoin: 0xF00AA,
110+
onebag: 0xF00AB,
111+
export: 0xF00AC,
112+
import: 0xF00AD,
113+
trash: 0xF00AE,
114+
loadOne: 0xF00AF,
115+
saveOne: 0xF00B0,
116+
loadTwo: 0xF00B1,
117+
saveTwo: 0xF00B2,
118+
zBook: 0xF00B3,
119+
rankX: 0xF00B4,
120+
rankU: 0xF00B5,
121+
rankA: 0xF00B6,
122+
rankB: 0xF00B7,
123+
rankC: 0xF00B8,
124+
rankD: 0xF00B9,
125+
rankE: 0xF00BA,
126+
rankF: 0xF00BB,
127+
rankZ: 0xF00BC,
128+
rankS: 0xF00C2,
129+
speedOneEights: 0xF00BD,
130+
speedOneHalf: 0xF00BE,
131+
speedOne: 0xF00BF,
132+
speedTwo: 0xF00C0,
133+
speedFive: 0xF00C1,
134+
bone: 0xF00C3,
135+
invis: 0xF00C4,
136+
bomb: 0xF00C5,
137+
garbage: 0xF00C6,
138+
copy: 0xF00C7,
139+
tas: 0xF00C8,
140+
pencil: 0xF00C9,
141+
magGlass: 0xF00CA,
142+
zoomIn: 0xF00CB,
143+
zoomOut: 0xF00CC,
144+
zoomDefault: 0xF00CD,
145+
share: 0xF00CE,
146+
save: 0xF00CF,
147+
fastForward: 0xF00D0,
148+
rewind: 0xF00D1,
149+
nextSong: 0xF00D2,
150+
previousSong: 0xF00D3,
151+
cycle: 0xF00D4,
152+
cycleOne: 0xF00D5,
153+
cycleOff: 0xF00D6,
154+
random: 0xF00D7,
155+
randomOff: 0xF00D8,
156+
randomAuto: 0xF00D9,
157+
closedCaption: 0xF00DA,
158+
fullBeat: 0xF00DB,
159+
rewind10: 0xF00DC,
160+
rewind30: 0xF00DD,
161+
foward10: 0xF00DE,
162+
foward30: 0xF00DF,
163+
fontUp: 0xF00E0,
164+
fontDown: 0xF00E1,
165+
erase: 0xF00E2,
166+
auto: 0xF00E3,
167+
},
168+
key: {
169+
macCmd: 0xF0100,
170+
macOpt: 0xF0101,
171+
macCtrl: 0xF0102,
172+
shift: 0xF0103,
173+
capsLock: 0xF0104,
174+
enter_or_return: 0xF0105,
175+
backspace: 0xF0106,
176+
clear: 0xF0107,
177+
macFowardDel: 0xF0108,
178+
macEsc: 0xF0109,
179+
macTab: 0xF010A,
180+
fn: 0xF010B,
181+
macHome: 0xF010C,
182+
macEnd: 0xF010D,
183+
macPgup: 0xF010E,
184+
macPgdn: 0xF010F,
185+
macEnter: 0xF0110,
186+
space: 0xF0111,
187+
windows: 0xF0112,
188+
alt: 0xF0113,
189+
ctrl: 0xF0114,
190+
winMenu: 0xF0115,
191+
tab: 0xF0116,
192+
esc: 0xF0117,
193+
up: 0xF0118,
194+
down: 0xF0119,
195+
left: 0xF011A,
196+
right: 0xF011B,
197+
del: 0xF011C,
198+
enterText: 0xF011D,
199+
keyboard: 0xF011E,
200+
macMediaEject: 0xF011F,
201+
isoCtrl: 0xF0120,
202+
isoAlt: 0xF0121,
203+
macHomeAlt: 0xF0122,
204+
macEndAlt: 0xF0123,
205+
macPgupAlt: 0xF0124,
206+
macPgdnAlt: 0xF0125,
207+
iecPower: 0xF0126,
208+
},
209+
controller: {
210+
xbox: 0xF0180,
211+
lt: 0xF0181,
212+
rt: 0xF0182,
213+
lb: 0xF0183,
214+
rb: 0xF0184,
215+
xboxX: 0xF0185,
216+
xboxY: 0xF0186,
217+
xboxA: 0xF0187,
218+
xboxB: 0xF0188,
219+
joystickL: 0xF0189,
220+
joystickR: 0xF018A,
221+
jsLU: 0xF018B,
222+
jsLD: 0xF018C,
223+
jsLR: 0xF018D,
224+
jsLL: 0xF018E,
225+
jsRU: 0xF018F,
226+
jsRD: 0xF0190,
227+
jsRR: 0xF0191,
228+
jsRL: 0xF0192,
229+
jsLPress: 0xF0193,
230+
jsRPress: 0xF0194,
231+
dpad: 0xF0195,
232+
dpadU: 0xF0196,
233+
dpadD: 0xF0197,
234+
dpadL: 0xF0198,
235+
dpadR: 0xF0199,
236+
xboxView: 0xF019A,
237+
xboxMenu: 0xF019B,
238+
xboxShare: 0xF019C,
239+
xboxConnect: 0xF019D,
240+
ps: 0xF019E,
241+
psTriangle: 0xF019F,
242+
psCircle: 0xF01A0,
243+
psCross: 0xF01A1,
244+
psSquare: 0xF01A2,
245+
psMute: 0xF01A3,
246+
psCreate: 0xF01A4,
247+
psOption: 0xF01A5,
248+
}
249+
} as CharcodeMap;
250+
251+
export function getCharCode(index: string): number | undefined {
252+
const [i, j] = index.split('.', 2);
253+
254+
const inner = CHARCODE_MAP[i];
255+
256+
if(!inner) return;
257+
258+
return inner[j];
259+
}
260+
261+
export function getChar(index: string): string {
262+
const charCode = getCharCode(index);
263+
264+
if(!charCode) return "";
265+
266+
return String.fromCodePoint(charCode);
267+
}
268+
269+
export default getChar;

assets/lang/en.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export default {
1111
settings: "Settings"
1212
},
1313
footer: {
14-
text: `md_**Techmino Hub** \nCreated with ❤ by [the Techmino community](https://github.com/techmino-hub/techmino-hub-source-code)`
14+
text: `md_**Techmino Hub** \nCreated with ❤ by [the Techmino community](https://github.com/techmino-hub/techmino-hub-source-code)`,
15+
lang: "Language"
1516
}
1617
},
1718

@@ -20,5 +21,23 @@ export default {
2021
title: "Welcome to Techmino Hub!",
2122
article: `md_Now recreated in Nuxt.js, Techmino Hub is an unofficial website for Techmino.
2223
This page is a work in progress, more things will come soon!`
24+
},
25+
26+
lang: {
27+
tabTitle: "Techmino Hub - Language Settings",
28+
title: "Choose your preferred language",
29+
setLang: "Set language"
30+
},
31+
32+
settings: {
33+
tabTitle: "Techmino Hub - Settings",
34+
title: "Settings",
35+
loading: "Loading...",
36+
settings: {
37+
bgEnabled: "Enable background",
38+
bgSpeed: "Background animation speed"
39+
},
40+
save: "Save",
41+
noscriptWarn: "You cannot change your settings with JavaScript disabled."
2342
}
2443
} as LangEntry;

assets/lang/id.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export default {
1111
settings: "Peraturan"
1212
},
1313
footer: {
14-
text: `md_**Techmino Hub** \nDibuat dengan ❤ oleh [komunitas Techmino](https://github.com/techmino-hub/techmino-hub-source-code)`
14+
text: `md_**Techmino Hub** \nDibuat dengan ❤ oleh [komunitas Techmino](https://github.com/techmino-hub/techmino-hub-source-code)`,
15+
lang: "Bahasa"
1516
}
1617
},
1718

@@ -20,5 +21,23 @@ export default {
2021
title: "Selamat datang di Techmino Hub!",
2122
article: `md_Dibuat ulang di Nuxt.js, Techmino Hub adalah website Techmino yang dibuat oleh komunitas Techmino.
2223
Website ini sedang dalam fase mula, fitur-fitur baru akan muncul pada masa depan.`
24+
},
25+
26+
lang: {
27+
tabTitle: "Techmino Hub - Pengaturan Bahasa",
28+
title: "Bahasa",
29+
setLang: "Pilih"
30+
},
31+
32+
settings: {
33+
tabTitle: "Techmino Hub - Pengaturan",
34+
title: "Pengaturan",
35+
loading: "Memuat...",
36+
settings: {
37+
bgEnabled: "Latar belakang",
38+
bgSpeed: "Kecepatan anim. latar belakang",
39+
},
40+
save: "Simpan",
41+
noscriptWarn: "JavaScript dibutuhkan untuk mengubah pengaturan.",
2342
}
2443
} as LangEntry;

assets/types/lang.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ export type LangEntry = {
33
};
44

55
// The prefix of a string if it should be processed in Markdown
6-
export const MD_STRING_PREFIX = "md_";
6+
export const MD_STRING_PREFIX = "md_";
7+
8+
export const langNameMap = {
9+
en: "English",
10+
id: "Bahasa Indonesia"
11+
} as { [index: string]: string | undefined };

components/footer.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<script setup>
2+
import { getChar } from '~/assets/chars';
23
const localePath = useLocalePath();
34
</script>
45

56
<template>
67
<footer>
78
<div class="left" v-html="$t('common.footer.text')"></div>
89
<span class="right">
9-
<NuxtLink :to="localePath('/settings')" v-thtml="$t('common.nav.settings')"></NuxtLink>
10+
<NuxtLink :to="localePath('/language')">{{ getChar('icon.language') + ' ' + $t('common.footer.lang') }}</NuxtLink>
11+
<NuxtLink :to="localePath('/settings')">{{ $t('common.nav.settings') }}</NuxtLink>
1012
<a href="https://discord.gg/f9pUvkh">Discord</a>
1113
</span>
1214
</footer>
@@ -17,6 +19,7 @@ footer {
1719
display: flex;
1820
flex-direction: row;
1921
justify-content: space-between;
22+
flex-wrap: wrap;
2023
background-color: rgba(0, 0, 0, 0.6);
2124
padding: 0.5em 1.5em;
2225
border-top: 0.15em dotted grey;
@@ -35,6 +38,14 @@ footer {
3538
}
3639
}
3740
41+
.mid {
42+
display: flex;
43+
flex-direction: row;
44+
justify-content: center;
45+
gap: 1em;
46+
align-items: center;
47+
}
48+
3849
.right {
3950
display: flex;
4051
flex-direction: row;

0 commit comments

Comments
 (0)