feat(docs): add internationalization and add spanish lang

This commit is contained in:
Nelson Gutierrez
2023-11-12 16:15:26 -06:00
parent 8e22e68def
commit 3307d0570f
11 changed files with 496 additions and 0 deletions

View File

@@ -1,6 +1,11 @@
import starlight from '@astrojs/starlight';
import { defineConfig } from 'astro/config';
export const locales = {
root: { label: 'English', lang: 'en' },
es: { label: 'Español', lang: 'es' },
};
// https://astro.build/config
export default defineConfig({
integrations: [
@@ -21,10 +26,16 @@ export default defineConfig({
{
label: 'Guides',
autogenerate: { directory: 'guides' },
translations: {
es: 'Guías',
},
},
{
label: 'Challenges',
autogenerate: { directory: 'challenges' },
translations: {
es: 'Desafíos',
},
},
],
head: [
@@ -51,6 +62,17 @@ export default defineConfig({
TableOfContents: './src/components/TableOfContents.astro',
PageTitle: './src/components/PageTitle.astro',
},
defaultLocale: 'root',
locales: {
root: {
label: 'English',
lang: 'en',
},
es: {
label: 'Español',
lang: 'es',
},
},
}),
],
});