Skip to content

Commit 109f37e

Browse files
committed
Add internationalization (i18n)
1 parent f1a8c33 commit 109f37e

3 files changed

Lines changed: 117 additions & 90 deletions

File tree

astro.config.mjs

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,82 @@ import starlightImageZoom from 'starlight-image-zoom'
66
import starlightLinksValidator from 'starlight-links-validator'
77

88
// https://astro.build/config
9+
//
910
export default defineConfig({
1011
output: 'static',
1112
site: 'https://docs.iw4x.io',
13+
1214
image: {
1315
service: sharpImageService({ limitInputPixels: false }),
1416
},
17+
1518
integrations: [
1619
starlight({
1720
title: 'IW4x Docs',
1821
favicon: '/favicon.svg',
22+
defaultLocale: 'root',
23+
24+
// Internationalization
25+
//
26+
locales: {
27+
root: {
28+
label: 'English',
29+
lang: 'en',
30+
},
31+
ru: {
32+
label: 'Русский',
33+
lang: 'ru',
34+
},
35+
},
36+
37+
// Styling
38+
//
1939
customCss: ['./src/styles/custom.css'],
40+
41+
// Navigation
42+
//
2043
sidebar: [
2144
{
2245
label: 'Getting Started',
2346
items: [
24-
{ label: 'Quickstart', link: '/get-started/quickstart/' },
47+
{
48+
label: 'Quickstart',
49+
link: '/get-started/quickstart/'
50+
},
2551
{
2652
label: 'Manual Installation',
2753
items: [
28-
{ label: 'On Windows', link: '/get-started/manual-install/windows-guide/' },
29-
{ label: 'On Linux', link: '/get-started/manual-install/linux-guide/' },
30-
{ label: 'On MacOS', link: '/get-started/manual-install/macos-guide/' },
31-
]
32-
}
33-
]
34-
}
54+
{
55+
label: 'On Windows',
56+
link: '/get-started/manual-install/windows-guide/'
57+
},
58+
{
59+
label: 'On Linux',
60+
link: '/get-started/manual-install/linux-guide/'
61+
},
62+
{
63+
label: 'On MacOS',
64+
link: '/get-started/manual-install/macos-guide/'
65+
},
66+
],
67+
},
68+
],
69+
},
3570
],
71+
72+
// Git integration
73+
//
3674
editLink: {
37-
baseUrl: 'https://github.com/iw4x/docs/edit/main/'
75+
baseUrl: 'https://github.com/iw4x/docs/edit/main/',
3876
},
77+
78+
// Social links
79+
//
3980
social: [
4081
{
4182
icon: 'github',
4283
label: 'GitHub',
43-
href: 'https://github.com/iw4x'
84+
href: 'https://github.com/iw4x',
4485
},
4586
{
4687
icon: 'discord',
@@ -53,17 +94,22 @@ export default defineConfig({
5394
href: 'https://x.com/IW4x_dev',
5495
},
5596
],
97+
98+
// Plugins
99+
//
56100
plugins: [
57101
starlightAutoDrafts(),
58102
starlightImageZoom(),
59-
starlightLinksValidator()
103+
starlightLinksValidator(),
60104
],
61105
}),
62106
],
63107

108+
// Development server configuration
109+
//
64110
vite: {
65111
server: {
66-
allowedHosts: ['docs.iw4x.io']
67-
}
68-
}
112+
allowedHosts: ['docs.iw4x.io'],
113+
},
114+
},
69115
});
Lines changed: 24 additions & 43 deletions
Loading

src/styles/custom.css

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
/* Dark mode colors. */
22
:root {
3-
--sl-color-accent-low: #052d05;
4-
--sl-color-accent: #008104;
5-
--sl-color-accent-high: #abd6a7;
6-
--sl-color-white: #ffffff;
7-
--sl-color-gray-1: #eceef2;
8-
--sl-color-gray-2: #c6c8cd;
9-
--sl-color-gray-3: #a0a4ae;
10-
--sl-color-gray-4: #545861;
11-
--sl-color-gray-5: #353840;
12-
--sl-color-gray-6: #23272e;
13-
--sl-color-black: #17181c;
3+
--sl-color-accent-low: #052d05;
4+
--sl-color-accent: #008104;
5+
--sl-color-accent-high: #abd6a7;
6+
--sl-color-white: #ffffff;
7+
--sl-color-gray-1: #eceef2;
8+
--sl-color-gray-2: #c6c8cd;
9+
--sl-color-gray-3: #a0a4ae;
10+
--sl-color-gray-4: #545861;
11+
--sl-color-gray-5: #353840;
12+
--sl-color-gray-6: #23272e;
13+
--sl-color-black: #17181c;
1414

15-
--sl-content-width: 55rem;
16-
--sl-text-5xl: 3.5rem;
17-
18-
video {
19-
width: 100%;
20-
height: auto;
21-
display: block;
22-
border: none;
23-
}
15+
--sl-content-width: 55rem;
16+
--sl-text-5xl: 3.5rem;
17+
18+
video {
19+
width: 100%;
20+
height: auto;
21+
display: block;
22+
border: none;
23+
}
2424
}
2525

2626
/* Light mode colors. */
2727
:root[data-theme='light'] {
28-
--sl-color-accent-low: #c1e2be;
29-
--sl-color-accent: #005a02;
30-
--sl-color-accent-high: #003f01;
31-
--sl-color-white: #17181c;
32-
--sl-color-gray-1: #23272e;
33-
--sl-color-gray-2: #353840;
34-
--sl-color-gray-3: #545861;
35-
--sl-color-gray-4: #878b95;
36-
--sl-color-gray-5: #c0c2c7;
37-
--sl-color-gray-6: #eceef2;
38-
--sl-color-gray-7: #f5f6f8;
39-
--sl-color-black: #ffffff;
40-
}
28+
--sl-color-accent-low: #c1e2be;
29+
--sl-color-accent: #005a02;
30+
--sl-color-accent-high: #003f01;
31+
--sl-color-white: #17181c;
32+
--sl-color-gray-1: #23272e;
33+
--sl-color-gray-2: #353840;
34+
--sl-color-gray-3: #545861;
35+
--sl-color-gray-4: #878b95;
36+
--sl-color-gray-5: #c0c2c7;
37+
--sl-color-gray-6: #eceef2;
38+
--sl-color-gray-7: #f5f6f8;
39+
--sl-color-black: #ffffff;
40+
}

0 commit comments

Comments
 (0)