Move to dynamically creating STATIC_PATHS, instead of it being static, and integrate spanish fully

This commit is contained in:
wearrrrr 2024-07-29 14:27:46 -05:00
parent 311a8e649e
commit ab3049dd84
7 changed files with 17 additions and 7 deletions

View file

@ -11,8 +11,9 @@ export default defineConfig({
i18n: {
locales: {
en: "en-US",
jp: "ja-JP",
es: "es-ES",
fr: "fr-FR",
jp: "ja-JP",
ru: "ru-RU",
zh: "zh-CN",
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

View file

@ -13,9 +13,10 @@ const themeList = [
const languageList = [
{ name: "English", value: "en" },
{ name: "Español", value: "es" },
{ name: "Français", value: "fr" },
{ name: "中文", value: "zh" },
{ name: "日本語", value: "jp" },
{ name: "中文", value: "zh" },
{ name: "Русский", value: "ru" },
];
---

View file

@ -15,10 +15,10 @@
"faq.title": "Preguntas frecuentes",
"faq.whatIsAProxy": "¿Qué es un proxy?",
"faq.whatIsAProxy.answer": "Un proxy es un método para hacer que su tráfico de Internet sea anónimo enviando su solicitud a un servidor (proxy), haciendo que haga la solicitud y luego se la envíe de vuelta. Esto permite un nivel de seguridad mucho mayor, así como eludir las restricciones del sitio web en espacios públicos y la censura".
"faq.whatIsAProxy.answer": "Un proxy es un método para hacer que su tráfico de Internet sea anónimo enviando su solicitud a un servidor (proxy), haciendo que haga la solicitud y luego se la envíe de vuelta. Esto permite un nivel de seguridad mucho mayor, así como eludir las restricciones del sitio web en espacios públicos y la censura",
"faq.noBareClients": "¿Qué significa \"there are no bare clients\"?",
"faq.noBareClients.answer": "Hay un par de razones por las que ocurre este error en particular, pero lo más común es que sea un problema con el proxy que no se carga. Por favor, vuelva a cargar la página y, si el problema persiste, ¡haga un problema de GitHub!"
"faq.noBareClients.answer": "Hay un par de razones por las que ocurre este error en particular, pero lo más común es que sea un problema con el proxy que no se carga. Por favor, vuelva a cargar la página y, si el problema persiste, ¡haga un problema de GitHub!",
"faq.contributeToAlu": "¿Cómo puedo contribuir a Alu?",
"faq.contributeToAlu.answer.segment1": "Correr la voz de Alu es un gran comienzo, pero si realmente disfrutas de Alu y quieres enlaces privados, ¡considera apoyarme a través de Patreon!",

View file

@ -1,4 +1,5 @@
import en from "./en.json";
import es from "./es.json";
import fr from "./fr.json";
import zh from "./zh.json";
import jp from "./jp.json";
@ -8,6 +9,7 @@ export const defaultLang = "en";
export const ui = {
en,
es,
fr,
zh,
jp,

View file

@ -2,8 +2,12 @@ import { ui, defaultLang } from "./ui";
type LanguageKeys = keyof typeof ui;
type TranslationKeys = keyof (typeof ui)[typeof defaultLang];
type StaticPath = { params: { lang: string } };
export const STATIC_PATHS = [{ params: { lang: "en" } }, { params: { lang: "fr" } }, { params: { lang: "zh" } }, { params: { lang: "jp" } }, { params: { lang: "ru" } }];
const STATIC_PATHS: StaticPath[] = [];
for (const lang in ui) {
STATIC_PATHS.push({ params: { lang } });
}
function getLangFromUrl(url: URL) {
// comma lol
@ -26,3 +30,5 @@ function useTranslations(lang: LanguageKeys) {
}
export const i18n = { getLangFromUrl, useTranslations, inferLangUseTranslations };
export { STATIC_PATHS };

View file

@ -33,12 +33,12 @@ const { title, optionalPreloads } = Astro.props;
<meta property="og:url" content="https://aluu.xyz" />
<meta property="og:title" content="Alu" />
<meta property="og:description" content="Alu is a sleek web proxy supporting multiple standards of communication, and wide levels of customization." />
<meta property="og:image" content="/logo.png" />
<meta property="og:image" content="/favicon.svg" />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://aluu.xyz" />
<meta property="twitter:title" content="Alu" />
<meta property="twitter:description" content="Alu is a sleek web proxy supporting multiple standards of communication, and wide levels of customization." />
<meta property="twitter:image" content="/logo.png" />
<meta property="twitter:image" content="/favicon.svg" />
<link rel="canonical" href={Astro.url.href} />
<link rel="sitemap" href="/sitemap-index.xml" />
{