Skip to content

Commit f3a1010

Browse files
committed
feat: finally multi lang working fine
1 parent 7a3fb0d commit f3a1010

23 files changed

+219
-54
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ updates:
1212
directory: "/"
1313
schedule:
1414
interval: "weekly"
15-
package-manager: "bun"

docs/.vitepress/config.ts

Lines changed: 217 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,230 @@
11
// .vitepress/config.js
2+
3+
const sidebar = (lang = "", override = {}) => {
4+
const items = [
5+
{ page: "getting-started/introduction", text: "Introduction" },
6+
{ page: "getting-started/installation", text: "Installation" },
7+
{ page: "reference/commands", text: "Commands" },
8+
{ page: "reference/overview-scripts", text: "Overview Scripts" },
9+
{ page: "project/roadmap", text: "Roadmap" },
10+
{ page: "project/contributing", text: "Contributing" },
11+
{ page: "project/codeofconduct", text: "Code of Conduct" },
12+
{ page: "project/inspiration", text: "Inspiration" },
13+
{ page: "project/contributors", text: "Contributions" },
14+
];
15+
16+
return items.map(item => {
17+
let path = "/";
18+
19+
if (lang) {
20+
path += `${lang}/`;
21+
}
22+
23+
if (item.page) {
24+
path += `${item.page}`;
25+
}
26+
27+
return {
28+
link: path,
29+
text: override[item.page] || item.text
30+
};
31+
});
32+
};
33+
34+
const nav = (lang = "", override = {}) => {
35+
let guidePath = "/getting-started/introduction";
36+
37+
if (lang) {
38+
guidePath = `/${lang}/getting-started/introduction`;
39+
}
40+
41+
return [
42+
{ text: override.home || "Home", link: lang ? `/${lang}/` : "/" },
43+
{ text: override.guide || "Guide", link: guidePath },
44+
{
45+
text: "4.4.7",
46+
items: [
47+
{
48+
text: override.changelog || 'Changelog',
49+
link: 'https://github.com/harilvfs/carch/blob/main/CHANGELOG.md'
50+
},
51+
],
52+
},
53+
];
54+
};
55+
256
export default {
357
title: 'Carch',
4-
description: 'Documentation website of carch',
5-
// base: "/docs/",
58+
description: 'Documentation website of Carch',
659
lastUpdated: true,
60+
cleanUrls: true,
61+
base: '/',
62+
63+
// Rewrites for different language folders
64+
// rewrites: {
65+
// "README.md": "index.md",
66+
// "np/README.md": "np/index.md",
67+
// "hi/README.md": "hi/index.md",
68+
// ":lang/:path*": ":lang/:path*"
69+
// },
770

871
head: [
9-
["link", { rel: "icon", href: "/carch.png" }],
10-
],
72+
["link", { rel: "icon", href: "/carch.png" }],
73+
],
1174

12-
themeConfig: {
13-
siteTitle: "Carch",
14-
logo: "/carch.png",
15-
outline: "deep",
16-
docsDir: "/docs",
17-
editLink: {
18-
pattern: "https://github.com/carch-org/docs/tree/main/docs/:path",
19-
text: "Edit this page on GitHub",
75+
locales: {
76+
root: {
77+
label: "English",
78+
lang: "en-US",
79+
title: "Carch",
80+
description: "Documentation website of CArch",
81+
82+
themeConfig: {
83+
siteTitle: "Carch",
84+
logo: "/carch.png",
85+
outline: "deep",
86+
docsDir: "/docs",
87+
88+
editLink: {
89+
pattern: "https://github.com/carch-org/docs/tree/main/docs/:path",
90+
text: "Edit this page on GitHub",
91+
},
92+
93+
nav: nav("", {}),
94+
sidebar: sidebar("", {}),
95+
96+
socialLinks: [
97+
{ icon: "telegram", link: "https://t.me/carchx" },
98+
{ icon: "discord", link: "https://discord.com/invite/8NJWstnUHd" },
99+
{ icon: "gmail", link: "mailto:[email protected]" },
100+
],
101+
102+
footer: {
103+
message: "Released under the MIT License.",
104+
copyright: "Copyright © 2025 Hari Chalise",
105+
},
106+
107+
returnToTopLabel: 'Go to Top',
108+
sidebarMenuLabel: 'Menu',
109+
}
20110
},
21-
nav: [
22-
{ text: "Home", link: "/" },
23-
{ text: "Guide", link: "/getting-started/introduction" },
24-
{
25-
text: "4.4.7",
26-
items: [
27-
{
28-
text: 'Changelog',
29-
link: 'https://github.com/harilvfs/carch/blob/main/CHANGELOG.md'
30-
},
111+
112+
np: {
113+
label: "नेपाली",
114+
lang: "ne-NP",
115+
title: "सी-आर्च",
116+
description: "सी-आर्चको कागजात वेबसाइट",
117+
118+
themeConfig: {
119+
siteTitle: "सी-आर्च",
120+
logo: "/carch.png",
121+
outline: "deep",
122+
docsDir: "/docs",
123+
124+
langMenuLabel: "भाषाहरू",
125+
returnToTopLabel: "माथि जानुहोस्",
126+
sidebarMenuLabel: "मेनु",
127+
128+
editLink: {
129+
pattern: "https://github.com/carch-org/docs/tree/main/docs/:path",
130+
text: "GitHub मा यो पृष्ठ सम्पादन गर्नुहोस्",
131+
},
132+
133+
nav: nav("np", {
134+
home: "घर",
135+
guide: "गाइड",
136+
changelog: "परिवर्तन लग"
137+
}),
138+
139+
sidebar: sidebar("np", {
140+
"getting-started/introduction": "परिचय",
141+
"getting-started/installation": "स्थापना",
142+
"reference/commands": "आदेशहरू",
143+
"reference/overview-scripts": "स्क्रिप्ट सिंहावलोकन",
144+
"project/roadmap": "रोडम्याप",
145+
"project/contributing": "योगदान",
146+
"project/codeofconduct": "आचार संहिता",
147+
"project/inspiration": "प्रेरणा",
148+
"project/contributors": "योगदानकर्ताहरू"
149+
}),
150+
151+
socialLinks: [
152+
{ icon: "telegram", link: "https://t.me/carchx" },
153+
{ icon: "discord", link: "https://discord.com/invite/8NJWstnUHd" },
154+
{ icon: "gmail", link: "mailto:[email protected]" },
31155
],
32-
},
33-
],
34-
sidebar: [
35-
{ text: "Introduction", link: "/getting-started/introduction" },
36-
{ text: "Installation", link: "/getting-started/installation" },
37-
{ text: "Commands", link: "/reference/commands" },
38-
{ text: "Overview Scripts", link: "/reference/overview-scripts" },
39-
{ text: "Roadmap", link: "/project/roadmap" },
40-
{ text: "Contributing", link: "/project/contributing" },
41-
{ text: "Code of Conduct", link: "/project/codeofconduct" },
42-
{ text: "Inspiration", link: "/project/inspiration" },
43-
{ text: "Contributions", link: "/project/contributors" },
44-
],
156+
157+
footer: {
158+
message: "MIT लाइसेन्स अन्तर्गत जारी।",
159+
copyright: "प्रतिलिपि अधिकार © २०२५ हरि चालिसे",
160+
},
161+
162+
}
163+
},
164+
165+
hi: {
166+
label: "हिन्दी",
167+
lang: "hi-IN",
168+
title: "सी-आर्च",
169+
description: "सी-आर्च की दस्तावेज़ वेबसाइट",
170+
171+
themeConfig: {
172+
siteTitle: "सी-आर्च",
173+
logo: "/carch.png",
174+
outline: "deep",
175+
docsDir: "/docs",
176+
177+
langMenuLabel: "भाषाएं",
178+
returnToTopLabel: "ऊपर जाएं",
179+
sidebarMenuLabel: "मेनू",
180+
181+
editLink: {
182+
pattern: "https://github.com/carch-org/docs/tree/main/docs/:path",
183+
text: "GitHub पर इस पृष्ठ को संपादित करें",
184+
},
185+
186+
nav: nav("hi", {
187+
home: "होम",
188+
guide: "गाइड",
189+
changelog: "चेंजलॉग"
190+
}),
191+
192+
sidebar: sidebar("hi", {
193+
"getting-started/introduction": "परिचय",
194+
"getting-started/installation": "इंस्टॉलेशन",
195+
"reference/commands": "कमांड्स",
196+
"reference/overview-scripts": "स्क्रिप्ट्स का अवलोकन",
197+
"project/roadmap": "रोडमैप",
198+
"project/contributing": "योगदान",
199+
"project/codeofconduct": "आचार संहिता",
200+
"project/inspiration": "प्रेरणा",
201+
"project/contributors": "योगदानकर्ता"
202+
}),
203+
204+
socialLinks: [
205+
{ icon: "telegram", link: "https://t.me/carchx" },
206+
{ icon: "discord", link: "https://discord.com/invite/8NJWstnUHd" },
207+
{ icon: "gmail", link: "mailto:[email protected]" },
208+
],
209+
210+
footer: {
211+
message: "MIT लाइसेंस के तहत जारी।",
212+
copyright: "कॉपीराइट © 2025 हरि चालिसे",
213+
},
214+
215+
}
216+
},
217+
},
218+
219+
themeConfig: {
220+
logo: "/carch.png",
221+
search: {
222+
provider: "local"
223+
},
45224
socialLinks: [
46225
{ icon: "telegram", link: "https://t.me/carchx" },
47226
{ icon: "discord", link: "https://discord.com/invite/8NJWstnUHd" },
48-
{icon: "gmail", link: "mailto:[email protected]"},
49-
],
50-
footer: {
51-
message: "Released under the MIT License.",
52-
copyright: "Copyright © 2025 Hari Chalise",
53-
},
54-
search: {
55-
provider: "local",
56-
},
57-
returnToTopLabel: 'Go to Top',
58-
sidebarMenuLabel: 'Menu',
59-
},
227+
{ icon: "gmail", link: "mailto:[email protected]" },
228+
],
229+
}
60230
};
61-

docs/getting-started/introduction.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<img
44
src="/carch.png"
5-
alt="carch „Snazzy“"
65
width="25%"
76
align="right"
87
/>
File renamed without changes.

.github/lang/hi/getting-started/introduction.md renamed to docs/hi/getting-started/introduction.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<img
44
src="/carch.png"
5-
alt="carch „Snazzy""
65
width="25%"
76
align="right"
87
/>
@@ -48,4 +47,4 @@
4847
- **सी-आर्च कमांड्स**
4948
*विभिन्न कार्यों और ऑपरेशन्स को आसानी से संभालने के लिए एक कमांड-लाइन इंटरफेस शामिल है।*
5049

51-
**सी-आर्च के साथ, आप बुनियादी सेटअप और सिस्टम कॉन्फ़िगरेशन को सहजता से प्रबंधित कर सकते हैं। फीडबैक हमेशा स्वागत है — हम आपसे सुनना पसंद करेंगे!**
50+
**सी-आर्च के साथ, आप बुनियादी सेटअप और सिस्टम कॉन्फ़िगरेशन को सहजता से प्रबंधित कर सकते हैं। फीडबैक हमेशा स्वागत है — हम आपसे सुनना पसंद करेंगे!**
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)