Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose FS translation system to plugins #2578

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Nov 5, 2024

Description

This plugin exposes the file system translation system to Starlight plugins throught the setup hook using a new useTranslations() callback function.

This change requires the addition of a new plugin hook (currently named init, I picked the first thing coming to mind to get started) which now exposes the injectTranslations() callback function (which was previously available in the setup hook).

The documentation so far is only a rough draft to get an idea of everything changed.

Remaining tasks

  • Restore the docs/astro.config.mjs file
  • Restore the docs/package.json file
  • Restore the docs/src/content/i18n/zh-CN.json file
  • Remove the entire packages/demo-plugin/ directory
  • Run pnpm i to remove mention of the starlight-demo-plugin package in the lockfile
  • Remove all remaining // TODO(HiDeoo) comments (if any)

Copy link

changeset-bot bot commented Nov 5, 2024

🦋 Changeset detected

Latest commit: 5eb0121

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@astrojs/starlight Minor
starlight-demo-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added 📚 docs Documentation website changes 🌟 core Changes to Starlight’s main package labels Nov 5, 2024
Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 5eb0121
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/672a4ed9039a420008483da9
😎 Deploy Preview https://deploy-preview-2578--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -152,7 +151,7 @@ export function getStarlightEcConfigPreprocessor({
},
...otherStyleOverrides,
},
getBlockLocale: ({ file }) => pathToLocale(file.path, { starlightConfig, astroConfig }),
getBlockLocale: ({ file }) => pathToLang(file.path, { astroConfig, starlightConfig }),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expressive Code technically expects a Starlight language here so I changed it but this is not a bug fix (no changeset) as Expressive Code lower-cases the language identifier anyway.

@astrobot-houston
Copy link
Collaborator

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en guides/i18n.mdx Source changed, localizations will be marked as outdated.
en reference/plugins.md Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package 📚 docs Documentation website changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants