Skip to content

Commit

Permalink
feat: use Astro i18n config in docs for demo purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo committed May 8, 2024
1 parent 3dbedb2 commit f8e36b2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,29 @@ const site = VERCEL_PREVIEW_SITE || 'https://starlight.astro.build/';
export default defineConfig({
site,
trailingSlash: 'always',
// TODO(HiDeoo) Remove
i18n: {
defaultLocale: 'en',
locales: [
'en',
'de',
'es',
'ja',
'fr',
'it',
'id',
{ codes: ['zh-CN'], path: 'zh-cn' },
{ codes: ['pt-BR'], path: 'pt-br' },
{ codes: ['pt-PT'], path: 'pt-pt' },
'ko',
'tr',
'ru',
'hi',
'da',
'uk',
],
routing: { prefixDefaultLocale: false },
},
integrations: [
starlight({
title: 'Starlight',
Expand Down Expand Up @@ -66,7 +89,8 @@ export default defineConfig({
},
],
customCss: process.env.NO_GRADIENTS ? [] : ['./src/assets/landing.css'],
locales,
// TODO(HiDeoo) Uncomment
// locales,
sidebar: [
{
label: 'Start Here',
Expand Down
2 changes: 2 additions & 0 deletions packages/starlight/components/Banner.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import type { Props } from '../props';
const { banner } = Astro.props.entry.data;
---

<!-- // TODO(HiDeoo) Remove -->
<div class="sl-banner">{Astro.currentLocale}</div>
{banner && <div class="sl-banner" set:html={banner.content} />}

<style>
Expand Down

0 comments on commit f8e36b2

Please sign in to comment.