Fresh installs shouldn't produce i18n warnings #1174
Replies: 3 comments 1 reply
-
I just got this warning after trying to get an 11ty theme called Spacebook working, and ultimately gave up after a week because it was too outdated. I was frustrated upon my first Astro (with the Starlight template) installation, thinking "Is everything just broken?" and then Googled the issue, fully ready to try a different static site generator if I found nothing promising. Frankly, I'm trying out Astro because I'm unfamiliar with a lot of web dev stuff, so I didn't know what i18n is. Thankfully, I'm learning now it's just an empty placeholder for optional locales. This should 100% be fixed, even if it just adds an empty file with a comment that links to https://starlight.astro.build/guides/i18n/. |
Beta Was this translation helpful? Give feedback.
-
Dug around a bit and decided to try to tackle this in Starlight itself: #1458 |
Beta Was this translation helpful? Give feedback.
-
Behaviour should be improved in v0.17.3! If you still have a warning when starting up a project, you can remove the i18n collection from import { defineCollection } from 'astro:content';
- import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
+ import { docsSchema } from '@astrojs/starlight/schema';
export const collections = {
docs: defineCollection({ schema: docsSchema() }),
- i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
}; |
Beta Was this translation helpful? Give feedback.
-
What version of
starlight
are you using?v3.6.4
What is your idea?
I set up a new Astro project, start it up, and right off the bat the output is like:
What is the i18n collection? Why doesn't it have a folder? Should I have created the folder?
The i18n docs aren't very helpful for debugging this. It seems like I'm looking for this doc on translating the UI: https://starlight.astro.build/guides/i18n/
But I'm starting with a monolingual site. I don't have JSON files of alternative translations.
So I create an empty directory in
src/content/i18n
. And, knowing that Git does not allow empty directories (afaict), touch a.keep
file in it:Seems like it should be a
_keep
file to follow astro's rules.Why is this feature necessary?
Showing warnings on fresh installs is not good DX and it seems like this is just a flaw in the template.
Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions