remove multilingual and create a new multilingual branch

This commit is contained in:
Somrat
2024-11-18 09:55:18 +06:00
parent b092921209
commit f7bc32a629
82 changed files with 453 additions and 1928 deletions
+6 -30
View File
@@ -1,30 +1,5 @@
---
import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import {
getLangFromUrl,
getTranslations,
supportedLang,
slugSelector,
} from "@/lib/utils/languageParser";
import type { ContentEntryMap } from "astro:content";
export function getStaticPaths() {
const paths = supportedLang.map((lang) => ({
params: { lang: lang || undefined },
}));
return paths;
}
let lang = getLangFromUrl(Astro.url);
const disabledLanguages = config.settings.disable_languages as string[];
if (disabledLanguages.includes(lang)) {
lang = config.settings.default_language;
}
const { page_not_found_content, page_not_found, back_to_home } =
await getTranslations(lang as keyof ContentEntryMap);
---
<Base title="Page Not Found">
@@ -37,13 +12,14 @@ const { page_not_found_content, page_not_found, back_to_home } =
>
404
</span>
<h1 class="h2 mb-4">{page_not_found}</h1>
<h1 class="h2 mb-4">Page not found</h1>
<div class="content">
<p>{page_not_found_content}</p>
<p>
The page you are looking for might have been removed, had its name
changed, or is temporarily unavailable.
</p>
</div>
<a href={slugSelector("/", lang)} class="btn btn-primary mt-8"
>{back_to_home}</a
>
<a href="/" class="btn btn-primary mt-8">Back to home</a>
</div>
</div>
</div>